Skip to content

Commit ad4ccae

Browse files
committed
add some more mcp bits to readme
also removed now obsolete references to the --provider param and specified how --model should be used closes #76 Signed-off-by: Christopher Petito <chrisjpetito@gmail.com>
1 parent 37430cf commit ad4ccae

2 files changed

Lines changed: 103 additions & 71 deletions

File tree

README.md

Lines changed: 70 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,61 @@ agents:
3535
3636
Run it in a terminal with `cagent run basic_agent.yaml`.
3737

38-
Many examples can be found [here](/examples/README.md)!
38+
Many more examples can be found [here](/examples/README.md)!
39+
40+
### Improving an agent with MCP tools
41+
42+
`cagent` supports MCP servers, enabling agents to use a wide variety of external tools and services.
43+
44+
It supports three transport types: `stdio`, `http` and `sse`.
45+
46+
Giving an agent access to tools via MCP is a quick way to greatly improve its capabilities, the quality of its results and its general useful-ness.
47+
48+
Get started quickly with the [Docker MCP Toolkit](https://docs.docker.com/ai/mcp-catalog-and-toolkit/toolkit/) and [catalog](https://docs.docker.com/ai/mcp-catalog-and-toolkit/catalog/)
49+
50+
Here, we're giving the same basic agent from the example above access to a **containerized** `duckduckgo` mcp server and it's tools by using Docker's MCP Gateway:
51+
52+
```yaml
53+
agents:
54+
root:
55+
model: openai/gpt-5-mini
56+
description: A helpful AI assistant
57+
instruction: |
58+
You are a knowledgeable assistant that helps users with various tasks.
59+
Be helpful, accurate, and concise in your responses.
60+
toolset:
61+
- type: mcp
62+
command: docker # stdio transport
63+
args: ["mcp", "gateway", "run", "--servers=duckduckgo"]
64+
```
65+
66+
When using a containerized server via the Docker MCP gateway, you can configure any required settings/secrets/authentication using the [Docker MCP Toolkit](https://docs.docker.com/ai/mcp-catalog-and-toolkit/toolkit/#example-use-the-github-official-mcp-server) in Docker Desktop.
67+
68+
Aside from the containerized MCP severs the Docker MCP Gateway provides, any standard MCP server can be used with cagent!
69+
70+
Here's an example similar to the above but adding `read_file` and `write_file` tools from the `rust-mcp-filesystem` MCP server:
71+
72+
```yaml
73+
agents:
74+
root:
75+
model: openai/gpt-5-mini
76+
description: A helpful AI assistant
77+
instruction: |
78+
You are a knowledgeable assistant that helps users with various tasks.
79+
Be helpful, accurate, and concise in your responses. Write your search results to disk.
80+
toolset:
81+
- type: mcp
82+
command: docker
83+
args: ["mcp", "gateway", "run", "--servers=duckduckgo"]
84+
- type: mcp
85+
command: rust-mcp-filesystem # installed with `cargo install rust-mcp-filesystem`
86+
args: ["--allow-write", "."]
87+
tools: ["read_file", "write_file"] # Optional: specific tools only
88+
env:
89+
- "RUST_LOG=debug"
90+
```
91+
92+
See [the USAGE docs](./docs/USAGE.md#tool-configuration) for more detailed information and examples
3993
4094
### 🎯 Key Features
4195
@@ -131,52 +185,36 @@ models:
131185
132186
You'll find a curated list of agents examples, spread into 3 categories, [Basic](https://github.com/docker/cagent/tree/main/examples#basic-configurations), [Advanced](https://github.com/docker/cagent/tree/main/examples#advanced-configurations) and [multi-agents](https://github.com/docker/cagent/tree/main/examples#multi-agent-configurations) in the `/examples/` directory.
133187

134-
## MCP (Model Context Protocol)
135-
136-
`cagent` supports MCP servers, enabling agents to use a wide variety of external tools and services. It supports three transport types: `stdio`, `http` and `sse`.
137-
138-
Get started easily wtith the Docker MCP [Toolkit](https://docs.docker.com/ai/mcp-catalog-and-toolkit/toolkit/) and [catalog](https://docs.docker.com/ai/mcp-catalog-and-toolkit/catalog/).
139-
140-
```yaml
141-
toolsets:
142-
- type: mcp
143-
command: docker # stdio transport
144-
arguments: [mcp, gateway, run, "--servers=context7"]
145-
146-
- type: mcp
147-
remote:
148-
url: "https://mcp-server.example.com"
149-
transport_type: "sse" # or "streamable"
150-
headers:
151-
Authorization: "Bearer your-token-here"
152-
tools: ["search_web", "fetch_url"]
153-
```
154-
155188
## Quickly generate agents and agent teams with `cagent new`
156189

157-
Using the command `cagent new` you can quickly generate agents or multi-agent teams using a single prompt! `cagent` has a built-in agent dedicated to this task.
190+
Using the command `cagent new` you can quickly generate agents or multi-agent teams using a single prompt!
191+
`cagent` has a built-in agent dedicated to this task.
192+
193+
To use the feature, you must have an Anthropic, OpenAI or Google API key available in your environment, or specify a local model to run with DMR (Docker Model Runner).
158194

159-
To use the feature, you must have an Anthropic, OpenAI or Google API key available in your environment.
195+
You can choose what provider and model gets used by passing the `--model provider/modelname` flag to `cagent new`
160196

161-
If `--provider` is unspecified, `cagent new` will automatically choose between these 3 in order based on the first api key it finds in the environment
197+
If `--model` is unspecified, `cagent new` will automatically choose between these 3 providers in order based on the first api key it finds in your environment
162198

163199
```sh
164-
export ANTHROPIC_API_KEY=your_api_key_here # first choice
165-
export OPENAI_API_KEY=your_api_key_here # if anthropic key not set
166-
export GOOGLE_API_KEY=your_api_key_here # if anthropic and openai keys are not set
200+
export ANTHROPIC_API_KEY=your_api_key_here # first choice. default model claude-sonnet-4-0
201+
export OPENAI_API_KEY=your_api_key_here # if anthropic key not set. default model gpt-5-mini
202+
export GOOGLE_API_KEY=your_api_key_here # if anthropic and openai keys are not set. default model gemini-2.5-flash
167203
```
168204

169-
The model in use can also be overridden using `--model` (can only be used together with `--provider`)
170-
171205
Example of provider and model overriding:
172206

173207
```sh
174-
cagent new --provider openai --model gpt-5
208+
# Use GPT-5 via OpenAI
209+
cagent new --model openai/gpt-5
210+
211+
# Use a local model (ai/gemma3-qat:12B) via DMR
212+
cagent new --model dmr/ai/gemma3-qat:12B
175213
```
176214

177215
---
178216

179-
```sh
217+
```
180218
$ cagent new
181219

182220
------- Welcome to cagent! -------
@@ -245,7 +283,3 @@ improvements to the code. It can also fix issues and implement new features!
245283

246284
We’d love to hear your thoughts on this project.
247285
You can find us on [Slack](https://dockercommunity.slack.com/archives/C09DASHHRU4)
248-
249-
```
250-
251-
```

docs/USAGE.md

Lines changed: 33 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,6 @@ agents:
184184

185185
### Tool Configuration
186186

187-
188187
### Available MCP Tools
189188

190189
Common MCP tools include:
@@ -198,20 +197,6 @@ Common MCP tools include:
198197
- **Code**: Programming language specific tools
199198
- **API**: REST API integration tools
200199

201-
### Installing MCP Tools
202-
203-
Example installation of local tools:
204-
205-
```bash
206-
# Install Rust-based MCP filesystem tool
207-
cargo install rust-mcp-filesystem
208-
209-
# Install other popular MCP tools
210-
npm install -g @modelcontextprotocol/server-filesystem
211-
npm install -g @modelcontextprotocol/server-git
212-
npm install -g @modelcontextprotocol/server-web
213-
```
214-
215200
### Configuring MCP Tools
216201

217202
**Local (stdio) MCP Server:**
@@ -265,6 +250,39 @@ toolsets:
265250
tools: ["search_web", "fetch_url"]
266251
```
267252

253+
### Using tools via the Docker MCP Gateway
254+
255+
We recommend using MCP tools via the [Docker MCP Gateway](https://github.com/docker/mcp-gateway).
256+
All tools are containerized for resource isolation and security, and all the tools in the catalog can be accessed through a single endpoint
257+
258+
Using the `docker mcp gateway` command you can configure your agents with a set of MCP tools
259+
delivered straight from Docker's MCP Gateway.
260+
261+
> you can check `docker mcp gateway run --help` for more information on how to use that command
262+
263+
In this example, lets configure duckduckgo to give our agents the ability to search the web:
264+
265+
```yaml
266+
toolsets:
267+
- type: mcp
268+
command: docker
269+
args: ["mcp", "gateway", "run", "--servers=duckduckgo"]
270+
```
271+
272+
### Installing MCP Tools
273+
274+
Example installation of local tools with `cargo` or `npm`:
275+
276+
```bash
277+
# Install Rust-based MCP filesystem tool
278+
cargo install rust-mcp-filesystem
279+
280+
# Install other popular MCP tools
281+
npm install -g @modelcontextprotocol/server-filesystem
282+
npm install -g @modelcontextprotocol/server-git
283+
npm install -g @modelcontextprotocol/server-web
284+
```
285+
268286
## Built-in Tools
269287

270288
Included in `cagent` are a series of built-in tools that can greatly enhance the capabilities of your agents without needing to configure any external MCP tools.
@@ -329,26 +347,6 @@ them to delegate tasks to other agents:
329347
transfer_task(agent="developer", task="Create a login form", expected_output="HTML and CSS code")
330348
```
331349

332-
### Using tools via the Docker MCP Gateway
333-
334-
We recommend using MCP tools via the [Docker MCP Gateway](https://github.com/docker/mcp-gateway).
335-
All tools are containerized for resource isolation and security, and all the tools in the catalog can be accessed through a single endpoint
336-
337-
Using the `docker mcp gateway` command you can configure your agents with a set of MCP tools
338-
delivered straight from Docker's MCP Gateway.
339-
340-
> you can check `docker mcp gateway run --help` for more information on how to use that command
341-
342-
In this example, lets configure duckduckgo to give our agents the ability to search the web:
343-
344-
```yaml
345-
toolsets:
346-
- type: mcp
347-
command: docker
348-
args: ["mcp", "gateway", "run", "--servers=duckduckgo"]
349-
```
350-
351-
352350
## Examples
353351

354352
### Development Team

0 commit comments

Comments
 (0)