Model Context Protocol
Zed uses the Model Context Protocol to interact with context servers.
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.
Supported Features
Zed currently supports MCP's Tools and Prompts features. We welcome contributions that help advance Zed's MCP feature coverage (Discovery, Sampling, Elicitation, etc).
Zed 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.
Installing MCP Servers
As Extensions
One of the ways you can use MCP servers in Zed is by exposing them as an extension. Check out the MCP Server Extensions page to learn how to create your own.
Many MCP servers are available as extensions. Find them via:
- the Zed website
- in the app, open the Command Palette and run the
zed: extensionsaction - in the app, go to the Agent Panel's top-right menu and look for the "View Server Extensions" menu item
Popular servers:
As Custom Servers
Creating an extension is not the only way to use MCP servers in Zed.
You can connect them by adding their commands directly to your settings.json, like so:
{
"context_servers": {
"local-mcp-server": {
"command": "some-command",
"args": ["arg-1", "arg-2"],
"env": {}
},
"remote-mcp-server": {
"url": "custom",
"headers": { "Authorization": "Bearer <token>" }
}
}
}
Alternatively, you can also add a custom server by accessing the Agent Panel's Settings view (also accessible via the agent: open settings action).
From there, you can add it through the modal that appears when you click the "Add Custom Server" button.
Using MCP Servers
Configuration Check
Most MCP servers require configuration after installation.
In the case of extensions, after installing it, Zed will pop up a modal displaying what is required for you to properly set it up. For example, the GitHub MCP extension requires you to add a Personal Access Token.
In 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.
To 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. If they're running correctly, the indicator will be green and its tooltip will say "Server is active". If not, other colors and tooltip messages will indicate what is happening.
Agent Panel Usage
Once installation is complete, you can return to the Agent Panel and start prompting.
Model support for MCP tools varies. Mentioning your server by name in prompts helps the model select the right tools.
However, if you want to ensure a given MCP server will be used, you can create a custom profile 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.
As an example, the Dagger team suggests doing that with their Container Use MCP server:
"agent": {
"profiles": {
"container-use": {
"name": "Container Use",
"tools": {
"fetch": true,
"thinking": true,
"copy_path": false,
"find_path": false,
"delete_path": false,
"create_directory": false,
"list_directory": false,
"diagnostics": false,
"read_file": false,
"open": false,
"move_path": false,
"grep": false,
"edit_file": false,
"terminal": false
},
"enable_all_context_servers": false,
"context_servers": {
"container-use": {
"tools": {
"environment_create": true,
"environment_add_service": true,
"environment_update": true,
"environment_run_cmd": true,
"environment_open": true,
"environment_file_write": true,
"environment_file_read": true,
"environment_file_list": true,
"environment_file_delete": true,
"environment_checkpoint": true
}
}
}
}
}
}
Tool Approval
Note: In Zed v0.224.0 and above, tool approval for the native Zed agent is controlled by
agent.tool_permissions.default.
Zed's Agent Panel provides the agent.tool_permissions.default setting to control tool approval behavior for the native Zed agent:
"confirm"(default) — Prompts for approval before running any tool action, including MCP tool calls"allow"— Auto-approves tool actions without prompting"deny"— Blocks all tool actions
You can change this in either your settings.json or through the Agent Panel settings.
Even 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.
For 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.
See Per-tool Permission Rules and Tool Permissions for complete details.
Note: Before Zed v0.224.0, tool approval was controlled by the
agent.always_allow_tool_actionsboolean (defaultfalse). Set it totrueto auto-approve tool actions, or leave itfalseto require confirmation for edits and MCP tool calls.
External Agents
Note that for external agents connected through the Agent Client Protocol, access to MCP servers installed from Zed may vary depending on the ACP agent implementation.
Regarding the built-in ones, Claude Code and Codex both support it, and Gemini CLI does not yet. In the meantime, learn how to add MCP server support to Gemini CLI through their documentation.