Spring-free
Run MCP servers in plain Java applications, CLI tools, embedded processes, and small services.
Spring-free
Run MCP servers in plain Java applications, CLI tools, embedded processes, and small services.
Annotation-driven
Define tools, resources, prompts, and completions with concise, type-aware Java annotations.
Compile-time generation
Generate deterministic component bindings and JSON schemas during compilation.
Multiple transports
Serve local clients over STDIO or expose production integrations over Streamable HTTP.
Model Context Protocol (MCP) is a standardized protocol for building servers that expose data and functionality to LLM applications. Similar to Web API, but specifically designed for LLM interactions.
MCP helps you build agents and complex workflows on top of LLMs. The official MCP Java SDK is the foundation layer, while Spring AI MCP is the standard entry point for Spring applications. This SDK exists for the plain Java path: CLI tools, embedded servers, local automation, and small service processes that benefit from annotations but do not need a Spring runtime.
| Project | Best fit | Role |
|---|---|---|
| Official MCP Java SDK | Library authors and low-level protocol integration | Foundation |
| Spring AI MCP | Spring Boot / Spring Framework applications | Spring ecosystem standard |
| mcp-annotated-java-sdk | Plain Java, CLI, embedded, and lightweight MCP servers | Spring-free annotation layer |
Rule of thumb: Spring AI for Spring apps; mcp-annotated-java-sdk for lightweight Java MCP servers without Spring.
| Feature | Official MCP Java SDK | Spring AI MCP | This SDK |
|---|---|---|---|
| Primary audience | Low-level Java integrations | Spring applications | Plain Java MCP servers |
| Spring required | No | Yes, for Spring integration | No |
| Component model | Programmatic registration | Spring beans and annotations | Plain classes and annotations |
| JSON Schema | Manual or app-provided | Generated by Spring AI | Generated by annotation processor |
| Startup model | You assemble the server | Spring Boot auto-configuration | McpApplication.run(...) |
| Best use case | Maximum control | Enterprise Spring apps | CLI, embedded, local tools, small services |
This SDK is especially suitable for the following scenarios:
| Mode | Description | Use Case |
|---|---|---|
| STDIO | Standard input/output communication | CLI tools, local development |
| STREAMABLE | HTTP streaming | Web applications, recommended for production |
type: ASYNC selects the async MCP server API; your annotated methods stay blocking Java wrapped in Mono.fromCallable(...). See Getting Started — Runtime model.mcp-server.yml; instructions must be non-blank, capabilities.subscribe-resource is required only when resource support is enabled, and the streamable section must be present and complete only when mode is STREAMABLE. Defaults apply only when building a configuration programmatically via ServerConfiguration.builder().Want to get started quickly? Check out the Getting Started Guide to learn how to build your first MCP server in 5 minutes.