sinditech/sindi-ai-mcp-server
If you are the rightful owner of sindi-ai-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
Sindi-AI-MCP-Server is a Java-based implementation of Anthropic's Model Context Protocol Server, designed to facilitate communication and interaction with language models.
sindi-ai-mcp-server
Java Implementation of Anthropic's Model Context Protocol (MCP) Server.
This implementation is an attempt to provide an integration between the MCP protocol and Jakarta EE application in a seamless way.
🏗️ Architecture
The project is structured into several modules, each serving a specific purpose:
Core Modules
sindi-ai-mcp-server-spi
: Fundamental CDI integration classes, interfaces, annotations and SPI definitionssindi-ai-mcp-server-runtime
: Runtime implementation of the SPI for runtime server registration and service discovery.sindi-ai-mcp-server-runtime-rest
: The Jakarta REST implementation of MCP SSE transport (streamable HTTP coming soon).sindi-ai-mcp-server-runtime-servlet
: The Jakarta Servlet implementation of the MCP SEE and Streamable HTTP protocol.sindi-ai-mcp-server-features
: Example MCP features showcasing the power of MCP, the Jakarta EE way.
🚀 Quick Start
1. Add Dependencies
You need to either select the servlet or REST runtime, within your application (but not both, as there might be an endpoint conflicts).
Add the required dependencies to your pom.xml
.
- For Servlet:
<dependency>
<groupId>za.co.sindi</groupId>
<artifactId>sindi-ai-mcp-server-runtime-servlet</artifactId>
<version>${project.version}</version>
</dependency>
- For REST:
<dependency>
<groupId>za.co.sindi</groupId>
<artifactId>sindi-ai-mcp-server-runtime-rest</artifactId>
<version>${project.version}</version>
</dependency>
2. Define an MCP Feature Service
MCP Features can be registered either on simple POJO or CDI-managed bean.
The following MCP features are supported:
Tools
: supported annotations are@Tool
,@ToolArgument
on methods. LangChain4J tool annotations are also supported. The method result must be of typeString
.Prompts
: supported annotations are@Prompt
,@PromptArgument
on methods. The method result must be of typePromptMessage
orPromptMessage[]
.Resource
: supported annotation,@Resource
(uri
annotation attribute is mandatory) on methods. The method result must be of typeResourceContents[]
(either of typeBlobResourceContents
orTextResourceContents
).Resource template
: supported annotation,@ResourceTemplate
(uri
annotation attribute is mandatory) on methods. The method result must be of typeResourceTemplate[]
.
For more programmatic approach, you can register an MCP feature with its callback handler by injecting its appropriate manager to the MCP server runtime:
ToolManager
: For tool registration.PromptManager
: For prompt registration.ResourceManager
: For resource and resource template registration.
Additionally, you can inject the following MCP resources:
MCPLogger
: MCP Logging to client session (if enabled).MCPContext
: MCP Context, providing manual MCP features and client session.
📖 Examples
The project includes comprehensive examples for MCP servers, found in the examples/
directory. There are 2 examples, each demonstrating MCP on their various Jakarta EE server protocols:
sindi-ai-mcp-server-rest
: Running MCP server (bundled with the MCP features) on REST protocol. Note, for now on MCP SSE transport (deprecated) is implemented.sindi-ai-mcp-server-servlet
: Running MCP server (bundled with the MCP features) on Servlet protocol.
🛠️ How to run examples
- Git clone the entire project.
- Build the project.
mvn clean package -e
-
cd examples/sindi-ai-mcp-server-xxxx/
, wherexxxx
can be eitherrest
orservlet
. -
Run the application as follows:
mvn clean liberty:dev -e
- Open a new terminal and start MCP Inspector.
npx -y @modelcontextprotocol/inspector@latest
The browser should automatically open with MCP Inspector.
- Copy the link and connect to your MCP server.
For SSE, the link should be http://localhost:9080/sse
.
For Streamable HTTP, the link should be http://localhost:9080/mcp
.
Click connect on the MCP inspector and start testing your MCP features.
🤝 Contributing
If you want to contribute, please have a look at .
📄 License
This project is licensed under the Apache License 2.0 - see the file for details.
🌟 Getting Started
Ready to integrate AI into your enterprise Java application?
- Explore the examples: Start with the MCP-specific examples in the
examples/
directory. - Read the documentation: Check out individual module documentation for detailed configuration options
- Contribute: Help improve the project by reporting issues or submitting pull requests