@@ -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
10097MCP_TRANSPORT=stdio ./mcp-server
10198```
10299
103- ### Streamable HTTP (recommended for network deployments)
100+ ### Streamable HTTP (for network deployments)
104101
105102The streamable HTTP transport (MCP spec 2025-03-26) uses a single ` /mcp ` endpoint for all
106103communication. 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
161141MCP_BASE_URL=https://mcp.example.com
162142MCP_OAUTH_ENABLED=true
163143MCP_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
181161For 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
196176Add 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
229197Tools 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 )
0 commit comments