DEV Community

Cover image for MCP Java SDK – Build Model Context Protocol servers in Java
6000fish
6000fish

Posted on

MCP Java SDK – Build Model Context Protocol servers in Java

Hi HN,

I built an open-source Java SDK for building Model Context Protocol servers:

https://github.com/6000fish/mcp-java

It is intended for Java developers who want to expose tools, resources, or prompts to MCP-compatible agents without implementing the protocol plumbing from scratch.

The project includes:

  • Core MCP server SDK
  • stdio transport
  • SSE transport
  • Java API and annotation-based tool registration
  • Spring Boot starter
  • 5-minute quick-start example
  • Copyable custom server template
  • Ready-to-use MySQL and Redis MCP servers

The SDK is available on Maven Central:

<dependency>
    <groupId>io.github.6000fish</groupId>
    <artifactId>mcp-sdk</artifactId>
    <version>0.1.1</version>
</dependency>

<dependency>
    <groupId>io.github.6000fish</groupId>
    <artifactId>mcp-spring-boot-starter</artifactId>
    <version>0.1.1</version>
</dependency>
Enter fullscreen mode Exit fullscreen mode

The MySQL and Redis servers are local stdio MCP servers, because database/cache connectors are usually safer to run inside the user's own environment instead of exposing credentials to a hosted remote endpoint.

GitHub:

https://github.com/6000fish/mcp-java

Release:

https://github.com/6000fish/mcp-java/releases/tag/v0.1.1

Feedback is welcome.

Top comments (1)

Collapse
 
morganlabs profile image
Morgan

This is a good fit for the Java/Spring side of MCP. The local MySQL/Redis stdio servers make sense too; database credentials are usually better kept in the user's own environment than pushed through a hosted connector.

The part I'd be most curious about is the annotation-to-schema path. Do the annotations generate the full input schema that the model sees, or can handlers still read fields that were never declared in the tool contract?

Also curious how you keep logs away from stdout on the stdio transport. That one tends to be boring until it breaks the whole client session.