Skip to content

Commit da54a65

Browse files
committed
Add documentation for MCP usage with Gordon
Signed-off-by: Djordje Lukic <[email protected]>
1 parent 0020f7d commit da54a65

File tree

3 files changed

+149
-1
lines changed

3 files changed

+149
-1
lines changed
File renamed without changes.
Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
---
2+
title: MCP
3+
description: Best practices for using Docker Desktop with WSL 2
4+
keywords: ai, mcp, gordon
5+
---
6+
7+
8+
> **tldr:** Gordon supports containerised MCP servers, at the root of your source tree, create a `gordon-mcp.yml` which is a standard compose file, and Gordon will enrich its response leveraging the servers described in that file.
9+
>
10+
11+
## What is MCP?
12+
13+
Anthropic recently announced the [Model Context Protocol](https://www.anthropic.com/news/model-context-protocol) (MCP) specification, an open protocol that standardises how applications provide context to large language models. MCP functions as a client-server protocol, where the client (e.g., an application like Gordon) sends requests, and the server processes those requests to deliver the necessary context to the AI.
14+
15+
Gordon, along with other MCP clients like Claude Desktop, can interact with MCP servers running as containers. Docker has partnered with Anthropic to build container images for the [reference implementations](https://github.com/modelcontextprotocol/servers/) of MCP servers, available on Docker Hub under [the mcp namespace](https://hub.docker.com/u/mcp).
16+
17+
## Simple MCP server usage with Gordon
18+
19+
When you run the `docker ai` command in your terminal to ask a question, Gordon will look for a `gordon-mcp.yml` file for a list of MCP servers that should be used when in that context. The `gordon-mcp.yml` file is a Docker Compose file that configures MCP servers as Compose services for Gordon to access.
20+
21+
As a minimal example, let’s take a look at how you can use the [mcp-time server](https://hub.docker.com/r/mcp/time) to provide temporal capabilities to Gordon. (Source code and documentation is available [here](https://github.com/modelcontextprotocol/servers/tree/main/src/time)).
22+
23+
1. Create the `gordon-mcp.yml` file and add the time sever:
24+
25+
```yaml
26+
services:
27+
time:
28+
image: mcp/time
29+
```
30+
31+
2. With this file you can now ask Gordon to tell you the time in another timezone:
32+
33+
```bash
34+
$ docker ai 'what time is it now in kiribati?'
35+
36+
• Calling get_current_time
37+
38+
The current time in Kiribati (Tarawa) is 9:38 PM on January 7, 2025.
39+
40+
```
41+
42+
43+
As you can see, Gordon found the MCP time server and called its tool when needed.
44+
45+
## Advanced usage
46+
47+
Some MCP servers need access to your filesystem, or system environment variables. Docker Compose can help with this. Since `gordon-mcp.yml` is a Compose file you can add bind mounts using the regular Docker Compose syntax, which will make your filesystem resources available to the container:
48+
49+
```yaml
50+
services:
51+
fs:
52+
image: mcp/filesystem
53+
command:
54+
- /rootfs
55+
volumes:
56+
- .:/rootfs
57+
```
58+
59+
This `gordon-mcp.yml` file adds filesystem access capabilities to Gordon, since everything runs inside a container Gordon will only **have access to the directories you specify.
60+
61+
Gordon can handle any number of MCP servers, for example we can give Gordon access to the internet with the `mcp/fetch` server:
62+
63+
```yaml
64+
services:
65+
fetch:
66+
image: mcp/fetch
67+
fs:
68+
image: mcp/filesystem
69+
command:
70+
- /rootfs
71+
volumes:
72+
- .:/rootfs
73+
```
74+
75+
We can now combine these and ask things like
76+
77+
```bash
78+
$ docker ai can you fetch rumpl.dev and write the summary to a file test.txt
79+
80+
• Calling fetch ✔️
81+
• Calling write_file ✔️
82+
• Calling list_allowed_directories ✔️
83+
• Calling write_file ✔️
84+
85+
The summary of the website rumpl.dev has been successfully written to the file test.txt in the allowed directory. Let me know if you need further assistance!
86+
87+
88+
$ cat test.txt
89+
The website rumpl.dev features a variety of blog posts and articles authored by the site owner. Here's a summary of the content:
90+
91+
1. **Wasmio 2023 (March 25, 2023)**: A recap of the WasmIO 2023 conference held in Barcelona. The author shares their experience as a speaker and praises the organizers for a successful event.
92+
93+
2. **Writing a Window Manager in Rust - Part 2 (January 3, 2023)**: The second part of a series on creating a window manager in Rust. This installment focuses on enhancing the functionality to manage windows effectively.
94+
95+
3. **2022 in Review (December 29, 2022)**: A personal and professional recap of the year 2022. The author reflects on the highs and lows of the year, emphasizing professional achievements.
96+
97+
4. **Writing a Window Manager in Rust - Part 1 (December 28, 2022)**: The first part of the series on building a window manager in Rust. The author discusses setting up a Linux machine and the challenges of working with X11 and Rust.
98+
99+
5. **Add docker/docker to your dependencies (May 10, 2020)**: A guide for Go developers on how to use the Docker client library in their projects. The post includes a code snippet demonstrating the integration.
100+
101+
6. **First (October 11, 2019)**: The inaugural post on the blog, featuring a simple "Hello World" program in Go.%
102+
103+
```
104+
105+
## What’s next?
106+
107+
Now that you’ve learned how to use MCP servers with Gordon, here are a few ways you can get started:
108+
109+
- Experiment with MCP servers: Try integrating one or more of the tested MCP servers into your `gordon-mcp.yml` file and explore their capabilities.
110+
1. Explore the MCP ecosystem: Check out the [reference implementations on GitHub](https://github.com/modelcontextprotocol/servers/) or browse the [Docker Hub MCP namespace](https://hub.docker.com/u/mcp) for additional servers that might suit your needs.
111+
2. Build your own MCP server: If none of the existing servers meet your needs, or you’re curious about exploring how they work in more detial, consider developing a custom MCP server. Use the [MCP specification](https://www.anthropic.com/news/model-context-protocol) as a guide.
112+
3. Share your feedback: If you discover new servers that work well with Gordon or encounter issues with existing ones, [share your findings to help improve the ecosystem.](https://docker.qualtrics.com/jfe/form/SV_9tT3kdgXfAa6cWa)
113+
114+
With MCP support, Gordon offers powerful extensibility and flexibility to meet your specific use cases. Whether you’re adding temporal awareness, file management, or internet access, the possibilities are endless.
115+
116+
### List of known working MCP Servers
117+
118+
These are the MCP servers that we have tested successfully with Gordon
119+
120+
- `mcp/time`
121+
- `mcp/fetch`
122+
- `mcp/filesystem`
123+
- `mcp/postgres`
124+
- `mcp/git`
125+
- `mcp/sqlite`
126+
- `mcp/github`
127+
128+
### List of MCP servers we are not sure about
129+
130+
These are the MCP servers that we have not tested but should work if given the appropriate tokens
131+
132+
- `mcp/brave-search`
133+
- `mcp/gdrive`
134+
- `mcp/slack`
135+
- `mcp/google-maps`
136+
- `mcp/gitlab`
137+
- `mcp/everything`
138+
- `mcp/aws-kb-retrieval-server`
139+
- `mcp/sentry`
140+
141+
### List of MCP servers that don’t work with Gordon
142+
143+
These are the MCP servers that we know don’t work and why
144+
145+
- `mcp/sequentialthinking` - The tool description is too long
146+
- `mcp/puppeteer` - Puppeteer send back images and Gordon doesn’t know how to handle them, it only handles text responses from tools
147+
- `mcp/everart` - Everart send back images and Gordon doesn’t know how to handle them, it only handles text responses from tools
148+
- `mcp/memory` - There is no way to configure the server to use a custom path for its knowledge base

content/manuals/security/for-admins/hardened-desktop/settings-management/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Using the `admin-settings.json` file, you can:
4545
- Turn off Docker Extensions
4646
- Turn off Docker Scout SBOM indexing
4747
- Turn off beta and experimental features
48-
- Turn off Docker AI ([Ask Gordon](../../../../desktop/features/gordon.md))
48+
- Turn off Docker AI ([Ask Gordon](../../../../desktop/features/gordon/_index.md))
4949
- Turn off Docker Desktop's onboarding survey
5050
- Control whether developers can use the Docker terminal
5151
- Control the file sharing implementation for your developers on macOS

0 commit comments

Comments
 (0)