MCP Annotated Java SDK
Annotation-driven MCP dev ๐ No Spring, Zero Boilerplate, Pure Java
What is MCP Annotated Java SDK?
MCP Annotated Java SDK is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to annotation-driven mcp dev ๐ no spring, zero boilerplate, pure java
Annotation-driven MCP dev ๐ No Spring, Zero Boilerplate, Pure Java
This server falls under the Developer Tools category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- Annotation-driven MCP dev ๐ No Spring, Zero Boilerplate, Pur
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx mcp-annotated-java-sdkConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use MCP Annotated Java SDK
The MCP Annotated Java SDK is a lightweight, annotation-driven framework for building MCP servers in pure Java without any dependency on Spring or other heavyweight frameworks. Developers define tools, resources, and prompts by adding annotations like @McpTool, @McpResource, and @McpPrompt to regular Java methods, and the SDK generates the required MCP JSON schemas and wire protocol handling automatically. It requires Java 17+ and is distributed via Maven Central, making it a natural fit for Java developers who want to expose backend logic to AI assistants without learning a new language or runtime.
Prerequisites
- Java 17 or later (JDK)
- Maven or Gradle build tool
- An MCP-compatible client such as Claude Desktop for testing the built server
Add the SDK dependency to your project
Add the mcp-annotated-java-sdk dependency to your pom.xml (Maven) or build.gradle (Gradle).
<!-- Maven -->
<dependency>
<groupId>io.github.thought2code</groupId>
<artifactId>mcp-annotated-java-sdk</artifactId>
<version>0.19.0</version>
</dependency>
// Gradle
implementation 'io.github.thought2code:mcp-annotated-java-sdk:0.19.0'Create the server configuration file
Create mcp-server.yml in src/main/resources to configure the server name, version, transport mode, and enabled capabilities.
enabled: true
mode: STDIO
name: my-mcp-server
version: 1.0.0
capabilities:
resource: true
tool: true
prompt: trueWrite your main entry point
Create a main class annotated with @McpServerApplication and launch it using McpApplication.run().
@McpServerApplication
public class MyMcpServer {
public static void main(String[] args) {
McpApplication.run(MyMcpServer.class, args);
}
}Define tools, resources, and prompts with annotations
Annotate Java methods with @McpTool, @McpResource, or @McpPrompt. Parameters are documented with @McpToolParam or @McpPromptParam.
@McpTool(description = "Add two numbers together")
public int add(
@McpToolParam(name = "a", description = "First number") int a,
@McpToolParam(name = "b", description = "Second number") int b
) {
return a + b;
}
@McpResource(uri = "system://info", description = "System information")
public Map<String, String> getSystemInfo() {
return Map.of("java.version", System.getProperty("java.version"));
}Build and register with your MCP client
Build a fat JAR with Maven/Gradle and register it in your Claude Desktop config using java -jar.
mvn package -DskipTests
# Then register in claude_desktop_config.json:
# "command": "java", "args": ["-jar", "/path/to/your-server.jar"]MCP Annotated Java SDK Examples
Client configuration
Claude Desktop JSON configuration for a Java MCP server built with the mcp-annotated-java-sdk.
{
"mcpServers": {
"my-java-mcp": {
"command": "java",
"args": ["-jar", "/absolute/path/to/my-mcp-server.jar"]
}
}
}Prompts to try
Example prompts for testing a Java MCP server built with annotated tools and resources.
- "Call the add tool with a=15 and b=27"
- "Read the system://info resource and tell me the Java version"
- "Use the generate-code prompt with language=Java and task='read a file line by line'"
- "List all available tools on the my-java-mcp server"
- "Execute the database query tool with query='SELECT COUNT(*) FROM users'"Troubleshooting MCP Annotated Java SDK
ClassNotFoundException or NoSuchMethodError at startup
Ensure you are running Java 17 or later. Check with 'java -version'. The SDK uses Java 17 features and will fail to load on older JVMs. Also verify you built a fat/uber JAR that includes all dependencies, not just the compiled classes.
Tools are not discovered โ Claude sees an empty tool list
The @McpServerApplication class and @McpTool-annotated methods must be in the same package or sub-packages. Ensure capabilities.tool is set to true in mcp-server.yml. Rebuild and re-deploy the JAR after any annotation changes.
mcp-server.yml not found on classpath
Place mcp-server.yml in src/main/resources so Maven/Gradle includes it in the JAR. Verify it appears at the root of the classpath by running 'jar tf your-server.jar | grep mcp-server'.
Frequently Asked Questions about MCP Annotated Java SDK
What is MCP Annotated Java SDK?
MCP Annotated Java SDK is a Model Context Protocol (MCP) server that annotation-driven mcp dev ๐ no spring, zero boilerplate, pure java It connects AI assistants to external tools and data sources through a standardized interface.
How do I install MCP Annotated Java SDK?
Follow the installation instructions on the MCP Annotated Java SDK GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with MCP Annotated Java SDK?
MCP Annotated Java SDK works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is MCP Annotated Java SDK free to use?
Yes, MCP Annotated Java SDK is open source and available under the MIT license. You can use it freely in both personal and commercial projects.
MCP Annotated Java SDK Alternatives โ Similar Developer Tools Servers
Looking for alternatives to MCP Annotated Java SDK? Here are other popular developer tools servers you can use with Claude, Cursor, and VS Code.
Ecc
โ 188.2kThe agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.
Javaguide
โ 155.8kJava ้ข่ฏ & ๅ็ซฏ้็จ้ข่ฏๆๅ๏ผ่ฆ็่ฎก็ฎๆบๅบ็กใๆฐๆฎๅบใๅๅธๅผใ้ซๅนถๅใ็ณป็ป่ฎพ่ฎกไธ AI ๅบ็จๅผๅ
Gemini CLI
โ 104.5kA secure MCP server that wraps the Google Gemini CLI, allowing clients to query Gemini models using local OAuth sessions without requiring an API key. It provides tools for model interaction and diagnostics with built-in protection against command in
Awesome MCP Servers
โ 87.3kโญ Curated list of Model Context Protocol (MCP) servers - tools that extend Claude Desktop, Cursor, Windsurf, and other MCP clients with custom capabilities.
MCP Servers
โ 86.0kModel Context Protocol Servers
CC Switch
โ 77.5kA cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Gemini CLI & Hermes Agent. Only official website: ccswitch.io
Browse More Developer Tools MCP Servers
Explore all developer tools servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up MCP Annotated Java SDK in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use MCP Annotated Java SDK?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.