Docker Swarm
MCP server for Docker Swarm orchestration using FastAPI and Docker SDK
What is Docker Swarm?
Docker Swarm is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to mcp server for docker swarm orchestration using fastapi and docker sdk
MCP server for Docker Swarm orchestration using FastAPI and Docker SDK
This server falls under the Cloud Services category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- MCP server for Docker Swarm orchestration using FastAPI and
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx docker-swarmConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use Docker Swarm
The Docker Swarm MCP Server exposes Docker Swarm orchestration capabilities as MCP tools via an HTTP/JSON-RPC interface built with FastAPI and the Docker Python SDK. It supports service management, stack deployment, overlay networking, secrets handling, and node inspection — all secured with bearer token authentication and designed for production Swarm clusters.
Prerequisites
- Docker Engine in Swarm mode (`docker swarm init` on the manager node)
- Python 3.10 or later with pip, or Docker for container-based deployment
- Access to the Docker socket (unix:///var/run/docker.sock) on the Swarm manager
- A secure bearer token string for MCP_ACCESS_TOKEN
- Claude Desktop or Claude Code with HTTP MCP transport support
Initialize Docker Swarm (if not already done)
Initialize Docker Swarm on your manager node. Skip this step if Swarm is already active.
docker swarm initDeploy the MCP server as a Docker Stack
Deploy the server using the provided docker-swarm-mcp.yml compose file. Set MCP_ACCESS_TOKEN to a strong random string.
export MCP_ACCESS_TOKEN="your-secure-random-token"
docker stack deploy -c docker-swarm-mcp.yml mcp-serverVerify the server is running
Check the service logs to confirm the FastAPI server started successfully and is listening on port 8000.
docker service logs mcp-server_docker-mcpTest authentication with curl
Send a test request to the MCP endpoint to verify bearer token authentication works.
curl -X POST http://localhost:8000/mcp/ \
-H "Authorization: Bearer your-secure-random-token" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":"1","method":"tools/list","params":{}}' Add to Claude Desktop or Claude Code
Configure your MCP client to connect to the running HTTP server using the bearer token. For Claude Code, use the claude mcp add command.
claude mcp add --transport http docker-swarm-mcp \
--header "X-Access-Token: your-secure-random-token" \
http://localhost:8000/mcp/Docker Swarm Examples
Client configuration
Claude Desktop config for the Docker Swarm MCP server using HTTP transport with bearer auth.
{
"mcpServers": {
"docker-swarm-mcp": {
"transport": {
"type": "http",
"url": "http://localhost:8000/mcp/",
"headers": {
"Authorization": "Bearer your-secure-random-token"
}
}
}
}
}Prompts to try
Swarm management tasks you can perform through natural language.
- "List all running Docker Swarm services and their replica counts."
- "Scale the web service to 5 replicas."
- "Deploy my application stack from the compose file at /stacks/myapp.yml."
- "Show all Swarm nodes and identify which ones are managers."
- "Create an overlay network called app-net with encryption enabled."Troubleshooting Docker Swarm
401 Unauthorized when calling MCP endpoints
Ensure the Authorization header value matches the MCP_ACCESS_TOKEN environment variable exactly, including case. The header format must be 'Bearer <token>' with a space after Bearer.
Docker socket permission denied inside the container
The container needs access to /var/run/docker.sock. In your stack YAML, mount the socket as a volume: `- /var/run/docker.sock:/var/run/docker.sock`. Ensure the container user has permission to read the socket.
Service deploys but port 8000 is not reachable
Check that the Swarm service publishes port 8000. In the docker-swarm-mcp.yml file, confirm the ports section includes `- published: 8000, target: 8000, mode: host`. Also check host firewall rules.
Frequently Asked Questions about Docker Swarm
What is Docker Swarm?
Docker Swarm is a Model Context Protocol (MCP) server that mcp server for docker swarm orchestration using fastapi and docker sdk It connects AI assistants to external tools and data sources through a standardized interface.
How do I install Docker Swarm?
Follow the installation instructions on the Docker Swarm GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with Docker Swarm?
Docker Swarm works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is Docker Swarm free to use?
Yes, Docker Swarm is open source and available under the MIT license. You can use it freely in both personal and commercial projects.
Docker Swarm Alternatives — Similar Cloud Services Servers
Looking for alternatives to Docker Swarm? Here are other popular cloud services servers you can use with Claude, Cursor, and VS Code.
Open WebUI
★ 138.2kUser-friendly AI Interface (Supports Ollama, OpenAI API, ...)
Anything LLM
★ 60.4kThe all-in-one AI productivity accelerator. On device and privacy first with no annoying setup or configuration.
LocalAI
★ 46.4kLocalAI is the open-source AI engine. Run any model - LLMs, vision, voice, image, video - on any hardware. No GPU required.
Nacos
★ 33.0kan easy-to-use dynamic service discovery, configuration and service management platform for building AI cloud native applications.
Xiaozhi ESP32
★ 26.7k本项目为xiaozhi-esp32提供后端服务,帮助您快速搭建ESP32设备控制服务器。Backend service for xiaozhi-esp32, helps you quickly build an ESP32 device control server.
Gateway
★ 11.8kA blazing fast AI Gateway with integrated guardrails. Route to 1,600+ LLMs, 50+ AI Guardrails with 1 fast & friendly API.
Browse More Cloud Services MCP Servers
Explore all cloud services servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up Docker Swarm in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use Docker Swarm?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.