This Proof of Concept demonstrates an MCP (Model Context Protocol) server implemented with Spring Boot and Spring AI Tools, integrated for use with Claude Desktop and Cursor. The server exposes simple tools around a small in-memory dataset of prime ministers to showcase tool invocation from MCP-compatible clients.
- Language: Java 17+
- Framework: Spring Boot + Spring AI Tools
- Build: Gradle
Available to MCP clients once the server is running:
- get_all_services: List all microservices in the catalog.
- get_service: Get a microservice by name.
- search_services: Search by keyword in name, description, or tags.
- list_dependencies: List direct dependencies for a given name.
- services_by_status: Filter services by status(e.g., HEALTHY, DEGRADED).
Data model returned by the tools:
- Microservice { name, owner, description, tags[], dependencies[], repoUrl, environment, status, lastDeployedAt }
- JDK 17+
- macOS/Linux shell
- Optional: IntelliJ IDEA or Cursor for development
- Build JAR
./gradlew clean build- Run as Spring Boot app
./gradlew bootRunor run the built JAR directly:
java -jar ./build/libs/mcp-0.0.1-SNAPSHOT.jarAdd or update your Claude Desktop MCP config (on macOS):
~/Library/Application Support/Claude/claude_desktop_config.json
Use a configuration like:
{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-filesystem", "/Users/mani/Documents/Workspace/AI_MCP/"]
    },
    "mani-mcp": {
      "command": "java",
      "args": [
        "-jar",
        "/Users/mani/Documents/Workspace/AI_MCP/mcp/build/libs/mcp-0.0.1-SNAPSHOT.jar"
      ]
    }
  }
}Then restart Claude Desktop. Claude should discover the mani-mcp server and list the tools (get_service, search_services, etc.).
Cursor supports MCP servers via a JSON config. On macOS, create or edit:
~/Library/Application Support/Cursor/mcp.json
Example:
{
  "mcpServers": {
    "mani-mcp": {
      "command": "java",
      "args": [
        "-jar",
        "/Users/mani/Documents/Workspace/AI_MCP/mcp/build/libs/mcp-0.0.1-SNAPSHOT.jar"
      ]
    }
  }
}Restart Cursor after saving the file.
- Ask Claude or Cursor to use the MCP tools, e.g., “Use get_all_services” or “Callget_servicewithname=foo-service”.
- You can also try: “Search services with search_servicesandkeyword=payment”, “List dependencies forname=foo-service”, or “Show services bystatus=HEALTHY”.
- Tool results will reflect the in-memory microservice catalog initialized at startup.
- src/main/java/com/mani/poc/mcp/McpApplication.java: Spring Boot entry + tool registration
- src/main/java/com/mani/poc/mcp/service/ServiceCatalogService.java: Tool implementations
- src/main/java/com/mani/poc/mcp/pojo/Microservice.java: Data model
Run unit tests and view reports:
./gradlew test
open ./build/reports/tests/test/index.html- This POC focuses on tool exposure through MCP; it intentionally does not expose REST endpoints.
- Update absolute paths in MCP configs as needed for your environment.