HTTP Transport Guide
The MCP server supports two HTTP transport protocols for client communication: Streamable HTTP (recommended) and Legacy SSE.
Transports Overview
| Transport | Status | Use Case |
|---|---|---|
| Streamable HTTP | Recommended | Claude Desktop, modern clients |
| Legacy SSE | Deprecated | Older clients, backward compatibility |
Streamable HTTP (Recommended)
Streamable HTTP is the recommended transport per the MCP specification (2025-03-26+). It provides a unified endpoint that handles both request/response and server-sent notifications.
Endpoints
| Endpoint | Method | Description |
|---|---|---|
/mcp |
GET | Establish SSE stream for notifications |
/mcp |
POST | Send JSON-RPC messages |
/mcp |
DELETE | Close session |
Session Lifecycle
- Initialize Session: POST to
/mcpwithout session ID - Server Response: Returns
Mcp-Session-Idheader - Subsequent Requests: Include
Mcp-Session-Idheader - Close Session: DELETE to
/mcpwith session ID
Session Headers
| Header | Direction | Description |
|---|---|---|
Mcp-Session-Id |
Response | Session identifier (returned on initialization) |
Mcp-Session-Id |
Request | Session identifier (required for subsequent requests) |
Example: Initialize Session
curl -X POST https://mcp.us-east-1.hiyve.tech/mcp \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "initialize",
"params": {
"protocolVersion": "2024-11-05",
"clientInfo": { "name": "my-client", "version": "1.0.0" }
},
"id": 1
}'
Response Headers:
Mcp-Session-Id: a1b2c3d4-e5f6-7890-abcd-ef1234567890
Example: List Tools
curl -X POST https://mcp.us-east-1.hiyve.tech/mcp \
-H "Authorization: Bearer <token>" \
-H "Mcp-Session-Id: a1b2c3d4-e5f6-7890-abcd-ef1234567890" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "tools/list",
"id": 2
}'
Example: Call Tool
curl -X POST https://mcp.us-east-1.hiyve.tech/mcp \
-H "Authorization: Bearer <token>" \
-H "Mcp-Session-Id: a1b2c3d4-e5f6-7890-abcd-ef1234567890" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"name": "natural_query",
"arguments": { "query": "show my rooms" }
},
"id": 3
}'
Example: Close Session
curl -X DELETE https://mcp.us-east-1.hiyve.tech/mcp \
-H "Mcp-Session-Id: a1b2c3d4-e5f6-7890-abcd-ef1234567890"
Claude Desktop Configuration
{
"mcpServers": {
"hiyve": {
"url": "https://mcp.us-east-1.hiyve.tech/mcp",
"transport": "streamable-http"
}
}
}
Legacy SSE Transport (Deprecated)
The legacy SSE transport uses separate endpoints for the event stream and message submission. It is maintained for backward compatibility but new implementations should use Streamable HTTP.
Endpoints
| Endpoint | Method | Description |
|---|---|---|
/mcp/sse |
GET | Establish SSE event stream |
/mcp/messages |
POST | Send JSON-RPC messages |
Session Flow
- Connect: GET
/mcp/sseto establish SSE stream - Receive Session ID: Server sends session ID via SSE event
- Send Messages: POST to
/mcp/messages?sessionId=<id>
Example: Connect SSE
curl -N https://mcp.us-east-1.hiyve.tech/mcp/sse \
-H "Authorization: Bearer <token>"
SSE Response:
event: open
data: {"sessionId": "abc123..."}
event: message
data: {"jsonrpc": "2.0", "result": {...}}
Example: Send Message
curl -X POST "https://mcp.us-east-1.hiyve.tech/mcp/messages?sessionId=abc123..." \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "tools/list",
"id": 1
}'
Status Endpoint
Check server status and active sessions:
curl https://mcp.us-east-1.hiyve.tech/mcp/status
Response:
{
"success": true,
"transports": {
"streamableHttp": {
"activeSessions": 3,
"sessions": ["uuid1", "uuid2", "uuid3"]
},
"legacySse": {
"activeSessions": 0,
"sessions": []
}
},
"activeSessions": 3,
"toolCount": 27,
"mcpTokenAuthEnabled": true,
"oauthEnabled": true,
"authMethods": ["oauth", "mcp_token", "email"],
"supportedTransports": ["streamable-http", "sse"]
}
JSON-RPC Protocol
All MCP communication uses JSON-RPC 2.0.
Request Format
{
"jsonrpc": "2.0",
"method": "tools/call",
"params": { ... },
"id": 1
}
Response Format (Success)
{
"jsonrpc": "2.0",
"result": { ... },
"id": 1
}
Response Format (Error)
{
"jsonrpc": "2.0",
"error": {
"code": -32000,
"message": "Error description"
},
"id": 1
}
Error Codes
| Code | Meaning |
|---|---|
-32700 |
Parse error |
-32600 |
Invalid request |
-32601 |
Method not found |
-32602 |
Invalid params |
-32603 |
Internal error |
-32000 |
Server error (session not found, etc.) |
Session Management
In-Memory Storage
Sessions are stored in memory on the server. This means:
- Sessions do not persist across server restarts
- Each server instance maintains its own sessions
- Sessions expire when the underlying connection closes
Session Timeout
Sessions remain active as long as:
- The client maintains the connection (SSE) or
- The client sends requests within the timeout window
For Streamable HTTP, sessions are cleaned up when:
- The client explicitly closes with DELETE
- The transport connection is terminated
Health & Discovery Endpoints
| Endpoint | Method | Description |
|---|---|---|
/health |
GET | Server health check |
/mcp/status |
GET | Transport status |
/.well-known/oauth-protected-resource |
GET | OAuth resource metadata |
/.well-known/oauth-authorization-server |
GET | OAuth server metadata |
Health Check
curl https://mcp.us-east-1.hiyve.tech/health
{
"status": "healthy",
"timestamp": "2025-01-14T12:00:00.000Z",
"services": {
"database": "connected",
"mcp": "ready"
}
}
CORS Configuration
The server accepts requests from:
*.muziemedia.comhttp://localhost:*- Configured
allowedOrigins
Allowed methods: GET, POST, OPTIONS, DELETE
Allowed headers: Content-Type, Authorization, X-API-Key, x-user-email, x-timezone
Troubleshooting
"Session not found" (404)
The session ID is invalid or the session has expired. Establish a new session by sending a request without the Mcp-Session-Id header.
"Authentication required" (401)
No valid authentication credentials provided. Include either:
Authorization: Bearer <token>headerx-user-email+X-API-Keyheaders
Connection Dropped
For SSE connections, the client should implement reconnection logic. For Streamable HTTP, simply start a new session.
Request Timeout
Large queries may take time to process. The server has a default timeout, but complex AI operations may require more time. Consider breaking complex queries into smaller parts.