mcp.md

  1---
  2title: Model Context Protocol (MCP) in Zed
  3description: Install and configure MCP servers in Zed to extend your AI agent with external tools, data sources, and integrations.
  4---
  5
  6# Model Context Protocol
  7
  8Zed uses the [Model Context Protocol](https://modelcontextprotocol.io/) to interact with context servers.
  9
 10> 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.
 11
 12## Supported Features
 13
 14Zed 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.
 15We welcome contributions that help advance Zed's MCP feature coverage (Discovery, Sampling, Elicitation, etc).
 16
 17Zed 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.
 18
 19## Installing MCP Servers
 20
 21### As Extensions
 22
 23One of the ways you can use MCP servers in Zed is by exposing them as an extension.
 24Check out the [MCP Server Extensions](../extensions/mcp-extensions.md) page to learn how to create your own.
 25
 26Many MCP servers are available as extensions. Find them via:
 27
 281. [the Zed website](https://zed.dev/extensions?filter=context-servers)
 292. in the app, open the Command Palette and run the `zed: extensions` action
 303. in the app, go to the Agent Panel's top-right menu and look for the "View Server Extensions" menu item
 31
 32Popular servers:
 33
 34- [Context7](https://zed.dev/extensions/context7-mcp-server)
 35- [GitHub](https://zed.dev/extensions/github-mcp-server)
 36- [Puppeteer](https://zed.dev/extensions/puppeteer-mcp-server)
 37- [Gem](https://zed.dev/extensions/gem)
 38- [Brave Search](https://zed.dev/extensions/brave-search-mcp-server)
 39- [Prisma](https://github.com/aqrln/prisma-mcp-zed)
 40- [Framelink Figma](https://zed.dev/extensions/framelink-figma-mcp-server)
 41- [Linear](https://zed.dev/extensions/linear-mcp-server)
 42- [Resend](https://zed.dev/extensions/resend-mcp-server)
 43
 44### As Custom Servers
 45
 46Creating an extension is not the only way to use MCP servers in Zed.
 47You can connect them by adding their commands directly to your `settings.json`, like so:
 48
 49```json [settings]
 50{
 51  "context_servers": {
 52    "local-mcp-server": {
 53      "command": "some-command",
 54      "args": ["arg-1", "arg-2"],
 55      "env": {}
 56    },
 57    "remote-mcp-server": {
 58      "url": "custom",
 59      "headers": { "Authorization": "Bearer <token>" }
 60    }
 61  }
 62}
 63```
 64
 65Alternatively, you can also add a custom server by accessing the Agent Panel's Settings view (also accessible via the `agent: open settings` action).
 66From there, you can add it through the modal that appears when you click the "Add Custom Server" button.
 67
 68## Using MCP Servers
 69
 70### Configuration Check
 71
 72Most MCP servers require configuration after installation.
 73
 74In the case of extensions, after installing it, Zed will pop up a modal displaying what is required for you to properly set it up.
 75For 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).
 76
 77In 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.
 78
 79To 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.
 80If they're running correctly, the indicator will be green and its tooltip will say "Server is active".
 81If not, other colors and tooltip messages will indicate what is happening.
 82
 83### Agent Panel Usage
 84
 85Once installation is complete, you can return to the Agent Panel and start prompting.
 86
 87Model support for MCP tools varies. Mentioning your server by name in prompts helps the model select the right tools.
 88
 89However, 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.
 90
 91As 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):
 92
 93```json [settings]
 94"agent": {
 95  "profiles": {
 96    "container-use": {
 97      "name": "Container Use",
 98      "tools": {
 99        "fetch": true,
100        "thinking": true,
101        "copy_path": false,
102        "find_path": false,
103        "delete_path": false,
104        "create_directory": false,
105        "list_directory": false,
106        "diagnostics": false,
107        "read_file": false,
108        "open": false,
109        "move_path": false,
110        "grep": false,
111        "edit_file": false,
112        "terminal": false
113      },
114      "enable_all_context_servers": false,
115      "context_servers": {
116        "container-use": {
117          "tools": {
118            "environment_create": true,
119            "environment_add_service": true,
120            "environment_update": true,
121            "environment_run_cmd": true,
122            "environment_open": true,
123            "environment_file_write": true,
124            "environment_file_read": true,
125            "environment_file_list": true,
126            "environment_file_delete": true,
127            "environment_checkpoint": true
128          }
129        }
130      }
131    }
132  }
133}
134```
135
136### Tool Approval
137
138> **Note:** In Zed v0.224.0 and above, tool approval for the native Zed agent is controlled by `agent.tool_permissions.default`.
139
140Zed's Agent Panel provides the `agent.tool_permissions.default` setting to control tool approval behavior for the native Zed agent:
141
142- `"confirm"` (default) — Prompts for approval before running any tool action, including MCP tool calls
143- `"allow"` — Auto-approves tool actions without prompting
144- `"deny"` — Blocks all tool actions
145
146You can change this in either your `settings.json` or through the Agent Panel settings.
147
148Even 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.
149
150For 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.
151
152See [Per-tool Permission Rules](./agent-settings.md#per-tool-permission-rules) and [Tool Permissions](./tool-permissions.md) for complete details.
153
154> **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.
155
156### External Agents
157
158Note 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.
159
160Regarding the built-in ones, Claude Code and Codex both support it, and Gemini CLI does not yet.
161In 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).