mcp.md

  1# Model Context Protocol
  2
  3Zed uses the [Model Context Protocol](https://modelcontextprotocol.io/) to interact with context servers.
  4
  5> The Model Context Protocol (MCP) is an open protocol that enables seamless integration between LLM applications and external data sources and tools. Whether you're building an AI-powered IDE, enhancing a chat interface, or creating custom AI workflows, MCP provides a standardized way to connect LLMs with the context they need.
  6
  7## Supported Features
  8
  9Zed currently supports MCP's [Tools](https://modelcontextprotocol.io/specification/2025-11-25/server/tools) and [Prompts](https://modelcontextprotocol.io/specification/2025-11-25/server/prompts) features.
 10We welcome contributions that help advance Zed's MCP feature coverage (Discovery, Sampling, Elicitation, etc).
 11
 12Zed also handles the `notifications/tools/list_changed` notification from MCP servers. When a server adds, removes, or modifies its available tools at runtime, Zed automatically reloads the tool list without requiring a server restart.
 13
 14## Installing MCP Servers
 15
 16### As Extensions
 17
 18One of the ways you can use MCP servers in Zed is by exposing them as an extension.
 19Check out the [MCP Server Extensions](../extensions/mcp-extensions.md) page to learn how to create your own.
 20
 21Many MCP servers are available as extensions. Find them via:
 22
 231. [the Zed website](https://zed.dev/extensions?filter=context-servers)
 242. in the app, open the Command Palette and run the `zed: extensions` action
 253. in the app, go to the Agent Panel's top-right menu and look for the "View Server Extensions" menu item
 26
 27Popular servers:
 28
 29- [Context7](https://zed.dev/extensions/context7-mcp-server)
 30- [GitHub](https://zed.dev/extensions/github-mcp-server)
 31- [Puppeteer](https://zed.dev/extensions/puppeteer-mcp-server)
 32- [Gem](https://zed.dev/extensions/gem)
 33- [Brave Search](https://zed.dev/extensions/brave-search-mcp-server)
 34- [Prisma](https://github.com/aqrln/prisma-mcp-zed)
 35- [Framelink Figma](https://zed.dev/extensions/framelink-figma-mcp-server)
 36- [Linear](https://zed.dev/extensions/linear-mcp-server)
 37- [Resend](https://zed.dev/extensions/resend-mcp-server)
 38
 39### As Custom Servers
 40
 41Creating an extension is not the only way to use MCP servers in Zed.
 42You can connect them by adding their commands directly to your `settings.json`, like so:
 43
 44```json [settings]
 45{
 46  "context_servers": {
 47    "local-mcp-server": {
 48      "command": "some-command",
 49      "args": ["arg-1", "arg-2"],
 50      "env": {}
 51    },
 52    "remote-mcp-server": {
 53      "url": "custom",
 54      "headers": { "Authorization": "Bearer <token>" }
 55    }
 56  }
 57}
 58```
 59
 60Alternatively, you can also add a custom server by accessing the Agent Panel's Settings view (also accessible via the `agent: open settings` action).
 61From there, you can add it through the modal that appears when you click the "Add Custom Server" button.
 62
 63## Using MCP Servers
 64
 65### Configuration Check
 66
 67Most MCP servers require configuration after installation.
 68
 69In the case of extensions, after installing it, Zed will pop up a modal displaying what is required for you to properly set it up.
 70For example, the GitHub MCP extension requires you to add a [Personal Access Token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens).
 71
 72In the case of custom servers, make sure you check the provider documentation to determine what type of command, arguments, and environment variables need to be added to the JSON.
 73
 74To check if your MCP server is properly configured, go to the Agent Panel's settings view and watch the indicator dot next to its name.
 75If they're running correctly, the indicator will be green and its tooltip will say "Server is active".
 76If not, other colors and tooltip messages will indicate what is happening.
 77
 78### Agent Panel Usage
 79
 80Once installation is complete, you can return to the Agent Panel and start prompting.
 81
 82Model support for MCP tools varies. Mentioning your server by name in prompts helps the model select the right tools.
 83
 84However, if you want to _ensure_ a given MCP server will be used, you can create [a custom profile](./agent-panel.md#custom-profiles) where all built-in tools (or the ones that could cause conflicts with the server's tools) are turned off and only the tools coming from the MCP server are turned on.
 85
 86As an example, [the Dagger team suggests](https://container-use.com/agent-integrations#zed) doing that with their [Container Use MCP server](https://zed.dev/extensions/mcp-server-container-use):
 87
 88```json [settings]
 89"agent": {
 90  "profiles": {
 91    "container-use": {
 92      "name": "Container Use",
 93      "tools": {
 94        "fetch": true,
 95        "thinking": true,
 96        "copy_path": false,
 97        "find_path": false,
 98        "delete_path": false,
 99        "create_directory": false,
100        "list_directory": false,
101        "diagnostics": false,
102        "read_file": false,
103        "open": false,
104        "move_path": false,
105        "grep": false,
106        "edit_file": false,
107        "terminal": false
108      },
109      "enable_all_context_servers": false,
110      "context_servers": {
111        "container-use": {
112          "tools": {
113            "environment_create": true,
114            "environment_add_service": true,
115            "environment_update": true,
116            "environment_run_cmd": true,
117            "environment_open": true,
118            "environment_file_write": true,
119            "environment_file_read": true,
120            "environment_file_list": true,
121            "environment_file_delete": true,
122            "environment_checkpoint": true
123          }
124        }
125      }
126    }
127  }
128}
129```
130
131### Tool Approval
132
133> **Note:** In Zed v0.224.0 and above, tool approval for the native Zed agent is controlled by `agent.tool_permissions.default`.
134
135Zed's Agent Panel provides the `agent.tool_permissions.default` setting to control tool approval behavior for the native Zed agent:
136
137- `"confirm"` (default) — Prompts for approval before running any tool action, including MCP tool calls
138- `"allow"` — Auto-approves tool actions without prompting
139- `"deny"` — Blocks all tool actions
140
141You can change this in either your `settings.json` or through the Agent Panel settings.
142
143Even with `"default": "allow"`, per-tool `always_deny` and `always_confirm` patterns are still respected, so you can auto-approve most actions while still blocking or gating sensitive ones.
144
145For granular control over specific MCP tools, you can configure per-tool permission rules. MCP tools use the key format `mcp:<server>:<tool_name>` — for example, `mcp:github:create_issue`. The `default` key on a per-tool entry is the primary mechanism for MCP tools, since pattern-based rules match against an empty string for MCP tools and most patterns won't match.
146
147See [Per-tool Permission Rules](./agent-settings.md#per-tool-permission-rules) and [Tool Permissions](./tool-permissions.md) for complete details.
148
149> **Note:** Before Zed v0.224.0, tool approval was controlled by the `agent.always_allow_tool_actions` boolean (default `false`). Set it to `true` to auto-approve tool actions, or leave it `false` to require confirmation for edits and MCP tool calls.
150
151### External Agents
152
153Note that for [external agents](./external-agents.md) connected through the [Agent Client Protocol](https://agentclientprotocol.com/), access to MCP servers installed from Zed may vary depending on the ACP agent implementation.
154
155Regarding the built-in ones, Claude Code and Codex both support it, and Gemini CLI does not yet.
156In the meantime, learn how to add MCP server support to Gemini CLI through [their documentation](https://github.com/google-gemini/gemini-cli?tab=readme-ov-file#using-mcp-servers).