mirror of
https://github.com/docker/docs.git
synced 2026-03-27 14:28:47 +07:00
Fix docker agent serve xxx commands
Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
This commit is contained in:
@@ -29,7 +29,7 @@ Before starting an A2A server, you need:
|
||||
Basic usage:
|
||||
|
||||
```console
|
||||
$ docker agent a2a ./agent.yaml
|
||||
$ docker agent serve a2a ./agent.yaml
|
||||
```
|
||||
|
||||
Your agent is now accessible via HTTP. Other A2A systems can discover your
|
||||
@@ -38,19 +38,19 @@ agent's capabilities and call it.
|
||||
Custom port:
|
||||
|
||||
```console
|
||||
$ docker agent a2a ./agent.yaml --port 8080
|
||||
$ docker agent serve a2a ./agent.yaml --port 8080
|
||||
```
|
||||
|
||||
Specific agent in a team:
|
||||
|
||||
```console
|
||||
$ docker agent a2a ./agent.yaml --agent engineer
|
||||
$ docker agent serve a2a ./agent.yaml --agent engineer
|
||||
```
|
||||
|
||||
From OCI registry:
|
||||
|
||||
```console
|
||||
$ docker agent a2a agentcatalog/pirate --port 9000
|
||||
$ docker agent serve a2a agentcatalog/pirate --port 9000
|
||||
```
|
||||
|
||||
## HTTP endpoints
|
||||
@@ -142,7 +142,7 @@ Here's a concrete scenario where A2A is useful. You have two agents:
|
||||
Run the specialist as an A2A server:
|
||||
|
||||
```console
|
||||
$ docker agent a2a ./code-reviewer.yaml --port 8080
|
||||
$ docker agent serve a2a ./code-reviewer.yaml --port 8080
|
||||
Listening on 127.0.0.1:8080
|
||||
```
|
||||
|
||||
@@ -198,7 +198,7 @@ agents:
|
||||
|
||||
## What's next
|
||||
|
||||
- Review the [CLI reference](../reference/cli.md#a2a) for all `docker agent a2a`
|
||||
- Review the [CLI reference](../reference/cli.md#a2a) for all `docker agent serve a2a`
|
||||
options
|
||||
- Learn about [MCP mode](./mcp.md) to expose agents as tools in MCP clients
|
||||
- Learn about [ACP mode](./acp.md) for editor integration
|
||||
|
||||
@@ -131,11 +131,11 @@ reference:
|
||||
|
||||
```console
|
||||
# Local file path
|
||||
$ docker agent acp ./agent.yml
|
||||
$ docker agent serve acp ./agent.yml
|
||||
|
||||
# OCI registry reference
|
||||
$ docker agent acp agentcatalog/pirate
|
||||
$ docker agent acp dockereng/myagent:v1.0.0
|
||||
$ docker agent serve acp agentcatalog/pirate
|
||||
$ docker agent serve acp dockereng/myagent:v1.0.0
|
||||
```
|
||||
|
||||
Use the same syntax in your editor configuration:
|
||||
@@ -177,7 +177,7 @@ If the agent starts but can't access files or perform other actions, check:
|
||||
- Explore the [toolsets reference](../reference/toolsets.md) to learn what tools
|
||||
are available
|
||||
- Add [RAG for codebase search](../rag.md) to your agent
|
||||
- Check the [CLI reference](../reference/cli.md) for all `docker agent acp` options
|
||||
- Check the [CLI reference](../reference/cli.md) for all `docker agent serve acp` options
|
||||
- Browse [example
|
||||
configurations](https://github.com/docker/cagent/tree/main/examples) for
|
||||
inspiration
|
||||
|
||||
@@ -93,8 +93,10 @@ Example configuration:
|
||||
{
|
||||
"mcpServers": {
|
||||
"myagent": {
|
||||
"command": "/usr/local/bin/cagent",
|
||||
"command": "/usr/local/bin/docker",
|
||||
"args": [
|
||||
"agent",
|
||||
"serve",
|
||||
"mcp",
|
||||
"/path/to/agent.yml",
|
||||
"--working-dir",
|
||||
@@ -111,7 +113,7 @@ Example configuration:
|
||||
|
||||
Configuration breakdown:
|
||||
|
||||
- `command`: Full path to your `cagent` binary (use `which cagent` to find it)
|
||||
- `command`: Full path to your `docker` binary (use `which docker` to find it), or path to docker-agent if not using the docker CLI plugin
|
||||
- `args`: MCP command arguments:
|
||||
- `mcp`: The subcommand to run cagent in MCP mode
|
||||
- `dockereng/myagent`: Your agent configuration (local file path or OCI
|
||||
@@ -142,7 +144,7 @@ Command breakdown:
|
||||
- `myagent`: Name for this MCP server in Claude Code
|
||||
- `--env`: Pass environment variables (repeat for each variable)
|
||||
- `--`: Separates Claude Code options from the MCP server command
|
||||
- `docker agent mcp /path/to/agent.yml`: The cagent MCP command with the path to your
|
||||
- `docker agent serve mcp /path/to/agent.yml`: The cagent MCP command with the path to your
|
||||
agent configuration
|
||||
- `--working-dir $(pwd)`: Set the working directory for agent execution
|
||||
|
||||
@@ -153,7 +155,7 @@ sessions.
|
||||
|
||||
For other MCP-compatible clients, you need to:
|
||||
|
||||
1. Start cagent with `docker agent mcp /path/to/agent.yml --working-dir /project/path`
|
||||
1. Start cagent with `docker agent serve mcp /path/to/agent.yml --working-dir /project/path`
|
||||
2. Configure the client to communicate with Docker Agent over stdio
|
||||
3. Pass required environment variables (API keys, etc.)
|
||||
|
||||
@@ -166,11 +168,11 @@ reference:
|
||||
|
||||
```console
|
||||
# Local file path
|
||||
$ docker agent mcp ./agent.yml
|
||||
$ docker agent serve mcp ./agent.yml
|
||||
|
||||
# OCI registry reference
|
||||
$ docker agent mcp agentcatalog/pirate
|
||||
$ docker agent mcp dockereng/myagent:v1.0.0
|
||||
$ docker agent serve mcp agentcatalog/pirate
|
||||
$ docker agent serve mcp dockereng/myagent:v1.0.0
|
||||
```
|
||||
|
||||
Use the same syntax in MCP client configurations:
|
||||
@@ -179,8 +181,8 @@ Use the same syntax in MCP client configurations:
|
||||
{
|
||||
"mcpServers": {
|
||||
"myagent": {
|
||||
"command": "/usr/local/bin/cagent",
|
||||
"args": ["mcp", "agentcatalog/pirate"]
|
||||
"command": "/usr/local/bin/docker",
|
||||
"args": ["agent", "serve", "mcp", "agentcatalog/pirate"]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -299,7 +301,7 @@ around.
|
||||
- Explore the [toolsets reference](../reference/toolsets.md) to learn what tools
|
||||
agents can use
|
||||
- Add [RAG for codebase search](../rag.md) to your agent
|
||||
- Check the [CLI reference](../reference/cli.md) for all `docker agent mcp` options
|
||||
- Check the [CLI reference](../reference/cli.md) for all `docker agent serve mcp` options
|
||||
- Browse [example
|
||||
configurations](https://github.com/docker/cagent/tree/main/examples) for
|
||||
different agent types
|
||||
|
||||
@@ -53,7 +53,7 @@ systems to discover and interact with your agent. Auto-selects an available
|
||||
port if not specified.
|
||||
|
||||
```console
|
||||
$ docker agent a2a agent-file|registry-ref
|
||||
$ docker agent serve a2a agent-file|registry-ref
|
||||
```
|
||||
|
||||
> [!NOTE]
|
||||
@@ -77,8 +77,8 @@ Supports [runtime flags](#runtime-flags).
|
||||
Examples:
|
||||
|
||||
```console
|
||||
$ docker agent a2a ./agent.yaml --port 8080
|
||||
$ docker agent a2a agentcatalog/pirate --port 9000
|
||||
$ docker agent serve a2a ./agent.yaml --port 8080
|
||||
$ docker agent serve a2a agentcatalog/pirate --port 9000
|
||||
```
|
||||
|
||||
### acp
|
||||
@@ -87,7 +87,7 @@ Start agent as ACP (Agent Client Protocol) server on stdio for editor integratio
|
||||
See [ACP integration](../integrations/acp.md) for setup guides.
|
||||
|
||||
```console
|
||||
$ docker agent acp agent-file|registry-ref
|
||||
$ docker agent serve acp agent-file|registry-ref
|
||||
```
|
||||
|
||||
Arguments:
|
||||
@@ -146,7 +146,7 @@ Arguments:
|
||||
HTTP API server.
|
||||
|
||||
```console
|
||||
$ docker agent api agent-file|agents-dir
|
||||
$ docker agent serve api agent-file|agents-dir
|
||||
```
|
||||
|
||||
Arguments:
|
||||
@@ -166,9 +166,9 @@ Supports [runtime flags](#runtime-flags).
|
||||
Examples:
|
||||
|
||||
```console
|
||||
$ docker agent api ./agent.yaml
|
||||
$ docker agent api ./agents/ --listen :9000
|
||||
$ docker agent api docker.io/user/agent --pull-interval 10
|
||||
$ docker agent serve api ./agent.yaml
|
||||
$ docker agent serve api ./agents/ --listen :9000
|
||||
$ docker agent serve api docker.io/user/agent --pull-interval 10
|
||||
```
|
||||
|
||||
The `--pull-interval` flag works only with OCI references. Automatically pulls and reloads at the specified interval.
|
||||
@@ -304,7 +304,7 @@ MCP (Model Context Protocol) server on stdio. Exposes agents as tools to MCP
|
||||
clients. See [MCP integration](../integrations/mcp.md) for setup guides.
|
||||
|
||||
```console
|
||||
$ docker agent mcp agent-file|registry-ref
|
||||
$ docker agent serve mcp agent-file|registry-ref
|
||||
```
|
||||
|
||||
Arguments:
|
||||
@@ -316,8 +316,8 @@ Supports [runtime flags](#runtime-flags).
|
||||
Examples:
|
||||
|
||||
```console
|
||||
$ docker agent mcp ./agent.yaml
|
||||
$ docker agent mcp docker.io/user/agent:latest
|
||||
$ docker agent serve mcp ./agent.yaml
|
||||
$ docker agent serve mcp docker.io/user/agent:latest
|
||||
```
|
||||
|
||||
### new
|
||||
|
||||
@@ -82,8 +82,8 @@ Agents can be exposed as tools in MCP clients:
|
||||
{
|
||||
"mcpServers": {
|
||||
"myagent": {
|
||||
"command": "/usr/local/bin/cagent",
|
||||
"args": ["mcp", "agentcatalog/pirate"]
|
||||
"command": "/usr/local/bin/docker",
|
||||
"args": ["agent", "serve", "mcp", "agentcatalog/pirate"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user