-
-
Notifications
You must be signed in to change notification settings - Fork 267
Claude AI Remote MCP Integration
Connect MCP Memory Service as a remote MCP server to claude.ai via HTTPS — giving Claude web access to all 12 memory tools directly in the browser.
Since 2025, claude.ai supports remote MCP servers via HTTPS. This means you can connect your self-hosted MCP Memory Service instance to claude.ai without needing Claude Desktop or Claude Code — just a browser.
- Use all 12 memory tools (
memory_store,memory_search, etc.) directly in claude.ai conversations - Access your memories from any device with a browser
- Team collaboration via shared memory server
- No local installation required on client machines
| Requirement | Details | Status in Project |
|---|---|---|
| Streamable HTTP Transport | claude.ai connects via HTTP POST to /mcp
|
Implemented (MCP_STREAMABLE_HTTP_MODE=1) |
| HTTPS/TLS | Valid certificate from recognized CA required | Implemented (MCP_HTTPS_ENABLED=true) |
| OAuth 2.0 with DCR | Dynamic Client Registration (RFC 7591) | Implemented since v7.0.0 |
| Safety Annotations | Every tool needs readOnlyHint or destructiveHint
|
Implemented on all tools |
| CORS | Properly configured for browser clients | Implemented (FastAPI) |
Note: SSE transport is being deprecated by Anthropic. Use Streamable HTTP for new deployments.
Terminal 1 — Start the MCP server:
MCP_STREAMABLE_HTTP_MODE=1 \
MCP_SSE_HOST=0.0.0.0 \
MCP_SSE_PORT=8765 \
python -m mcp_memory_service.serverTerminal 2 — Create a public HTTPS tunnel:
# Install once: brew install cloudflared (macOS) or apt install cloudflared (Linux)
cloudflared tunnel --url http://localhost:8765This gives you a URL like https://random-name.trycloudflare.com.
In claude.ai:
- Go to Settings > Connectors
- Click Add Connector
- Enter the tunnel URL:
https://random-name.trycloudflare.com/mcp - Done — all memory tools are now available!
Limitation: Temporary tunnels change URL on restart. For persistent access, create a named Cloudflare Tunnel.
# In your .env file:
MCP_STREAMABLE_HTTP_MODE=1
MCP_SSE_HOST=0.0.0.0
MCP_SSE_PORT=8765
MCP_HTTPS_ENABLED=true
MCP_SSL_CERT_FILE=/etc/letsencrypt/live/memory.yourdomain.com/fullchain.pem
MCP_SSL_KEY_FILE=/etc/letsencrypt/live/memory.yourdomain.com/privkey.pem
# Start server
python -m mcp_memory_service.serverThen add https://memory.yourdomain.com:8765/mcp in claude.ai Settings > Connectors.
# Caddyfile
memory.yourdomain.com {
reverse_proxy localhost:8765
}
# Start MCP server (HTTP only, Caddy handles TLS)
MCP_STREAMABLE_HTTP_MODE=1 MCP_SSE_HOST=127.0.0.1 MCP_SSE_PORT=8765 \
python -m mcp_memory_service.server
# Start Caddy
caddy runAdd these to your .env file:
# === Transport (REQUIRED) ===
MCP_STREAMABLE_HTTP_MODE=1 # Enable Streamable HTTP transport
MCP_SSE_HOST=0.0.0.0 # Listen on all interfaces (for remote access)
MCP_SSE_PORT=8765 # MCP transport port
# === HTTPS (REQUIRED for direct exposure, skip if using reverse proxy) ===
MCP_HTTPS_ENABLED=true
MCP_SSL_CERT_FILE=/path/to/fullchain.pem
MCP_SSL_KEY_FILE=/path/to/privkey.pem
# === OAuth (RECOMMENDED for claude.ai) ===
MCP_OAUTH_ENABLED=true
MCP_OAUTH_STORAGE_BACKEND=sqlite # Persistent token storage
MCP_OAUTH_SQLITE_PATH=./data/oauth.db
# === Storage Backend ===
MCP_MEMORY_STORAGE_BACKEND=hybrid # Or sqlite_vec for local-only
MCP_MEMORY_SQLITE_PRAGMAS=journal_mode=WAL,busy_timeout=15000,cache_size=20000Claude.ai uses these callback URLs during the OAuth flow. Your server must accept them:
| Callback URL | Status |
|---|---|
https://claude.ai/api/mcp/auth_callback |
Current |
https://claude.com/api/mcp/auth_callback |
Future (also allowlist) |
For Claude Code (local), also allowlist:
http://localhost:6274/oauth/callbackhttp://localhost:6274/oauth/callback/debug
If your server is behind a firewall, you must allowlist Claude's IP addresses:
- Reference: https://docs.claude.com/en/api/ip-addresses
- Note: IP allowlisting alone is NOT recommended as a security measure — always use OAuth
┌──────────────┐ HTTPS/TLS ┌─────────────────────────┐
│ claude.ai │ ◄────────────────► │ MCP Memory Service │
│ (Browser) │ Streamable HTTP │ │
│ │ POST /mcp │ ┌───────────────────┐ │
│ Settings > │ │ │ Streamable HTTP │ │
│ Connectors │ OAuth 2.0 DCR │ │ Transport │ │
│ │ ◄────────────────► │ │ (Port 8765) │ │
└──────────────┘ │ └─────────┬─────────┘ │
│ │ │
│ ┌─────────▼─────────┐ │
│ │ MCP Server │ │
│ │ (12 Tools) │ │
│ └─────────┬─────────┘ │
│ │ │
│ ┌─────────▼─────────┐ │
│ │ Storage Backend │ │
│ │ (Hybrid/SQLite) │ │
│ └───────────────────┘ │
└─────────────────────────┘
Once connected, these tools become available in your claude.ai conversations:
| Tool | Type | Description |
|---|---|---|
memory_store |
write | Store new memories with tags and metadata |
memory_search |
read | Semantic search across all memories |
memory_delete |
write | Delete specific memories |
memory_update |
write | Update existing memory content |
memory_list |
read | List memories with filtering |
memory_stats |
read | Storage statistics and metrics |
memory_health |
read | System health check |
memory_consolidate |
write | Run memory consolidation |
memory_graph |
read | Query knowledge graph |
memory_quality |
read | Quality scoring and analytics |
memory_cleanup |
write | Clean up low-quality memories |
memory_ingest |
write | Ingest documents into memory |
| Option | Complexity | Cost | Best For |
|---|---|---|---|
| Cloudflare Tunnel | Low | Free | Quick setup, home server |
| Caddy + VPS | Medium | ~$5/mo | Persistent, reliable |
| Docker + Cloud | Medium | ~$10/mo | Scalable, managed |
| Option | Complexity | Cost | Best For |
|---|---|---|---|
| Docker + OAuth | Medium | $10-20/mo | Small teams |
| Kubernetes | High | $50+/mo | Enterprise, multi-team |
# docker-compose.yml
services:
mcp-memory:
image: ghcr.io/doobidoo/mcp-memory-service:latest
environment:
- MCP_STREAMABLE_HTTP_MODE=1
- MCP_SSE_HOST=0.0.0.0
- MCP_SSE_PORT=8765
- MCP_OAUTH_ENABLED=true
- MCP_OAUTH_STORAGE_BACKEND=sqlite
- MCP_MEMORY_STORAGE_BACKEND=sqlite_vec
ports:
- "8765:8765"
volumes:
- ./data:/app/data| Problem | Solution |
|---|---|
| "Failed to connect" in claude.ai | Verify URL is HTTPS and publicly accessible |
| OAuth flow fails | Check callback URLs are allowlisted |
| "Certificate error" | Ensure valid TLS cert (not self-signed) |
| Tools not appearing | Check MCP_STREAMABLE_HTTP_MODE=1 is set |
| Timeout during connection | Increase MCP_INIT_TIMEOUT or check network |
# Test the MCP endpoint
curl -X POST https://your-server.com/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "tools/list", "id": 1}'
# Test health endpoint (if HTTP API also running)
curl https://your-server.com/api/health# Check server logs for connection attempts
python -m mcp_memory_service.server 2>&1 | grep -i "connect\|oauth\|error"- Always use HTTPS — never expose MCP over plain HTTP
- Enable OAuth — API key alone is insufficient for browser-based access
-
Restrict CORS origins — limit to
https://claude.aiandhttps://claude.com - Use firewall rules — allowlist only Claude's IP ranges
- Monitor access logs — watch for unauthorized connection attempts
- Rotate OAuth secrets — periodically regenerate JWT signing keys
| Transport | claude.ai | Claude Desktop | Claude Code |
|---|---|---|---|
| Stdio | No | Yes (default) | Yes (default) |
| Streamable HTTP | Yes | Yes | Yes |
| SSE | Deprecated | Yes | Yes |
Recommendation: Use Streamable HTTP for claude.ai. Keep Stdio for Claude Desktop (simplest). Claude Code supports all three.
- OAuth 2.1 Setup Guide — Detailed OAuth configuration
- Integration Guide — Claude Desktop, Claude Code, VS Code setup
- Advanced Configuration — Environment variables, tuning
- Hybrid Backend Setup — Recommended storage backend
- Troubleshooting — General troubleshooting