Poc
MCP PoC repository
Ask AI about Poc
Powered by Claude · Grounded in docs
I know everything about Poc. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Reviews
Documentation
Model Context Protocol POC
This project aims to play with MCP and Spring AI.
This is a Maven Multi Module project
MCP Server
STDIO based communication implementation. Based on Official walkthrough
The server exposes two tools:
get_city_geolocation: get latitude and longitude from a city nameget_weather_forecast: retrieve weather forecast for the given latitude and longitude. Default is 7 days
How to inspect the server
- build the project:
mvn clean package - Run the inspector (requires Node.js)
npx @modelcontextprotocol/inspector - Go to
http://localhost:6274and set:- Transport Type:
STDIO - Command:
java - Arguments:
-jar /absolute/path/to/mcp-server-1.0.0-SNAPSHOT.jar - Connect
- Transport Type:
Now you can explore the MPC server
How to connect the MCP Server to Claude Desktop
-
Locate the file
claude_desktop_config.json:- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json - Linux not yet supported by Claude Desktop
- macOS:
-
Add a new entry in the
mcpServersobject:{ "mcpServers": { "spring-ai-mcp-weather": { "command": "java", "args": [ "-jar", "/absolute/path/to/mcp-server-1.0.0-SNAPSHOT.jar" ] } } } -
Try to ask Claude "what's the forecast for tomorrow in [your city name]?". Claude will be capable of understand that need to retrieve geo info to give you the answer (using both tools)
Please note that the prompt is bound to Italy cities
MCP Client
The client is basically a command line chat based on OpenAI: thanks to Spring AI and MCP integration, the client connects to the MCP servers defined in claude_desktop_config.json
and create the clients automatically for each configured server.
Please note that the
claude_desktop_config.jsoncontains absolute paths because is using STDIO communication: this type of communication requires the client to start the server, so the project must me built first!mvn package
The client requires the OpenAI key, provided as env variable
OPENAI_API_KEY.
The client starts and list the available tools, then is ready to chat.
