Skip to content

Commit 59356b1

Browse files
committed
Add docs for MCP support
1 parent 931e497 commit 59356b1

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed

docs/cody/capabilities/agentic-context-fetching.mdx

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,61 @@ Agentic context fetching is enabled by default for all Cody users. It uses LLM r
5959
If a user doesn't have any of these models, the agentic context fetching experience will use the model selected from the model dropdown for the final output.
6060

6161
Terminal access for Enterprise users is disabled by default. To enable it, set the `agentic-chat-cli-tool-experimental` feature flag [terminal access](#terminal-commands).
62+
63+
## MCP support
64+
65+
MCP (Model Context Protocol) tools are supported by agentic context fetching to connect to the external context. Users can configure multiple local MCP servers via their Cody's extension settings. Based on your query, agentic context will determine which MCP tools to invoke and what parameters to provide to the tools. Agentic context fetching experience will execute these tools and inject the context from the tool calls into Cody's context window.
66+
67+
### Setting up MCP tools
68+
69+
MCP is disabled by default. To enable it, add the `agentic-chat-mcp-enabled` feature flag to your Enterprise Sourcegraph instance.
70+
71+
Once MCP is enabled, there are two ways to configure an MCP server:
72+
73+
#### 1. From the editor extension UI
74+
75+
To configure an MCP server from the editor extension UI, click your profile icon in the Cody extension and select the **MCP Settings** option.
76+
77+
![mcp-via-ui](https://storage.googleapis.com/sourcegraph-assets/Docs/mcp-with-ui-2025.png)
78+
79+
Create a new server configuration and input the necessary arguments provided by the server. You can disable individual tools in the UI by clicking on them.
80+
81+
#### 2. From the editor extension settings
82+
83+
- Edit your MCP configuration settings using the `cody.mcpServers` property in your extension settings.
84+
- `settings.json` (VSCode)
85+
- `cody_settings.json` (JetBrains)
86+
- Use the following format when adding a new server
87+
88+
<Callout type= "tip">In JetBrains, you need the absolute path to the command. Use the `which` command in the terminal to find it. For example, `which npx`.</Callout>
89+
90+
```json
91+
"cody.mcpServers": {
92+
"<server_name>": {
93+
"command": "...",
94+
"args": [...],
95+
"env": {
96+
...
97+
},
98+
"disabledTools": [...]
99+
}
100+
}
101+
```
102+
103+
When you submit a query, Cody will determine whether to use any of the server's tools.
104+
105+
![mcp-via-settings](https://storage.googleapis.com/sourcegraph-assets/Docs/mcp-via-settings.png)
106+
107+
### MCP Best Practices
108+
109+
Since MCP is an open protocol and servers can be created by anyone, your mileage may vary. Tool names, descriptions, and the underlying models you have available may all affect the performance of MCP retrieval. To get the best results using your MCP servers, it's recommended the following:
110+
111+
- Read through the tools of the servers you install and their parameters. Be as explicit as possible in your queries to provide all of the information the tool needs
112+
- If you don't get the desired results on the first try, iterate on your query. It may take a couple of tries to get the results you're expecting
113+
- Choose high-quality servers. Prefer servers from official sources over third parties. Read through the code to understand how the servers you are installing work
114+
115+
### Limitations
116+
117+
- Cody currently supports only local MCP servers
118+
- MCP offers three main capabilities: Tools, Resources, and Prompts. Currently, Cody supports only Tools
119+
- Since most MCP servers require users to create their access tokens, the servers will have the same access as whatever token you provide. For example, if a user has write permissions to Jira and creates an access token with write permissions, they can use Cody to write back into Jira via MCP. It is impossible to limit write access across all MCP tools broadly. You should use tools with this consideration in mind

0 commit comments

Comments
 (0)