mcp-java-sdk-examples
by thought2code·★ 32·Score 38
A collection of MCP server examples demonstrating different Java SDK implementations.
Overview
This repository provides practical examples of MCP servers implemented using various Java SDKs. It includes implementations using the Declarative MCP Java SDK, the Official MCP Java SDK, and Spring AI MCP SDK. The examples demonstrate how to expose resources, tools, and prompts through the Model Context Protocol in Java applications. The collection primarily focuses on filesystem operations as a representative example.
Try asking AI
After installing, here are 5 things you can ask your AI assistant:
When to choose this
Choose this if you're working with Java applications and need practical examples of implementing MCP servers with different SDK approaches.
When NOT to choose this
Not ideal if you need documentation beyond examples or if you're working with non-Java environments.
Comparable tools
Installation
Installation
This is a collection of examples, not a server itself. Each example has its own setup requirements. For the filesystem example:
- Clone the repository
- Navigate to the example directory:
cd mcp-server-filesystem - Build the project:
mvn package - Run the server:
java -jar target/mcp-server-filesystem-*.jar
Claude Desktop Configuration
Add to your claude_desktop_config.json:
{
"mcpServers": {
"mcp-java-sdk-examples": {
"command": "java",
"args": ["-jar", "/path/to/mcp-server-filesystem/target/mcp-server-filesystem-*.jar"]
}
}
}FAQ
- Which Java versions are supported?
- Java 17 or later, as required by the MCP Java SDK.
- How do I add my own MCP server example?
- The repository encourages contributions of additional examples using different Java SDKs.
Compare mcp-java-sdk-examples with
Last updated · Auto-generated from public README + GitHub signals.