Weather Java SSE Transport MCP Service
by stantonk
This repository provides a working implementation of a Model Context Protocol (MCP) java-sdk with a fast-agent for interacting with the Weather mcp-server. It demonstrates how to build an end-to-end system leveraging multiple MCP Servers, both local and remote, using HTTP SSE transport.
Last updated: N/A
What is Weather Java SSE Transport MCP Service?
This is a Java-based MCP server that provides weather data and demonstrates the use of the Model Context Protocol. It includes a fast-agent that uses Claude Sonnet 3.7 for LLM processing and can call out to other MCP servers, such as a web search tool, to gather information before calling the weather server.
How to use Weather Java SSE Transport MCP Service?
- Build and start the Weather MCP Server using
mvn clean package
andjava -jar mcp-server/target/mcp-server-1.0-SNAPSHOT.jar
. 2. Install, configure, and start the fast-agent usingpip install uv
anduv pip install fast-agent-mcp
. 3. Configure Claude and OpenAI API keys infastagent.secrets.yaml
. 4. Configure the MCP server URL infastagent.config.yaml
. You can also test the server directly using curl to connect to the SSE stream and send messages to the /mcp/messages endpoint.
Key features of Weather Java SSE Transport MCP Service
Implements a Weather MCP Server
Includes a fast-agent for interacting with the server
Uses HTTP SSE transport for remote communication
Demonstrates the use of multiple MCP Servers
Leverages Claude Sonnet 3.7 for LLM processing
Use cases of Weather Java SSE Transport MCP Service
Demonstrating MCP server implementation
Building intelligent agents that can access multiple data sources
Creating weather applications
Implementing LLM-powered tools
Testing and experimenting with the Model Context Protocol
FAQ from Weather Java SSE Transport MCP Service
What is Model Context Protocol (MCP)?
What is Model Context Protocol (MCP)?
MCP is a protocol for enabling communication and data exchange between different models and services.
What is the purpose of the fast-agent?
What is the purpose of the fast-agent?
The fast-agent acts as a client that interacts with the Weather MCP Server and other MCP servers, using LLMs to determine which tools to call based on user prompts.
What is SSE transport?
What is SSE transport?
SSE (Server-Sent Events) is a protocol that allows a server to push data to a client over a single HTTP connection.
How do I configure the fast-agent to use my API keys?
How do I configure the fast-agent to use my API keys?
You need to copy fastagent.secrets.yaml.TEMPLATE
to fastagent.secrets.yaml
and then add your Claude and OpenAI API keys to that file.
How do I test the Weather MCP Server directly?
How do I test the Weather MCP Server directly?
You can use curl to connect to the SSE stream at http://localhost:8080/sse
and send messages to the /mcp/message
endpoint.