Skip to content

Commit 71c7760

Browse files
ArthurFlagDaniel-Kolevaevesdocker
authored
mcp OAuth and VS Code connection (docker#22904)
Co-authored-by: Daniel Kolev <[email protected]> Co-authored-by: Allie Sadler <[email protected]>
1 parent 306d516 commit 71c7760

File tree

5 files changed

+83
-11
lines changed

5 files changed

+83
-11
lines changed

.gitignore

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
**/.DS_Store
2-
**/desktop.ini
1+
.hugo_build.lock
2+
.idea/
3+
.vscode/mcp.json
34
.vscode/settings.json
45
.vscode/tasks.json
6+
**/.DS_Store
7+
**/desktop.ini
58
node_modules
6-
.hugo_build.lock
7-
resources
89
public
9-
tmp
10+
resources
1011
static/pagefind
11-
.idea/
12+
tmp

_vale/config/vocabularies/Docker/accept.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ unmanaged
163163
VMware
164164
vpnkit
165165
vSphere
166+
VSCode
166167
Wasm
167168
Windows
168169
windowsfilter
Loading
Loading

content/manuals/ai/mcp-catalog-and-toolkit/toolkit.md

Lines changed: 75 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,17 +109,16 @@ To install an MCP server:
109109
110110
To learn more about the MCP server catalog, see [Catalog](catalog.md).
111111

112-
### Example: Use the GitHub MCP server
112+
### Example: Use the **GitHub Official** MCP server
113113

114114
Imagine you want to enable Ask Gordon to interact with your GitHub account:
115115

116116
1. From the **MCP Toolkit** menu, select the **Catalog** tab and find
117117
the **GitHub Official** server and add it.
118-
2. In the server's **Config** tab, insert your token generated from
119-
your [GitHub account](https://github.com/settings/personal-access-tokens).
118+
2. In the server's **Config** tab, [connect via OAuth](#authenticate-via-oauth).
120119
3. In the **Clients** tab, ensure Gordon is connected.
121120
4. From the **Ask Gordon** menu, you can now send requests related to your
122-
GitHub account, in accordance to the tools provided by the GitHub MCP server. To test it, ask Gordon:
121+
GitHub account, in accordance to the tools provided by the GitHub Official server. To test it, ask Gordon:
123122

124123
```text
125124
What's my GitHub handle?
@@ -147,7 +146,7 @@ You can simply install these 2 MCP servers in the MCP Toolkit,
147146
and add Claude Desktop as a client:
148147

149148
1. From the **MCP Toolkit** menu, select the **Catalog** tab and find the **Puppeteer** server and add it.
150-
2. Repeat for the **GitHub** server.
149+
2. Repeat for the **GitHub Official** server.
151150
3. From the **Clients** tab, select **Connect** next to **Claude Desktop**. Restart
152151
Claude Desktop if it's running, and it can now access all the servers in the MCP Toolkit.
153152
4. Within Claude Desktop, run a test by submitting the following prompt using the Sonnet 3.5 model:
@@ -162,3 +161,74 @@ and add Claude Desktop as a client:
162161
```text
163162
Take a screenshot of docs.docker.com and then invert the colors
164163
```
164+
165+
### Example: Use Visual Studio Code as a client
166+
167+
You can interact with all your installed MCP servers in VS Code:
168+
169+
1. To enable the MCP Toolkit:
170+
171+
172+
{{< tabs group="" >}}
173+
{{< tab name="Enable globally">}}
174+
175+
1. Insert the following in your VS Code's User`settings.json`:
176+
177+
```json
178+
"mcp": {
179+
"servers": {
180+
"MCP_DOCKER": {
181+
"command": "docker",
182+
"args": [
183+
"mcp",
184+
"gateway",
185+
"run"
186+
],
187+
"type": "stdio"
188+
}
189+
}
190+
}
191+
```
192+
193+
{{< /tab >}}
194+
{{< tab name="Enable for a given project">}}
195+
196+
1. In your terminal, navigate to your project's folder.
197+
1. Run:
198+
199+
```bash
200+
docker mcp client connect vscode
201+
```
202+
203+
> [!NOTE]
204+
> This command creates a `.vscode/mcp.json` file in the current directory. We
205+
> recommend you add it to your `.gitignore` file.
206+
207+
{{< /tab >}}
208+
{{</tabs >}}
209+
210+
1. In Visual Studio Code, open a new Chat and select the **Agent** mode:
211+
212+
![Copilot mode switching](./images/copilot-mode.png)
213+
214+
1. You can also check the available MCP tools:
215+
216+
![Displaying tools in VSCode](./images/tools.png)
217+
218+
For more information about the Agent mode, see the
219+
[Visual Studio Code documentation](https://code.visualstudio.com/docs/copilot/chat/mcp-servers#_use-mcp-tools-in-agent-mode).
220+
221+
## Authenticate via OAuth
222+
223+
You can connect the MCP Toolkit to your development workflow via
224+
OAuth integration. For now, the MCP Toolkit only supports GitHub OAuth.
225+
226+
1. On https://github.com/, ensure you are signed in.
227+
1. In Docker Desktop, select **MCP Toolkit** and select the **OAuth** tab.
228+
1. In the GitHub entry, select **Authorize**. Your browser opens the GitHub authorization page.
229+
1. In the GitHub authorization page, select **Authorize Docker**. Once the authorization
230+
is successful, you are automatically redirected to Docker Desktop.
231+
1. Install the **GitHub Official** MCP server, see [Install an MCP server](#install-an-mcp-server).
232+
233+
The MCP Toolkit now has access to your GitHub account. To revoke access, select **Revoke** in the **OAuth** tab.
234+
See an example in [Use the **GitHub Official** MCP server](#example-use-the-github-official-mcp-server).

0 commit comments

Comments
 (0)