The missing MCP server for Docker Swarm. Finally, a production-ready MCP that gives you full Docker Swarm control without drowning your AI in tool descriptions.
🎯 Why This Exists
The Gap: After searching the MCP ecosystem, I found:
MCP server for Docker Swarm orchestration using FastAPI and Docker SDK
✅ No bloat - Just the tools you need, when you need them, filtered by the task at hand.
Note on secrets and client config:
Do not commit secrets. Use environment variables (e.g., MCP_ACCESS_TOKEN), Docker secrets, or a secret manager.
The .kilocode/ directory is gitignored. If you need a local MCP client config, copy mcp.client.json.example to your local tooling and set Authorization to use a runtime value like Bearer ${MCP_ACCESS_TOKEN}.
🚀 Quick Start (2 Minutes)
1️⃣ Deploy to Your Swarm
# Save this as docker-swarm-mcp.yml (or use one of the examples below)
# Deploy to your swarm
docker stack deploy -c docker-swarm-mcp.yml mcp-server
# Verify it's running
docker service logs mcp-server_docker-mcp
Different AI assistants and code editors configure MCP servers in slightly different ways. Find your client in the groups below and use the corresponding JSON configuration.
Remember to replace <YOUR_SECURE_TOKEN_HERE> with your actual token.
These clients use a more structured format that supports passing the API token securely in the request headers. This is the recommended and most secure method.
Example Clients:
Claude Desktop • Copilot Coding Agent • Gemini CLI • Visual Studio 2022 • Crush • Opencode
⚠️ Security Note: Query parameter authentication (?accessToken=...) has been removed in v0.5.0 for security reasons. Tokens should never appear in URLs because they end up in server logs, browser history, and referrer headers. Use headers instead.
These clients support custom headers but may not support the full Authorization: Bearer format. Use the X-Access-Token header for simpler configuration while keeping tokens out of the URL.
Example Clients: Cursor • VS Code • Rovo Dev CLI • Qodo Gen • Trae
Configuration:
Note: The key name might be url or serverUrl depending on the client. Most clients accept a headers block for custom headers—check your client's documentation if one doesn't work.
Note: Remember to replace <your-secure-token-here> with your actual access token. If your CLI does not support custom headers, use --header "Authorization: Bearer <your-secure-token-here>" instead.
Important Note: The examples above show the docker-swarm-mcp object being added inside an mcpServers block. Your client's configuration file might use a different top-level key (e.g., mcp, servers). Please merge this configuration into your existing settings file structure.
3️⃣ Start Using It!
Just ask your AI naturally:
"What containers are running?"
"Deploy my app stack"
"Scale the web service to 5 replicas"
"Show me the swarm nodes"
The server automatically detects what you're trying to do and provides just the right tools!
🎯 What Makes This Different
🧠 Smart Tool Filtering
Traditional MCP servers dump all their tools into your context. This server is smarter:
You Say
Tools Returned
Context Saved
"List my containers"
4 container tools
19 tools hidden
"Deploy a stack"
3 compose tools
20 tools hidden
"Check swarm status"
3 swarm tools
20 tools hidden
"Create a network"
3 network tools
20 tools hidden
Your AI focuses on YOUR project, not on reading documentation.
🐳 Real Docker Swarm Support
Unlike other Docker MCPs, this one actually understands Swarm:
Services - Create, scale, update, rolling deployments
Ask: "How do I discover Docker tools?"
Response: Uses `discover-tools` to explain the 6 categories
💡 Examples
Container Operations
# Your AI can now:
- List all containers with detailed status
- Create containers with complex configurations
- Start/stop/restart containers
- View logs and exec into containers
- Remove containers safely
Swarm Service Management
# Your AI can now:
- Deploy services with replicas
- Scale services up or down
- Update services with rolling updates
- Check service logs across all replicas
- Manage service constraints and preferences
Stack Deployments
# Your AI can now:
- Deploy complete application stacks
- Update stacks with new configurations
- Remove stacks cleanly
- List all stacks and their services
Network & Volume Management
# Your AI can now:
- Create overlay networks for swarm
- Manage network encryption
- Create and manage volumes
- Connect/disconnect containers from networks
🛠️ Advanced Configuration
Variable
Required
Default
Description
MCP_ACCESS_TOKEN
✅
-
Bearer token for authentication
DOCKER_HOST
❌
unix:///var/run/docker.sock
Docker engine connection
DOCKER_TLS_VERIFY
❌
0
Enable TLS verification (1/0)
DOCKER_CERT_PATH
❌
-
Path to TLS certificates
LOG_LEVEL
❌
INFO
DEBUG shows context metrics
ALLOWED_ORIGINS
❌
*
CORS origins (comma-separated)
MCP_TRANSPORT
❌
http
Transport mode (http/sse)
Edit filter-config.json to customize which tools are available:
export DOCKER_HOST="tcp://100.x.y.z:2376" # Tailscale IP
# Clone the repository
git clone https://github.com/KHAEntertainment/docker-swarm-mcp.git
cd docker-swarm-mcp
# Build with Docker
docker build -t docker-swarm-mcp:latest .
# Or build with Docker Compose
docker-compose build
# For development
poetry install
poetry run uvicorn app.main:app --reload
🧪 Testing
# Quick health check
curl http://localhost:8000/mcp/health
# Test authentication (JSON-RPC)
curl -s -X POST http://localhost:8000/mcp/ \
-H "Authorization: Bearer your-token" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":"1","method":"tools/list","params":{}}'
# Test authentication with custom header (JSON-RPC)
curl -s -X POST http://localhost:8000/mcp/ \
-H "X-Access-Token: your-token" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":"1","method":"tools/list","params":{}}'
# Test with intent detection
curl -X POST http://localhost:8000/mcp/ \
-H "Authorization: Bearer your-token" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "tools/list",
"params": {"query": "show me running containers"},
"id": 1
}'
REST API endpoints are now served from /api/*. Set ENABLE_REST_API=true to expose them during development.
अभी टूल सूची नहीं है। रिमोट सर्वर को पहले हेल्थ चेक के बाद सूची मिलती है।
FAQ
सवाल
Docker Swarm कैसे इंस्टॉल करें?
इस पेज पर Cursor, Claude Desktop, Claude Code या VS Code के लिए stdio कॉन्फ़िग कॉपी करें। यह पब्लिशर का इंस्टॉल इस्तेमाल करता है, PlugMCP प्रॉक्सी नहीं।
क्या Docker Swarm के लिए API key चाहिए?
इस रिकॉर्ड में कोई ज़रूरी एनवायरनमेंट वेरिएबल दर्ज नहीं है।
Docker Swarm कौन सा ट्रांसपोर्ट इस्तेमाल करता है?
Docker Swarm stdio पर लोकल चलता है।
Docker Swarm की पिछली जाँच कब हुई थी?
पिछली जाँच 2026-10-28 को हुई। MCP server for Docker Swarm orchestration using FastAPI and Docker SDK