my-mcp-server

12dit152/my-mcp-server

3.2

If you are the rightful owner of my-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.

The Model Context Protocol (MCP) server is a specialized server designed to facilitate communication and data exchange between various machine learning models and applications, ensuring seamless integration and efficient processing.

My MCP Server

A Spring AI MCP Server implementation with WebMVC SSE transport.

Features

  • MCP (Model Context Protocol) server for AI tool integration
  • Ping tool for simple health checks
  • SSE (Server-Sent Events) support for streaming responses
  • Spring Boot 3.4.5
  • Spring AI 1.0.1

Getting Started

Prerequisites

  • Java 17 or newer
  • Maven

Build and Run

mvn clean package
java -jar target/my-mcp-server-0.0.1-SNAPSHOT.jar

Endpoints

  • POST /mcp: Main MCP endpoint for tool requests
  • SSE support: Add Accept: text/event-stream header for streaming responses
Example Ping Request
curl -X POST http://localhost:8080/mcp \
  -H "Content-Type: application/json" \
  -d '{
    "version": "1.0",
    "tool": "ping",
    "input": { "message": "samar" },
    "stream": true
  }'
Example SSE Request
curl -N -X POST http://localhost:8080/mcp \
  -H "Content-Type: application/json" \
  -H "Accept: text/event-stream" \
  -d '{
    "version": "1.0",
    "tool": "ping",
    "input": { "message": "samar" },
    "stream": true
  }'

Project Structure

pom.xml
src/
  main/
    java/
      com/
        samar/
          Application.java
          PingToolService.java
          ToolConfig.java
  test/
    java/
      com/
        samar/
          PingToolServiceTest.java

Custom Tools

Add your own tools by creating service classes and annotating methods with @Tool.

License

MIT