Skip to content

Commit 0274352

Browse files
touchups & add MCP Gateway feature
Signed-off-by: Craig <craig.osterhout@docker.com>
1 parent 2cfe0dc commit 0274352

File tree

1 file changed

+40
-37
lines changed

1 file changed

+40
-37
lines changed

content/guides/agentic-ai.md

Lines changed: 40 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ shows how Docker ties them all together with the following tools:
4545
Toolkit](../manuals/ai/mcp-catalog-and-toolkit/_index.md) helps you discover
4646
and securely run external tools, like APIs and databases, using the Model
4747
Context Protocol (MCP).
48+
- [Docker MCP Gateway](/manuals/ai/mcp-gateway/_index.md) lets you orchestrate and manage MCP servers.
4849
- [Docker Cloud](/cloud/) provides a powerful, GPU-accelerated
4950
environment to run your AI applications with the same Compose-based
5051
workflow you use locally.
@@ -112,18 +113,18 @@ To run the application in Docker Cloud, follow these steps:
112113
and run it.
113114

114115
4. Visit [http://localhost:8080](http://localhost:8080). Enter something in the
115-
prompt and hit enter. An agent searches DuckDuckGo and another agent revises the
116-
output.
116+
prompt and hit enter. An agent searches DuckDuckGo and another agent revises
117+
the output.
117118

118-
![Screenshot of the application](./images/agentic-ai-app.png)
119+
![Screenshot of the application](./images/agentic-ai-app.png)
119120

120121
5. Press ctrl-c in the terminal to stop the application when you're done.
121122

122123
6. Run the following command to stop Docker Cloud:
123124

124-
```console
125-
$ docker cloud stop
126-
```
125+
```console
126+
$ docker cloud stop
127+
```
127128

128129
## Step 3: Optional. Run the application locally
129130

@@ -175,37 +176,40 @@ instructions below to help you understand each line.
175176
services:
176177
adk:
177178
build:
178-
context: . # Build from the current directory
179-
dockerfile: Dockerfile # Use the specified Dockerfile
179+
context: .
180180
ports:
181-
- "8080:8080" # Map host port 8080 to container port 8080
181+
# expose port for web interface
182+
- "8080:8080"
182183
environment:
183-
- MCPGATEWAY_ENDPOINT=http://mcp-gateway:8811/sse # Tell the app where to find the MCP gateway
184-
command: ["web"] # Start the ADK web interface
185-
extra_hosts:
186-
- host.docker.internal:host-gateway # Allow container to reach the host machine
184+
# point adk at the MCP gateway
185+
- MCPGATEWAY_ENDPOINT=http://mcp-gateway:8811/sse
187186
depends_on:
188-
- docker-model-runner # Ensure model service starts before this
189-
- mcp-gateway # Ensure gateway service starts before this
187+
# model_runner provider starts first then injects environment variables
188+
# MODEL_RUNNER_MODEL name
189+
# MODEL_RUNNER_URL OpenAI compatible API endpoint
190+
- model_runner
190191

191-
docker-model-runner:
192+
model_runner:
192193
provider:
193-
type: model # Use Docker Model Runner to serve a model
194+
type: model
194195
options:
195-
model: ai/gemma3-qat:27B-Q4_K_M # Specify the model to run (27B Gemma3 QAT)
196-
environment:
197-
- LLAMA_ARGS=--ctx-size 20000 --jinja -ngl 100 # Runtime options for the model engine
196+
# pre-pull the model when starting Docker Model Runner
197+
model: ai/gemma3-qat:27B-Q4_K_M
198+
# increase context size to handle search results
199+
context-size: 20000
198200

199201
mcp-gateway:
200-
image: docker/agents_gateway:v2 # Run Docker's MCP gateway service
202+
# agents_gateway secures your MCP servers
203+
image: docker/agents_gateway:v2
201204
ports:
202-
- "8811:8811" # Expose the gateway on port 8811
205+
- "8811:8811"
203206
command:
204-
- --transport=sse # Use SSE (Server-Sent Events) for agent communication
205-
- --servers=duckduckgo # Enable DuckDuckGo tool server for web search
207+
- --transport=sse
208+
# add any MCP servers you want to use
209+
- --servers=duckduckgo
206210
volumes:
207-
- /var/run/docker.sock:/var/run/docker.sock # Allow gateway to interact with Docker on host
208-
211+
# mount docker socket to run MCP containers
212+
- /var/run/docker.sock:/var/run/docker.sock
209213
```
210214
211215
The first notable element here is the `provider` section that specifies `type:
@@ -221,10 +225,11 @@ The `options` section defines the specific model to run, in this case,
221225
The second notable element is `image: docker/agents_gateway:v2`, which indicates
222226
that the MCP gateway service will use the [docker/agents_gateway:v2
223227
image](https://hub.docker.com/r/docker/agents_gateway). This image is Docker's
224-
[open source MCP gateway](https://github.com/docker/docker-mcp/) that enables your application to connect to MCP servers,
225-
which expose tools that models can call. In this example, it uses the
226-
[`duckduckgo` MCP server](https://hub.docker.com/mcp/server/duckduckgo/overview)
227-
to perform web searches.
228+
open source [MCP Gateway](https://github.com/docker/docker-mcp/) that enables
229+
your application to connect to MCP servers, which expose tools that models can
230+
call. In this example, it uses the [`duckduckgo` MCP
231+
server](https://hub.docker.com/mcp/server/duckduckgo/overview) to perform web
232+
searches.
228233

229234
> [!TIP]
230235
>
@@ -237,13 +242,6 @@ external tools and services using the Model Context Protocol.
237242

238243
## Step 5: Review the application
239244

240-
The `adk` web application is an agent implementation that connects to the MCP
241-
gateway and a local model through environment variables and API calls. It uses
242-
the [ADK (Agent Development Kit)](https://github.com/google/adk-python) to
243-
define two agents that evaluate responses, verify claims, and revise answers.
244-
These agents load a language model (served via Docker Model Runner) and connect
245-
to external tools using the Model Context Protocol (MCP).
246-
247245
The `adk` web application is an agent implementation that connects to the MCP
248246
gateway and a local model through environment variables and API calls. It uses
249247
the [ADK (Agent Development Kit)](https://github.com/google/adk-python) to
@@ -301,6 +299,11 @@ suite of tools:
301299
- [Docker MCP Catalog and
302300
Toolkit](../manuals/ai/mcp-catalog-and-toolkit/_index.md): Launch and manage
303301
tool integrations that follow the Model Context Protocol (MCP) standard.
302+
- [Docker MCP Gateway](/manuals/ai/mcp-gateway/_index.md): Orchestrate and manage
303+
MCP servers to connect agents to external tools and services.
304+
- [Docker Compose](../manuals/compose/_index.md): Define and run multi-container
305+
applications with a single file, using the same workflow locally and in the
306+
cloud.
304307
- [Docker Cloud](/cloud/): Deploy and scale your application
305308
in a secure, managed cloud environment.
306309

0 commit comments

Comments
 (0)