Skip to content

Commit 6462b0f

Browse files
authored
refactor: drop legacy SSE transport, streamable HTTP only (#1428)
1 parent 8bdaf3d commit 6462b0f

17 files changed

Lines changed: 80 additions & 633 deletions

File tree

Tiltfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ k8s_resource(
617617
# MCP Server
618618
# =============================================================================
619619
# Model Context Protocol server for AI agent integration.
620-
# Exposes Meridian's transaction engine capabilities via MCP SSE transport.
620+
# Exposes Meridian's transaction engine capabilities via streamable HTTP transport.
621621
# Connects to the gateway for all backend gRPC service calls.
622622

623623
# Standard build args for mcp-server
@@ -644,7 +644,7 @@ k8s_yaml('services/mcp-server/k8s/service.yaml')
644644
# Configure mcp-server resource
645645
k8s_resource(
646646
'mcp-server',
647-
port_forwards=['18090:8090'], # MCP SSE endpoint (18090 to avoid conflict with gateway)
647+
port_forwards=['18090:8090'], # MCP HTTP endpoint (18090 to avoid conflict with gateway)
648648
resource_deps=[
649649
'generate-proto', # Ensures proto files are generated before building
650650
'gateway', # MCP server routes all gRPC calls through the gateway
@@ -991,7 +991,7 @@ Gateway:
991991
• HTTP Gateway → localhost:8090 (subdomain routing)
992992
- Tenant resolution via TenantResolverMiddleware
993993
- Proxies to gRPC backends via Connect protocol
994-
• MCP Server → localhost:18090 (SSE transport)
994+
• MCP Server → localhost:18090 (streamable HTTP)
995995
- Model Context Protocol for AI agent integration
996996
- Routes all gRPC calls through the HTTP gateway
997997

deploy/demo/.env.demo.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ DEPOSIT_CLEARING_ACCOUNT_ID=CLEARING-GBP-001
163163
# MCP Server (AI Integration)
164164
# ---------------------------------------------------------------------------
165165

166-
# [REQUIRED] Public base URL for MCP OAuth callbacks and SSE endpoint discovery.
166+
# [REQUIRED] Public base URL for MCP OAuth callbacks.
167167
MCP_BASE_URL=https://demo.meridianhub.cloud
168168

169169
# [REQUIRED] API key for MCP server to authenticate with Meridian gRPC API.

deploy/demo/Caddyfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ demo.meridianhub.cloud, *.demo.meridianhub.cloud {
2222
respond "Not Found" 404
2323
}
2424

25-
# MCP Server: streamable HTTP + legacy SSE transport
25+
# MCP Server: streamable HTTP transport
2626
@mcp_transport {
27-
path /mcp /mcp/* /sse /sse/* /message /message/*
27+
path /mcp /mcp/*
2828
}
2929
handle @mcp_transport {
3030
reverse_proxy mcp-server:8090

deploy/demo/docker-compose.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@ services:
121121
condition: service_started
122122
environment:
123123
# --- MCP Transport ---
124-
MCP_TRANSPORT: sse
125-
MCP_SSE_PORT: "8090"
124+
MCP_TRANSPORT: http
125+
MCP_PORT: "8090"
126126
MCP_SERVER_NAME: ${MCP_SERVER_NAME:-meridian-mcp}
127127
MCP_BASE_URL: ${MCP_BASE_URL:?MCP_BASE_URL must be set in the env file (e.g. https://your-domain)}
128128

@@ -138,7 +138,7 @@ services:
138138
MCP_OAUTH_CLIENT_ID: ${MCP_OAUTH_CLIENT_ID:-} # required when MCP_OAUTH_ENABLED=true
139139
MCP_OAUTH_REDIRECT_URI: ${MCP_OAUTH_REDIRECT_URI:-} # required when MCP_OAUTH_ENABLED=true
140140
# Not exposed to host — accessed only by caddy on the internal network
141-
# Caddy proxies /sse and /message to this container
141+
# Caddy proxies /mcp to this container
142142

143143
caddy:
144144
image: caddy:2-alpine

deploy/dev/docker-compose.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
# 50051 - meridian gRPC
1919
# 8090 - meridian HTTP gateway
2020
# 5173 - frontend (Vite dev server)
21-
# 8091 - mcp-server SSE endpoint
21+
# 8091 - mcp-server HTTP endpoint
2222
# 50064 - financial-gateway gRPC
2323

2424
services:
@@ -114,8 +114,8 @@ services:
114114
- "127.0.0.1:8091:8090"
115115
environment:
116116
LOG_LEVEL: info
117-
MCP_TRANSPORT: sse
118-
MCP_SSE_PORT: "8090"
117+
MCP_TRANSPORT: http
118+
MCP_PORT: "8090"
119119
MCP_SERVER_NAME: meridian-mcp
120120
MCP_BASE_URL: http://localhost:8091
121121
MERIDIAN_API_URL: meridian:50051

services/mcp-server/README.md

Lines changed: 22 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ instructions: |
1212
using the Model Context Protocol (MCP 2025-03-26).
1313
1414
Key patterns:
15-
- Transport agnostic: stdio for CLI tools, streamable HTTP for network clients (recommended), SSE for legacy clients
15+
- Transport modes: stdio for CLI tools, streamable HTTP for network clients
1616
- Tool categories: Read (no side effects), Simulate (dry-run), Write (state mutation)
1717
- Plan-before-apply safety: meridian_manifest_plan must precede meridian_manifest_apply
18-
- OAuth 2.1 with PKCE: optional, enabled via MCP_OAUTH_ENABLED=true for network transports
18+
- OAuth 2.1 with PKCE: optional, enabled via MCP_OAUTH_ENABLED=true for HTTP transport
1919
- All logs go to stderr; stdout is reserved for the JSON-RPC protocol (stdio mode)
2020
---
2121

@@ -31,8 +31,8 @@ Thin JSON-RPC adapter that exposes Meridian's backend services to LLM clients vi
3131
| **Type** | Infrastructure (API Gateway) |
3232
| **Language** | Go |
3333
| **Protocol** | MCP 2025-03-26 |
34-
| **Transports** | stdio, streamable HTTP, SSE (legacy) |
35-
| **Auth** | OAuth 2.1 with PKCE (optional, network transports) |
34+
| **Transports** | stdio, streamable HTTP |
35+
| **Auth** | OAuth 2.1 with PKCE (optional, HTTP transport) |
3636
| **Standalone** | No (requires Meridian backend services via `MERIDIAN_API_URL`) |
3737

3838
## Architecture
@@ -51,7 +51,6 @@ flowchart TB
5151
subgraph "MCP Server"
5252
ST[stdio Transport]
5353
SH[Streamable HTTP Transport]
54-
SE[SSE Transport - Legacy]
5554
TH[Tool Handlers]
5655
RH[Resource Handlers]
5756
PH[Prompt Handlers]
@@ -72,11 +71,9 @@ flowchart TB
7271
CLI -->|JSON-RPC| ST
7372
CB -->|JSON-RPC + Bearer| SH
7473
SH <--> OA
75-
SE <--> OA
7674
7775
ST --> TH
7876
SH --> TH
79-
SE --> TH
8077
TH --> RH
8178
TH --> PH
8279
@@ -100,7 +97,7 @@ responses to stdout. Logs are written to stderr to avoid corrupting the protocol
10097
MCP_TRANSPORT=stdio ./mcp-server
10198
```
10299

103-
### Streamable HTTP (recommended for network deployments)
100+
### Streamable HTTP (for network deployments)
104101

105102
The streamable HTTP transport (MCP spec 2025-03-26) uses a single `/mcp` endpoint for all
106103
communication. Clients POST JSON-RPC requests and receive synchronous JSON responses. Session
@@ -111,36 +108,19 @@ management is handled via the `Mcp-Session-Id` header.
111108
| `/mcp` | `POST` | Send JSON-RPC requests (initialize, tools/list, tools/call, etc.) |
112109
| `/mcp` | `DELETE` | Terminate a session |
113110

114-
The streamable HTTP transport is automatically available alongside SSE when running in `sse`
115-
mode -- no separate transport flag is needed.
116-
117111
```bash
118-
MCP_TRANSPORT=sse MCP_SSE_PORT=8090 ./mcp-server
119-
# Both /mcp (streamable HTTP) and /sse + /message (legacy) are served
120-
```
121-
122-
### SSE (legacy)
123-
124-
The original SSE transport is still available for clients that do not yet support streamable HTTP.
125-
126-
| Endpoint | Purpose |
127-
|----------|---------|
128-
| `GET /sse` | Establishes the SSE stream for server-to-client messages |
129-
| `POST /message` | Receives client JSON-RPC requests |
130-
131-
```bash
132-
MCP_TRANSPORT=sse MCP_SSE_PORT=8090 ./mcp-server
112+
MCP_TRANSPORT=http MCP_PORT=8090 ./mcp-server
133113
```
134114

135115
## Environment Variables
136116

137117
| Variable | Default | Purpose |
138118
|----------|---------|---------|
139-
| `MCP_TRANSPORT` | `stdio` | Transport mode: `stdio` or `sse` |
140-
| `MCP_SSE_PORT` | `8090` | HTTP port when using SSE transport |
119+
| `MCP_TRANSPORT` | `stdio` | Transport mode: `stdio` or `http` |
120+
| `MCP_PORT` | `8090` | HTTP port when using streamable HTTP transport |
141121
| `MCP_SERVER_NAME` | `meridian-mcp` | Server name reported in MCP initialize response |
142-
| `MCP_BASE_URL` | `http://localhost:8090` | Base URL for OAuth redirect URIs (SSE mode) |
143-
| `MCP_OAUTH_ENABLED` | `false` | Enable OAuth 2.1 PKCE flow for SSE transport |
122+
| `MCP_BASE_URL` | `http://localhost:8090` | Base URL for OAuth redirect URIs (HTTP mode) |
123+
| `MCP_OAUTH_ENABLED` | `false` | Enable OAuth 2.1 PKCE flow for HTTP transport |
144124
| `MCP_OAUTH_CLIENT_ID` | `meridian-mcp` | OAuth client ID advertised to clients |
145125
| `MCP_OAUTH_REDIRECT_URI` | `{MCP_BASE_URL}/oauth/callback` | OAuth redirect URI |
146126
| `MERIDIAN_API_URL` | - | gRPC address of the Meridian gateway (e.g., `localhost:9090`) |
@@ -149,15 +129,15 @@ MCP_TRANSPORT=sse MCP_SSE_PORT=8090 ./mcp-server
149129

150130
## OAuth 2.1 Configuration
151131

152-
OAuth 2.1 with PKCE is optional and applies to both the streamable HTTP and SSE transports. When
153-
enabled, the server exposes authorization and token endpoints and requires clients to present a
154-
bearer token on the `/mcp`, `/sse`, and `/message` endpoints.
132+
OAuth 2.1 with PKCE is optional and applies to the streamable HTTP transport. When enabled, the
133+
server exposes authorization and token endpoints and requires clients to present a bearer token
134+
on the `/mcp` endpoint.
155135

156-
Example configuration for a production SSE deployment:
136+
Example configuration for a production deployment:
157137

158138
```bash
159-
MCP_TRANSPORT=sse
160-
MCP_SSE_PORT=8090
139+
MCP_TRANSPORT=http
140+
MCP_PORT=8090
161141
MCP_BASE_URL=https://mcp.example.com
162142
MCP_OAUTH_ENABLED=true
163143
MCP_OAUTH_CLIENT_ID=my-mcp-client
@@ -176,7 +156,7 @@ For production, configure a real JWT signer and validator.
176156

177157
## Client Configuration
178158

179-
### Streamable HTTP (recommended for network deployments)
159+
### Streamable HTTP (for network deployments)
180160

181161
For Claude Desktop, Claude Code, or any MCP client connecting to a remote Meridian instance:
182162

@@ -191,7 +171,7 @@ For Claude Desktop, Claude Code, or any MCP client connecting to a remote Meridi
191171
}
192172
```
193173

194-
### stdio mode (recommended for local development)
174+
### stdio mode (for local development)
195175

196176
Add the following to your Claude Desktop configuration file
197177
(`~/Library/Application Support/Claude/claude_desktop_config.json` on macOS):
@@ -212,18 +192,6 @@ Add the following to your Claude Desktop configuration file
212192
}
213193
```
214194

215-
### Legacy SSE (for clients without streamable HTTP support)
216-
217-
```json
218-
{
219-
"mcpServers": {
220-
"meridian": {
221-
"url": "http://localhost:8090/sse"
222-
}
223-
}
224-
}
225-
```
226-
227195
## Available Tools
228196

229197
Tools are grouped into three categories:
@@ -334,20 +302,18 @@ MERIDIAN_API_URL=localhost:9090 \
334302
/tmp/meridian-mcp
335303
```
336304

337-
### Running standalone (network mode)
305+
### Running standalone (HTTP mode)
338306

339307
```bash
340-
MCP_TRANSPORT=sse \
341-
MCP_SSE_PORT=8090 \
308+
MCP_TRANSPORT=http \
309+
MCP_PORT=8090 \
342310
MERIDIAN_API_URL=localhost:9090 \
343311
MERIDIAN_API_KEY=pk_your_tenant_api_key \
344312
LOG_LEVEL=debug \
345313
/tmp/meridian-mcp
346314
```
347315

348-
This starts both the streamable HTTP (`/mcp`) and legacy SSE (`/sse`, `/message`) endpoints.
349-
350-
Test with curl using the streamable HTTP transport:
316+
Test with curl:
351317

352318
```bash
353319
# Initialize a session
@@ -362,18 +328,6 @@ curl -X POST http://localhost:8090/mcp \
362328
-d '{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}'
363329
```
364330

365-
Or test with the legacy SSE transport:
366-
367-
```bash
368-
# Open SSE stream
369-
curl -N http://localhost:8090/sse
370-
371-
# Send a tools/list request (in a separate terminal)
372-
curl -X POST http://localhost:8090/message \
373-
-H 'Content-Type: application/json' \
374-
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}'
375-
```
376-
377331
## References
378332

379333
- [Services Architecture](../README.md)

services/mcp-server/cmd/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ COPY --from=builder /build/mcp-server /mcp-server
4747
# Use non-root user (distroless provides nonroot user at uid 65532)
4848
USER nonroot:nonroot
4949

50-
# Expose SSE port (only used when MCP_TRANSPORT=sse)
50+
# Expose HTTP port (used when MCP_TRANSPORT=http)
5151
EXPOSE 8090
5252

5353
# Run the binary

0 commit comments

Comments
 (0)