Serverdex · build · Java
Build an MCP server in Java
1. Install the Java SDK
package: io.modelcontextprotocol.sdk:mcp<!-- Maven -->
<dependency>
<groupId>io.modelcontextprotocol.sdk</groupId>
<artifactId>mcp</artifactId>
</dependency>The official SDK repository: modelcontextprotocol/java-sdk.
2. The shape of a minimal server
start from this APIThe Java SDK's minimal server lives in its own guide — see the quickstart. Spring AI users add the spring-ai-starter-mcp-server and annotate methods with @Tool.This is the starting API, not a full program — the complete, always-current walkthrough is the official quickstart. Define your tools, then connect a transport (stdio for local, HTTP for remote). Read on 1 December 2026; confirm the current version in the quickstart.
3. Real Java MCP servers to learn from
most-starred in our index · open source
AMockserver
mock-serverProduction-ready
Mock, record/replay, verify and chaos-test any HTTP, REST, gRPC or LLM dependency over MCP.
Registry5k 8d agoApache-2.0
ASelenide
selenideProduction-ready
Selenide MCP server — browser automation with smart waits for AI agents
Registry1.9k 6d agoMIT
AArcadeDB
ArcadeDataProduction-ready
Multi-Model database with built-in MCP server for SQL, Cypher, Gremlin, and GraphQL.
Registry1.3k 6d agoApache-2.0
ASonarQube MCP Server
SonarSourceProduction-ready
Analyze code quality and security with SonarQube Server or Cloud directly in AI assistants.
Registry695 6d agoOther
Ashaft-mcp
ShaftHQProduction-ready
SHAFT browser automation, capture, and offline deterministic failure diagnosis
Registry422 10d agoMIT
ABuddy phone tools
ghorbelhamdiProduction-ready
Android phone tools for AI agents (read the screen, tap, type, open apps), served by the Buddy app.
Registry359 2d agoApache-2.0
See all Java MCP servers, or the best-maintained across every language.
4. Connect it, then get it found
Point a client at your server to try it — the client matrix shows which clients support what. When it works, list it on Serverdex: a free listing is a server page with a link back to us, in front of developers choosing MCP servers. Want it live now without the link? Priority Review ($9, one-time) does that.
Questions people ask
- What's the official way to build an MCP server in Java?
- Use the official Java SDK, io.modelcontextprotocol.sdk:mcp. Install it (<!-- Maven --> <dependency> <groupId>io.modelcontextprotocol.sdk</groupId> <artifactId>mcp</artifactId> </dependency>), construct a server, register your tools, and connect a transport. The full, always-current walkthrough is the official quickstart; the snippet here shows the shape. Read from the SDK's repository on 1 December 2026.
- Is the Java SDK production-ready?
- Tier 2 — actively maintained and working toward full specification coverage. Tier 2 SDK — actively maintained and working toward full spec coverage.
- How do I test and connect my Java server?
- Run it over stdio and point a client at it. Serverdex's client matrix shows which clients support what; most developers start with Claude Desktop or an IDE client. Once it answers, list it on Serverdex so others find it.