Remote Deployment of Conntext7 MCP server to be used in AI IDEs, AI clients, and Coding CLIs
10K+

Your support encourages me to keep creating/supporting my open-source projects. If you found value in this project, you can buy me a coffee to keep me inspired.
Context7 MCP Server is a lightweight, high-performance Model Context Protocol server designed for distributed deployment across multiple architectures. Built on Alpine Linux for minimal footprint and maximum security.
β¨ Multi-Architecture Support - Native support for x86-64 and ARM64
π Multiple Transport Protocols - StreamableHTTP and SSE via mcp-proxy
π Secure by Design - Alpine-based with minimal attack surface
β‘ High Performance - ZSTD compression for faster deployments
π― Production Ready - Stable releases with comprehensive testing
π§ Easy Configuration - Simple environment variable setup
| Architecture | Tag Prefix | Status |
|---|---|---|
| x86-64 | amd64-<version> | β Stable |
| ARM64 | arm64v8-<version> | β Stable |
π‘ Multi-arch images automatically select the correct architecture for your system.
| Tag | Stability | Description | Use Case |
|---|---|---|---|
stable | βββ | Most stable release | Recommended for production |
latest | βββ | Latest stable release | Stay current with stable features |
4.1.1 | βββ | Specific version | Version pinning for consistency |
beta | β οΈ | Beta releases | Testing only |
π CRITICAL: Do NOT expose this container directly to the internet without proper security measures (reverse proxy, SSL/TLS, authentication, firewall rules).
services:
context7-mcp:
image: mekayelanik/context7-mcp:stable
container_name: context7-mcp
restart: unless-stopped
ports:
- "8010:8010"
environment:
- PORT=8010
- INTERNAL_PORT=38011
- PUID=1000
- PGID=1000
- TZ=Asia/Dhaka
- NODE_ENV=production
- PROTOCOL=HTTP
- ENABLE_HTTPS=false
- HTTP_VERSION_MODE=auto
# Optional: require Bearer token auth at HAProxy layer
# - API_KEY=replace-with-strong-secret
hostname: context7-mcp
domainname: local
Deploy:
docker compose up -d
docker compose logs -f context7-mcp
docker run -d \
--name=context7-mcp \
--restart=unless-stopped \
-p 8010:8010 \
-e PORT=8010 \
-e INTERNAL_PORT=38011 \
-e PUID=1000 \
-e PGID=1000 \
-e TZ=Asia/Dhaka \
-e NODE_ENV=production \
-e PROTOCOL=HTTP \
-e ENABLE_HTTPS=false \
-e HTTP_VERSION_MODE=auto \
mekayelanik/context7-mcp:stable
| Protocol | Endpoint | Use Case |
|---|---|---|
| HTTP | http://host-ip:8010/mcp | Best compatibility (recommended) |
| SSE | http://host-ip:8010/sse | Real-time streaming |
When HTTPS is enabled (ENABLE_HTTPS=true), use TLS endpoints:
| Protocol | Endpoint |
|---|---|
| SHTTP | https://host-ip:8010/mcp |
| SSE | https://host-ip:8010/sse |
β οΈ Security Warning: The container now defaults to HTTP (
ENABLE_HTTPS=false) for easier local setup. UseENABLE_HTTPS=truefor production, public networks, or any untrusted environment.β±οΈ ARM Devices: Allow 30-60 seconds for initialization before accessing endpoints.
| Variable | Default | Description |
|---|---|---|
PORT | 8010 | Internal server port |
INTERNAL_PORT | 38011 | Internal MCP server port used by mcp-proxy |
PUID | 1000 | User ID for file permissions |
PGID | 1000 | Group ID for file permissions |
TZ | Asia/Dhaka | Container timezone (TZ databaseβ ) |
NODE_ENV | production | Node.js environment |
PROTOCOL | SHTTP | Default transport protocol |
API_KEY | (empty) | Enables Bearer token auth (Authorization: Bearer <API_KEY>) |
CORS | (empty) | Comma-separated CORS origins, supports * |
ENABLE_HTTPS | false | Enables TLS termination in HAProxy |
TLS_CERT_PATH | /etc/haproxy/certs/server.crt | TLS cert path |
TLS_KEY_PATH | /etc/haproxy/certs/server.key | TLS private key path |
TLS_PEM_PATH | /etc/haproxy/certs/server.pem | Combined PEM file used by HAProxy |
TLS_CN | localhost | CN for auto-generated certificate |
TLS_SAN | DNS:<TLS_CN> | SAN for auto-generated certificate |
TLS_DAYS | 365 | Auto-generated cert validity period |
TLS_MIN_VERSION | TLSv1.3 | Minimum TLS protocol (TLSv1.2 or TLSv1.3) |
HTTP_VERSION_MODE | auto | auto, all, h1, h2, h3, h1+h2 |
RATE_LIMIT | 0 | Max requests per RATE_LIMIT_PERIOD per IP (0 = disabled) |
RATE_LIMIT_PERIOD | 10s | Sliding window for rate limiting (e.g., 10s, 1m, 1h) |
MAX_CONNECTIONS_PER_IP | 0 | Max concurrent connections per IP (0 = disabled) |
IP_ALLOWLIST | (empty) | Comma-separated IPs/CIDRs to allow (all others blocked) |
IP_BLOCKLIST | (empty) | Comma-separated IPs/CIDRs to block |
DEBUG_MODE | (empty) | Enables debug hold mode when set truthy |
ENABLE_HTTPS=true and cert files are missing, the container auto-generates a self-signed certificate.TLS_CERT_PATH and TLS_KEY_PATH exist, they are merged into TLS_PEM_PATH and used directly.HTTP_VERSION_MODE=h3 (or auto) enables HTTP/3 only when HAProxy build includes QUIC; otherwise it safely falls back.API_KEY to enforce authentication at reverse proxy level.Authorization: Bearer <API_KEY>.RATE_LIMIT=100 to allow 100 requests per RATE_LIMIT_PERIOD (default 10s) per IP. Exceeding the limit returns HTTP 429 with a Retry-After header.MAX_CONNECTIONS_PER_IP=50 to cap concurrent connections per IP. Exceeding returns HTTP 429.IP_BLOCKLIST=192.0.2.0/24,198.51.100.5 to block specific IPs/CIDRs. Blocked IPs receive HTTP 403.IP_ALLOWLIST=10.0.0.0/8,192.168.1.0/24 to allow only listed IPs/CIDRs. All others receive HTTP 403. Localhost is always allowed.Find your IDs and set them to avoid permission issues:
id username
# uid=1000(user) gid=1000(group)
- TZ=Asia/Dhaka # Bangladesh
- TZ=America/New_York # US Eastern
- TZ=Europe/London # UK
- TZ=UTC # Universal Time
This image embeds mcp-proxy (sparfenyuk/mcp-proxy) as the stdioβHTTP bridge. Key knobs:
MCP_PROXY_STATELESS=false (default): one stdio backend child is shared across all MCP sessions, JSON-RPC-id-multiplexed. Minimal memory, no per-request fork cost.MCP_PROXY_STATELESS=true: per-request transport instance. Use only when full session isolation is required β memory grows with concurrency.HAPROXY_FRONTEND_MAXCONN / HAPROXY_SERVER_MAXCONN: HAProxy-level caps. Bound bursts so the backend cannot be flooded. Defaults of 64/16 are sensible for a single replica.Root cause for the migration: supergateway 3.4.3 stateless mode (its default) spawned a child stdio process per POST and never reaped it (supercorp-ai/supergateway#108). mcp-proxy stateful default shares one stdio backend across sessions and reduced RSS by ~4.6Γ in our fleet testing.
| Client | HTTP | SSE | Recommended |
|---|---|---|---|
| VS Code (Cline/Roo-Cline) | β | β | |
| Claude Desktop | β | β | |
| Claude CLI | β | β | |
| Codex CLI | β | β | |
| Codeium (Windsurf) | β | β | |
| Cursor | β | β |
Configure in .vscode/settings.json:
{
"mcp.servers": {
"context7": {
"url": "http://host-ip:8010/mcp",
"transport": "http"
}
}
}
Configuration:
claude mcp add-json github '{"type":"http","url":"http://localhost:8045/mcp","headers":{"Authorization":"Bearer <YOUR_API_KEY>"}}'
claude mcp add-json github '{"type":"http","url":"http://localhost:8045/mcp"}'
Configure in ~/.codex/config.json:
{
"mcpServers": {
"context7": {
"transport": "http",
"url": "http://host-ip:8010/mcp"
}
}
}
Configure in .codeium/mcp_settings.json:
{
"mcpServers": {
"context7": {
"transport": "http",
"url": "http://host-ip:8010/mcp"
}
}
}
Configure in ~/.cursor/mcp.json:
{
"mcpServers": {
"context7": {
"transport": "http",
"url": "http://host-ip:8010/mcp"
}
}
}
Verify with MCP Inspectorβ :
npm install -g @modelcontextprotocol/inspector
mcp-inspector http://host-ip:8010/mcp
| Network Mode | Complexity | Performance | Use Case |
|---|---|---|---|
| Bridge | β Easy | βββ Good | Default, isolated |
| Host | ββ Moderate | ββββ Excellent | Direct host access |
| MACVLAN | βββ Advanced | ββββ Excellent | Dedicated IP |
services:
context7-mcp:
image: mekayelanik/context7-mcp:stable
ports:
- "8010:8010"
Benefits: Container isolation, easy setup, works everywhere
Access: http://localhost:8010/mcp
services:
context7-mcp:
image: mekayelanik/context7-mcp:stable
network_mode: host
Benefits: Maximum performance, no NAT overhead, no port mapping needed
Considerations: Linux only, shares host network namespace
Access: http://localhost:8010/mcp
services:
context7-mcp:
image: mekayelanik/context7-mcp:stable
mac_address: "AB:BC:CD:DE:EF:01"
networks:
macvlan-net:
ipv4_address: 192.168.1.100
networks:
macvlan-net:
driver: macvlan
driver_opts:
parent: eth0
ipam:
config:
- subnet: 192.168.1.0/24
gateway: 192.168.1.1
Benefits: Dedicated IP, direct LAN access
Considerations: Linux only, requires additional setup
Access: http://192.168.1.100:8010/mcp
docker compose pull
docker compose up -d
docker image prune -f
docker pull mekayelanik/context7-mcp:stable
docker stop context7-mcp && docker rm context7-mcp
# Run your original docker run command
docker image prune -f
docker run --rm \
-v /var/run/docker.sock:/var/run/docker.sock \
containrrr/watchtower \
--run-once \
context7-mcp
# Check Docker version
docker --version
# Verify port availability
sudo netstat -tulpn | grep 8010
# Check logs
docker logs context7-mcp
# Get your IDs
id $USER
# Update configuration with correct PUID/PGID
# Fix volume permissions if needed
sudo chown -R 1000:1000 /path/to/volume
# Test connectivity
curl http://localhost:8010/mcp
curl http://host-ip:8010/mcp
curl -k https://localhost:8010/mcp
curl -k https://host-ip:8010/mcp
# Check firewall
sudo ufw status
# Verify container
docker inspect context7-mcp | grep IPAddress
docker logs -f context7-mcpdocker stats context7-mcpWhen reporting issues, include:
# System info
docker --version && uname -a
# Container logs
docker logs context7-mcp --tail 200 > logs.txt
# Container config
docker inspect context7-mcp > inspect.json
Your support encourages me to keep creating/supporting my open-source projects. If you found value in this project, you can buy me a coffee to keep me inspired.
Docker Image Issues:
Context7 MCP Issues:
We welcome contributions:
GPL License. See LICENSEβ for details.
Context7 MCP server has its own license - see Main NPM repoβ .
Content type
Image
Digest
sha256:807d6fde1β¦
Size
99.4 MB
Last updated
4 days ago
docker pull mekayelanik/context7-mcp