Skip to content

Claude AI Remote MCP Integration

Henry edited this page Mar 8, 2026 · 2 revisions

Claude.ai Remote MCP Integration (HTTPS)

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.


Overview

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.

What This Enables

  • 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

Requirements

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.


Quick Start (5 Minutes)

Option A: Cloudflare Tunnel (Easiest, No Port Forwarding)

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.server

Terminal 2 — Create a public HTTPS tunnel:

# Install once: brew install cloudflared (macOS) or apt install cloudflared (Linux)
cloudflared tunnel --url http://localhost:8765

This gives you a URL like https://random-name.trycloudflare.com.

In claude.ai:

  1. Go to Settings > Connectors
  2. Click Add Connector
  3. Enter the tunnel URL: https://random-name.trycloudflare.com/mcp
  4. Done — all memory tools are now available!

Limitation: Temporary tunnels change URL on restart. For persistent access, create a named Cloudflare Tunnel.

Option B: Own Domain with Let's Encrypt

# 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.server

Then add https://memory.yourdomain.com:8765/mcp in claude.ai Settings > Connectors.

Option C: Reverse Proxy (Caddy)

# 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 run

Full Configuration

Environment Variables

Add 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=20000

OAuth Callback URLs

Claude.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/callback
  • http://localhost:6274/oauth/callback/debug

Firewall / IP Allowlisting

If your server is behind a firewall, you must allowlist Claude's IP addresses:


Architecture

┌──────────────┐     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)   │  │
                                    │  └───────────────────┘  │
                                    └─────────────────────────┘

Available Tools in claude.ai

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

Deployment Options

For Personal Use

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

For Teams

Option Complexity Cost Best For
Docker + OAuth Medium $10-20/mo Small teams
Kubernetes High $50+/mo Enterprise, multi-team

Docker Deployment Example

# 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

Troubleshooting

Connection Issues

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

Verify Server is Running

# 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

Logs

# Check server logs for connection attempts
python -m mcp_memory_service.server 2>&1 | grep -i "connect\|oauth\|error"

Security Considerations

  1. Always use HTTPS — never expose MCP over plain HTTP
  2. Enable OAuth — API key alone is insufficient for browser-based access
  3. Restrict CORS origins — limit to https://claude.ai and https://claude.com
  4. Use firewall rules — allowlist only Claude's IP ranges
  5. Monitor access logs — watch for unauthorized connection attempts
  6. Rotate OAuth secrets — periodically regenerate JWT signing keys

Comparison: MCP Transports

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.


Related Guides


References

Clone this wiki locally