Repository navigation
0.1.0
Mocapi 0.1.0
First public release of Mocapi — a Spring Boot framework for building Model Context Protocol (MCP) servers in Java.
Highlights
- MCP 2025-11-25 compliance — passes the official
@modelcontextprotocol/conformancetest suite - Annotation-driven tools — define tools with
@ToolServiceand@ToolMethod - Interactive features — progress notifications, structured logging, form-based elicitation, LLM sampling
- Fluent elicitation schema builder — type-safe schema construction with
RequestedSchemaBuilder - Streamable HTTP transport — SSE streaming for tool calls, synchronous JSON for all other methods
- Pluggable session storage — in-memory, Redis, PostgreSQL, NATS, Hazelcast via Substrate
- Encrypted SSE event IDs — AES-256-GCM prevents cross-session event enumeration
- Multi-node ready — sessions, mailboxes, and journals work across nodes with clustered backends
- 97% test coverage — 400+ unit tests across all modules
Modules
| Module | Description |
|---|---|
| `mocapi-api` | User-facing API: `@ToolService`, `@ToolMethod`, `McpToolContext`, provider interfaces |
| `mocapi-model` | MCP protocol types |
| `mocapi-server` | Stateful MCP server: session management, JSON-RPC dispatch, tool invocation |
| `mocapi-transport-streamable-http` | Streamable HTTP transport with SSE |
| `mocapi-spring-boot-starter` | All-in-one starter for Spring Boot applications |
Quick Start
```xml
com.callibrity.mocapi
mocapi-spring-boot-starter
0.1.0
```
```java
@component
@Toolservice
public class GreetingTool {
@ToolMethod(name = "greet", description = "Returns a greeting")
public GreetingResponse greet(String name) {
return new GreetingResponse("Hello, " + name + "!");
}
public record GreetingResponse(String message) {}
}
```
Dependencies
- Java 25+
- Spring Boot 4.0.5
- Substrate 0.4.0
- Odyssey 0.8.1
- RipCurl 2.3.0
- Methodical 0.3.0