---
title: "Build and Distribute AI Agents and Workflows with cagent"
description: "cagent 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."
url: "https://swe.quest/articles/build-and-distribute-ai-agents-and-workflows-with-cagent-f30c9f0bbad13e54"
canonical: "https://www.docker.com/blog/cagent-build-and-distribute-ai-agents-and-workflows/"
source: "Docker"
published: "2025-09-18"
difficulty: "medium"
kind: "How-to"
reading_minutes: 7
tags: ["ai-agents","developer-tools","containers","open-source"]
---

# Build and Distribute AI Agents and Workflows with cagent

A post on [Docker](https://swe.quest/sources/docker.md), published 2025-09-18, 7 min read, How-to. Original: [https://www.docker.com/blog/cagent-build-and-distribute-ai-agents-and-workflows/](https://www.docker.com/blog/cagent-build-and-distribute-ai-agents-and-workflows/)

## Summary

cagent 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.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [AI agents](https://swe.quest/tags/ai-agents.md) (AI & ML)
- [Developer tools](https://swe.quest/tags/developer-tools.md) (Engineering practices)
- [Containers](https://swe.quest/tags/containers.md) (Infrastructure)
- [Open source](https://swe.quest/tags/open-source.md) (Engineering practices)

## Prerequisites

- Docker basics ([easy posts on Containers](https://swe.quest/tags/containers.md?difficulty=easy))
- Model Context Protocol (MCP) ([easy posts on AI agents](https://swe.quest/tags/ai-agents.md?difficulty=easy))
- YAML

## Keywords

cagent, Docker, MCP, Docker MCP Toolkit, Docker Hub, OCI registry, GitHub MCP server, Advocu

## Related posts

- [Build a Multi-Agent System in 5 Minutes with cagent](https://swe.quest/articles/build-a-multi-agent-system-in-5-minutes-with-cagent-b6fd900693f4f3cc.md): Docker · 2025-10-14 · Medium · 4 min read · AI agents, LLMs, Developer tools
  cagent is an open-source Docker tool that defines multi-agent AI systems declaratively in a single YAML file.
- [Breaking Free From AI Vendor Lock-in: Integrating GitHub Models with Docker cagent](https://swe.quest/articles/breaking-free-from-ai-vendor-lock-in-integrating-github-models-with-docker-8fc971be1201fa24.md): Docker · 2025-12-11 · Medium · 7 min read · AI agents, LLMs, Containers
  Docker cagent, an open-source multi-agent runtime driven by declarative YAML, can use GitHub Models as a custom OpenAI-compatible provider.
- [Building AI Agents with Docker MCP Toolkit: A Developer’s Real-World Setup](https://swe.quest/articles/building-ai-agents-with-docker-mcp-toolkit-a-developer-s-real-world-setup-988aee07496da75c.md): Docker · 2025-08-19 · Medium · 6 min read · AI agents, Containers, LLMs
  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.
- [Dynamic MCPs with Docker: Stop Hardcoding Your Agents’ World](https://swe.quest/articles/dynamic-mcps-with-docker-stop-hardcoding-your-agents-world-a530a7120388ea63.md): Docker · 2025-11-06 · Medium · 11 min read · AI agents, LLMs, Sandboxing & isolation, Containers, Developer tools
  Docker 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.
- [Using MCP Servers: From Quick Tools to Multi-Agent Systems](https://swe.quest/articles/using-mcp-servers-from-quick-tools-to-multi-agent-systems-25a421c78bb6b492.md): Docker · 2026-01-22 · Easy · 6 min read · AI agents, Containers, LLMs
  Containerizing MCP servers addresses three practical problems: language runtime sprawl, secret injection, and N×N client-to-server wiring.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
