Java implementation of Model Context Protocol (MCP) server with example tools
{
"mcpServers": {
"my-mcp-server-java": {
"args": [
"-jar",
"/Users/steveo/projects/my-mcp-server-java/build/libs/my-mcp-server-1.0.0.jar"
],
"command": "java"
}
}
}Are you the author?
Add this badge to your README to show your security score and help users find safe servers.
Java implementation of Model Context Protocol (MCP) server with example tools
Is it safe?
No package registry to scan.
No authentication — any process on your machine can connect.
License not specified.
Is it maintained?
Last commit 171 days ago.
Will it work with my client?
Transport: stdio. Works with Claude Desktop, Cursor, Claude Code, and most MCP clients.
No automated test available for this server. Check the GitHub README for setup instructions.
No known vulnerabilities.
This server is missing a description. Tools and install config are also missing.If you've used it, help the community.
Add informationHave you used this server?
Share your experience — it helps other developers decide.
Sign in to write a review.
Dynamic problem-solving through sequential thought chains
A Model Context Protocol server for searching and analyzing arXiv papers
An open-source AI agent that brings the power of Gemini directly into your terminal.
The official Python SDK for Model Context Protocol servers and clients
MCP Security Weekly
Get CVE alerts and security updates for My Mcp Server Java and similar servers.
Start a conversation
Ask a question, share a tip, or report an issue.
Sign in to join the discussion.
A Java implementation of a Model Context Protocol (MCP) server that provides example tools for Claude Desktop.
This MCP server provides three example tools:
cd /Users/steveo/projects/my-mcp-server-java
./gradlew build
This will create an executable JAR file at build/libs/my-mcp-server-1.0.0.jar
You can test the server by running it directly:
java -jar build/libs/my-mcp-server-1.0.0.jar
The server will start and wait for JSON-RPC messages via stdin/stdout.
Alternatively, you can run it using Gradle:
./gradlew run
To use this server with Claude Desktop, add it to your Claude configuration file:
On macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
On Windows: %APPDATA%\Claude\claude_desktop_config.json
Add the following configuration:
{
"mcpServers": {
"my-mcp-server-java": {
"command": "java",
"args": [
"-jar",
"/Users/steveo/projects/my-mcp-server-java/build/libs/my-mcp-server-1.0.0.jar"
]
}
}
}
Important: Update the path above to match your actual installation location.
After adding the configuration:
my-mcp-server-java/
├── build.gradle # Gradle build configuration
├── settings.gradle # Gradle settings
├── gradlew # Gradle wrapper script (Unix)
├── gradlew.bat # Gradle wrapper script (Windows)
├── gradle/
│ └── wrapper/ # Gradle wrapper files
└── src/
└── main/
└── java/
└── com/
└── example/
└── mcp/
├── MCPServer.java # Main server implementation
├── Tool.java # Tool interface
├── ToolRegistry.java # Tool management
├── TextContent.java # Response content wrapper
├── CalculateTool.java # Calculator tool
├── ReverseTextTool.java # Text reversal tool
└── WordCountTool.java # Word count tool
To add new tools to your server:
Tool interfacegetName() - returns the tool namegetDefinition(ObjectMapper mapper) - returns the JSON tool definitionexecute(JsonNode arguments) - executes the tool logicMCPServer.registerTools() method./gradlew buildExample tool implementation:
public class MyTool implements Tool {
@Override
public String getName() {
return "my_tool";
}
@Override
public JsonNode getDefinition(ObjectMapper mapper) {
ObjectNode tool = mapper.createObjectNode();
tool.put("name", "my_tool");
tool.put("description", "Description of what my tool does");
// Define input schema
ObjectNode inputSchema = mapper.createObjectNode();
inputSchema.put("type", "object");
// ... add properties
tool.set("inpu
... [View full README on GitHub](https://github.com/steveo-ocheng/my-mcp-server-java#readme)