Claude.ai (Web)
Claude.ai (web) and Claude mobile apps (iOS/Android) connect to AutoMem through a remote MCP sidecar — a separately deployed HTTPS service that bridges the MCP protocol to AutoMem’s HTTP API. This is required because cloud-based Claude cannot spawn local processes.
Unlike ChatGPT, Claude.ai supports both header-based and URL-based authentication.
Architecture
Section titled “Architecture”graph TB
subgraph "Remote MCP (HTTP/SSE Transport)"
CW["Claude.ai Web / Claude Mobile"]
SIDECAR["MCP Sidecar (separate deployment) — POST /mcp / GET /mcp/sse"]
AUTOMEM["AutoMem API :8001"]
CW -->|"HTTPS"| SIDECAR
SIDECAR -->|"HTTP"| AUTOMEM
end
The sidecar service (mcp-sse-server) is included in the AutoMem server repository. It implements:
- Streamable HTTP (recommended):
POST /mcp— full-duplex MCP-over-HTTP, MCP protocol version 2025-03-26 - SSE (legacy):
GET /mcp/sse— server→client event stream, MCP protocol version 2024-11-05
SSE sessions are maintained server-side with a 1-hour TTL and 5-minute sweep interval. The Streamable HTTP transport is stateless — each request builds its own transport, and any mcp-session-id header is ignored.
Prerequisites
Section titled “Prerequisites”- A deployed AutoMem service
- The MCP sidecar deployed and accessible over HTTPS
- A Claude.ai account (Pro recommended for MCP features)
Deploy the MCP Sidecar
Section titled “Deploy the MCP Sidecar”Required environment variables:
| Variable | Purpose |
|---|---|
AUTOMEM_API_URL | AutoMem service URL |
AUTOMEM_API_TOKEN | API token for authentication |
PORT | Listen port (default: 8080) |
AUTOMEM_ENDPOINT is supported as a legacy alias for AUTOMEM_API_URL.
Railway deployment (recommended):
- Deploy via Railway one-click template
- Go to
mcp-sse-serverservice → Settings → Networking → Generate Domain - Your sidecar URL will be:
https://your-mcp-bridge.up.railway.app
Sidecar endpoints:
| Endpoint | Method | Transport | Purpose |
|---|---|---|---|
/mcp | POST | Streamable HTTP | Full-duplex MCP (recommended) |
/mcp/sse | GET | SSE | Server→client event stream (legacy) |
/mcp/messages?sessionId=<id> | POST | SSE | Client→server JSON-RPC (legacy) |
/health | GET | HTTP | Health probe |
Connect Claude.ai Web
Section titled “Connect Claude.ai Web”- Open Claude.ai → Settings → MCP Servers
- Add a new server
Streamable HTTP (recommended):
https://your-mcp-bridge.up.railway.app/mcp?api_token=YOUR_AUTOMEM_TOKENSSE (fallback):
https://your-mcp-bridge.up.railway.app/mcp/sse?api_token=YOUR_AUTOMEM_TOKENConnect Claude Mobile (iOS/Android)
Section titled “Connect Claude Mobile (iOS/Android)”- Open the Claude app → Settings → MCP Servers
- Add server URL:
Streamable HTTP:
https://your-mcp-bridge.up.railway.app/mcp?api_token=YOUR_AUTOMEM_TOKENThe mobile apps use the same MCP configuration as the web interface.
Authentication Options
Section titled “Authentication Options”Claude.ai supports both authentication methods:
URL-based (simpler):
https://your-mcp-bridge.up.railway.app/mcp?api_token=YOUR_TOKENHeader-based (more secure):
- Server URL:
https://your-mcp-bridge.up.railway.app/mcp - Header:
Authorization: Bearer YOUR_TOKEN
Token extraction priority. The sidecar’s getAuthToken() function checks, in order:
Authorization: Bearer <token>headerX-API-Key: <token>headerX-API-Token: <token>header?api_key=<token>query parameter?apiKey=<token>query parameter?api_token=<token>query parameter
If none of those yield a token, the /mcp and /mcp/sse route handlers fall back to the sidecar’s own AUTOMEM_API_TOKEN environment variable. That fallback lives at the call sites, not inside getAuthToken() — a request with no credentials is only rejected with 401 when the environment variable is also unset.
Available Memory Tools
Section titled “Available Memory Tools”All six AutoMem tools are available via remote MCP:
| Tool | Type | Description |
|---|---|---|
store_memory | Write | Store content with tags, importance, metadata |
recall_memory | Read | Hybrid search (semantic + keyword + tags + time) |
associate_memories | Write | Create typed relationships between memories |
update_memory | Write/Destructive | Modify existing memory fields |
delete_memory | Write/Destructive | Permanently remove a memory |
check_database_health | Read | Check FalkorDB and Qdrant connection status |
The recall_memory tool supports advanced parameters including expand_relations, expand_entities, auto_decompose, expand_min_importance, expand_min_strength, context, language, active_path, context_tags, context_types, and priority_ids.
Verification
Section titled “Verification”Test the connection:
Check the health of the AutoMem serviceTest storing and recalling:
Store a memory: I prefer concise responses without unnecessary preamble.What are my communication preferences?Migrating from SSE to Streamable HTTP
Section titled “Migrating from SSE to Streamable HTTP”Streamable HTTP is the recommended transport. To migrate:
Before (SSE):
https://your-mcp-bridge.up.railway.app/mcp/sse?api_token=<token>After (Streamable HTTP):
https://your-mcp-bridge.up.railway.app/mcp?api_token=<token>Benefits of Streamable HTTP:
- Lower latency (fewer round-trips)
- No
sessionIdmanagement needed - Full-duplex communication
- Better error handling
Troubleshooting
Section titled “Troubleshooting”Claude.ai cannot connect to MCP endpoint
Section titled “Claude.ai cannot connect to MCP endpoint”- Check sidecar health:
curl https://your-mcp-bridge.up.railway.app/health - Verify DNS resolves for your domain
- Ensure valid TLS certificate (Railway auto-provisions)
- Check firewall allows HTTPS (443)
401 Unauthorized
Section titled “401 Unauthorized”- Verify
AUTOMEM_API_TOKENin sidecar environment variables - Check that the token matches between sidecar and memory service
- Test token:
curl -H "Authorization: Bearer $TOKEN" https://your-automem.up.railway.app/health
SSE connection drops
Section titled “SSE connection drops”The sidecar sends heartbeats every 20 seconds to maintain SSE connections. If Claude.ai drops the connection before 20 seconds:
- Check if a reverse proxy is buffering the SSE stream
- The sidecar sets anti-buffering headers (
X-Accel-Buffering: no,Cache-Control: no-cache) - Consider switching to Streamable HTTP transport
Reconnecting (Streamable HTTP)
Section titled “Reconnecting (Streamable HTTP)”The Streamable HTTP endpoint does not replay missed events. Its transport is constructed without an event store, so a Last-Event-ID header on reconnect has no effect and the client starts a fresh exchange. Because the endpoint is stateless, reconnecting is cheap — but any response still in flight when the connection drops is lost and the request must be reissued.
Related Platforms
Section titled “Related Platforms”Other cloud platforms using the same remote MCP sidecar:
- ChatGPT — URL auth only, Streamable HTTP or SSE
- ElevenLabs — SSE with header auth, 30s idle timeout handled by heartbeat