# Mcp Server Java Sse Http Demo

> Java Model Context Protocol SSE HTTP Server with Jetty

- **Type:** MCP server
- **Install:** `agentstack add mcp-stantonk-mcp-server-java-sse-http-demo`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [stantonk](https://agentstack.voostack.com/s/stantonk)
- **Installs:** 0
- **Category:** [Integrations](https://agentstack.voostack.com/c/integrations)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [stantonk](https://github.com/stantonk)
- **Source:** https://github.com/stantonk/mcp-server-java-sse-http-demo

## Install

```sh
agentstack add mcp-stantonk-mcp-server-java-sse-http-demo
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Weather Java SSE Transport MCP Service

A working implementation Model Context Protocol java-sdk. Includes
a fast-agent for the MCP Client to interact with the Weather mcp-server.

⚠️This isn't remotely production grade, just demonstrating how to build
something working end to end that can leverage multiple MCP Servers both
local (Stdio Transport) and remote (HTTP SSE Transport). Also avoids
pulling in as much of Spring as possible, for those who don't want it.

In the demo, you'll see the agent:

1. The agent uses Claude Sonnet 3.7 throughout for the LLM bits
2. The agent calls out to the "fetch" websearch MCP Server tool to look up lat/long for each city I asked for.
3. The agent then uses those lat/long values to call the weather MCP Server tool (implemented in this repository).
You can see the calls being made in the upper half of the terminal split window.
4. The agent summarizes the forecasts and determine which of the 4 cities is the warmest tomorrow.

**The agent is figuring out which tools to call from the context of the user's inputted prompts.**

* [Model Context Protocol](https://github.com/modelcontextprotocol)
* [java-sdk](https://github.com/modelcontextprotocol/java-sdk)
* [List of Model Context Protocol Servers](https://github.com/modelcontextprotocol/servers?tab=readme-ov-file#model-context-protocol-servers)
## build and start Weather MCP Server

```
mvn clean package
java -jar java -jar mcp-server/target/mcp-server-1.0-SNAPSHOT.jar
```

## install, configure, and start fast-agent

### install
```
pip install uv
uv pip install fast-agent-mcp
uv run agent.py
```

### Configure Claude and OpenAI api keys

`cp fastagent.secrets.yaml.TEMPLATE fastagent.secrets.yaml`

then add your api keys to that config file.

### Note: Weather MCP Server config

Note, in `fastagent.config.yaml` we've configured the MCP Servers available to the agent,
in this case our server uses the SSE HTTP Transport, this enables
calling remote MCP Servers :).

```
mcp:
    servers:
        weather:
            transport: "sse"
            read_timeout_seconds: 10
            url: "http://localhost:8080/sse"
```

## Lower level for testing

Connect to SSE stream
```
curl -v -H "Accept: text/event-stream" "http://localhost:8080/sse"
```

Send messages to /mcp/messages (note, include sessionId from SSE)
```
curl -X POST "http://localhost:8080/mcp/message?sessionId=b64ad193-6bb3-4e2e-b33c-27a23011acb4" -d '{"hi": "mynameis"}' | jq .
```

Things to check out:

* https://github.com/youngsu5582/mcp-server-mysql

## Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [stantonk](https://github.com/stantonk)
- **Source:** [stantonk/mcp-server-java-sse-http-demo](https://github.com/stantonk/mcp-server-java-sse-http-demo)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** yes
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/mcp-stantonk-mcp-server-java-sse-http-demo
- Seller: https://agentstack.voostack.com/s/stantonk
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
