docker-agent-backend
Lightweight, secure Docker agent with REST and WebSocket APIs for container management and real-time monitoring, built with FastAPI.
claude mcp add --transport stdio ahmed-gelemli-docker-agent-backend docker run -i ahmed-gelemli/docker-agent-backend:latest \ --env DEBUG="false" \ --env APP_NAME="Docker Agent Backend" \ --env MCP_DEBUG="false" \ --env SECRET_KEY="GENERATE-SECRET-KEY" \ --env MCP_API_KEY="your-mcp-api-key" \ --env MCP_ENABLED="true" \ --env API_PASSWORD="your_secure_password" \ --env API_USERNAME="admin"
How to use
Docker Agent Backend exposes REST APIs and WebSocket streams to manage and monitor Docker containers remotely. It includes an MCP (Model Context Protocol) surface that lets AI assistants like Claude or Cursor interact with Docker through a set of predefined tools such as listing containers, getting container details, streaming logs, and retrieving images. You can authenticate via JWT and use the provided endpoints under /api/v1 to perform typical container operations, plus the MCP endpoints at /mcp/sse and /mcp/messages/ to exchange structured commands. Real-time capabilities include WebSocket streams for logs, stats, and events, enabling reactive integrations with dashboards or assistants. Ensure you provide a valid Bearer token when calling protected endpoints and supply the MCP token on the MCP SSE and message endpoints when using the MCP tools.
How to install
Prerequisites: Docker and Docker Compose installed on the host, and internet access. If you prefer local development, Python and dependencies listed in requirements.txt are needed as an alternative to Docker-based setup.
Option A: Docker Compose (recommended)
- Clone the repository:
git clone https://github.com/ahmed-gelemli/docker-agent-backend.git
cd docker-agent-backend
- Create environment file with required credentials:
cat > .env << EOF
SECRET_KEY=$(openssl rand -base64 32)
API_USERNAME=admin
API_PASSWORD=your_secure_password
MCP_ENABLED=true
MCP_API_KEY=your-mcp-api-key-at-least-16-chars
MCP_DEBUG=false
DEBUG=false
APP_NAME=Docker Agent
EOF
- Start the stack (via Docker Compose):
docker compose up --build -d
Option B: Local development (non-Docker)
- Install Python dependencies:
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
- Create a .env file with the same keys as above, or configure environment variables in your shell.
- Run the dev server:
python run.py
Prerequisites summary: Docker with Compose for the recommended path; Python 3.x and dependencies for local development; OpenSSL for generating SECRET_KEY; network access to pull Docker images. Ensure the MCP feature is enabled via MCP_ENABLED and provide a valid MCP_API_KEY if you intend to use MCP tools.
Additional notes
Tips and common issues: - If JWT validation fails, verify system clock synchronization between client and server. - Ensure MCP_API_KEY remains secret; rotate periodically. - For WebSocket streams, pass the JWT as a query parameter the same as described in the MCP section. - If rate limiting blocks legitimate requests during testing, temporarily adjust RATE_LIMIT_* values in .env or your deployment environment. - Use the health endpoints to verify container status and Docker connectivity before integrating with external tools. - The MCP surface exposes a stable set of tools; use the SSE endpoint at /mcp/sse to initialize the MCP session and then send messages to /mcp/messages/.
Related MCP Servers
XHS-Downloader
小红书(XiaoHongShu、RedNote)链接提取/作品采集工具:提取账号发布、收藏、点赞、专辑作品链接;提取搜索结果作品、用户链接;采集小红书作品信息;提取小红书作品下载地址;下载小红书作品文件
phpMyFAQ
phpMyFAQ - Open Source FAQ web application for PHP 8.3+ and MySQL, PostgreSQL and other databases
magg
Magg: The MCP Aggregator
nestjs-starter
Production-ready NestJS boilerplate with JWT auth, PostgreSQL/Prisma, AWS S3/SES, Bull/Redis queues, Docker/K8s support, and MCP integration for AI capabilities
knowledge-graph-system
Kappa Graph — κ(G). A semantic knowledge graph where knowledge has weight. Extracts concepts, measures grounding strength, preserves disagreement, traces everything to source.
mcp-selenium-grid
[pre-release, testing usage] A Model Context Protocol (MCP) server that enables AI Agents to request and manage Selenium browser instances through a secure API. Perfect for your automated browser testing needs! 🚀 [In development: creating usage examples and in-cluster setup]