Java SDK¶
Build distributed MCP agents with Java annotations and zero boilerplate
Overview¶
The MCP Mesh Java SDK provides an annotation-based API for building distributed agent systems:
@MeshAgent- Configure agent servers with auto-run@MeshTool- Register capabilities with dependency injection@MeshLlm- LLM-powered tools with automatic tool discovery@MeshLlmProvider- Zero-code LLM providers via LiteLLM@MeshRoute- Spring Boot routes with mesh DI
Installation¶
<!-- Add to your pom.xml -->
<dependency>
<groupId>io.mcpmesh</groupId>
<artifactId>mcp-mesh</artifactId>
<version>LATEST</version>
</dependency>
Quick Start¶
# View the quick start guide
meshctl man quickstart --java
# Or scaffold a new agent
meshctl scaffold --name my-agent --lang java
Documentation¶
For comprehensive documentation, use the built-in man pages:
meshctl man --list # List all topics
meshctl man <topic> --java # View Java version
meshctl man <topic> --java --raw # Get markdown output (LLM-friendly)
Key Topics¶
| Topic | Command | Description |
|---|---|---|
| Quick Start | meshctl man quickstart --java | Get started in minutes |
| Annotations | meshctl man decorators --java | @MeshTool, @MeshAgent, @MeshLlm |
| Dependency Injection | meshctl man di --java | How DI works |
| LLM Integration | meshctl man llm --java | Build AI-powered agents |
| Deployment | meshctl man deployment --java | Local, Docker, Kubernetes |