Building AI Agents with Docker MCP Toolkit: A Developer’s Real-World Setup
A GitHub repository question-answering agent is built by running the GitHub MCP Gateway (docker/mcp-gateway) as a container under Docker Compose and connecting a Python agent to it over streamable-http via MCPTools. The gateway lists files, fetches content and searches code, and GPT-4o reasons over the results. Setup takes a few commands: store a GitHub token with `docker mcp secret set`, run `docker compose up`, then run app.py. The main argument is that containerized MCP connectors keep integration code out of the agent and give consistent environments, and new tools such as Jira or Slack can be added as extra Compose services.
Related posts
- Breaking Free From AI Vendor Lock-in: Integrating GitHub Models with Docker cagent
Docker mediumAdeptDocker cagent, an open-source multi-agent runtime driven by declarative YAML, can use GitHub Models as a custom OpenAI-compatible provider. You point base_url at https://models.github.ai/inference and pass a GitHub personal access token as the API key, so one credential reaches models from OpenAI, Meta, Microsoft, Anthropic and DeepSeek. The walkthrough builds a podcast-generator agent whose root agent delegates to researcher and scriptwriter sub-agents that use DuckDuckGo and filesystem MCP servers through the Docker MCP gateway. The agent is then shared through Docker Hub with cagent push, pull and run.
- Dynamic MCPs with Docker: Stop Hardcoding Your Agents’ World
Docker mediumAdeptDocker MCP Gateway now exposes primordial tools (mcp-find, mcp-add) that let agents search a curated catalog of 270+ MCP servers, add them to the live session, and trigger OAuth or elicitation flows, instead of hand-editing JSON config and restarting. The gateway can also hide added servers' tool definitions from tools/list so they stay discoverable without bloating the context window. A code-mode tool lets agents write JavaScript that composes tools from several MCP servers inside a Docker sandbox, keeping intermediate results out of the model and cutting per-turn token usage. The features ship in Docker Desktop 4.50 and are on by default, and cagent can expose such agents to ACP-enabled editors like Zed and Neovim.
- Build and Distribute AI Agents and Workflows with cagent
Docker mediumAdeptcagent is Docker's open-source command-line runtime that defines AI agents (model, instructions, persona and MCP tools) in a single YAML file and distributes them through OCI registries such as Docker Hub. Two working agents illustrate it: a GitHub-issues to-do tracker, and an internal assistant that queries Docker Captains' contributions in Advocu through a custom MCP server running in a container. Practical tips include connecting through the Docker MCP gateway to reuse Docker Desktop's OAuth login, and limiting the verbose GitHub MCP server to the issue-related tools the agent needs.
- How to Add MCP Servers to ChatGPT with Docker MCP Toolkit
Docker mediumAdeptDocker MCP Toolkit lets ChatGPT's Developer Mode call real tools by running MCP servers in isolated containers behind a Docker MCP Gateway exposed to ChatGPT via an ngrok tunnel. The guide walks through initializing a gateway from the chatgpt-app-basic template, running it with Docker Compose on port 8811 with streaming transport, and registering it as a custom connector. It then configures seven servers (Firecrawl, SQLite, Stripe, GitHub, Node.js Sandbox, Sequential Thinking, Context7) to build a competitive repricing agent that scrapes competitor prices, updates Stripe prices, logs decisions to SQLite and pushes audit reports to GitHub.
- How to add MCP Servers to Claude Desktop with Docker MCP Toolkit
Docker mediumAdeptDocker Desktop's MCP Toolkit connects Claude Desktop to containerized MCP servers through a single claude_desktop_config.json entry that runs `docker mcp gateway run`, a gateway that routes tool calls from Claude to whichever servers are enabled. The guide walks through connecting the client and configuring Firecrawl, GitHub (OAuth or personal access token), Sequential Thinking, Context7 and a Node.js Sandbox. It then demos turning a UI screenshot into a React component with Jest tests pushed to GitHub. The sandbox uses a Docker-out-of-Docker pattern via the mounted Docker socket, which spawns resource-limited ephemeral containers but effectively grants root-level host access, so it is suited to local development only.