Guide · IDE Integration

MCP server in Zed editor

Zed's built-in AI assistant supports MCP servers via the context_servers configuration key in settings.json. Once configured, Zed sends initialize and tools/list on startup, and the discovered tools are available in the assistant panel for the LLM to call during conversations. This guide covers the context_servers format for HTTP and stdio transports, project-level overrides, environment variable injection, debugging in the Zed log panel, and the key behavioral differences between Zed's MCP client and Claude Desktop or VS Code.

TL;DR

Open Zed settings (Cmd+, / Ctrl+,) and add a "context_servers" key with your MCP server configuration. Zed reads the configuration on launch and makes discovered tools available in the AI assistant panel (open with Cmd+?). For HTTP servers, set "url"; for stdio servers, set "command" and "args". Use AliveMCP to monitor your server — when it goes down, Zed silently stops offering tools with no visible error for the user.

context_servers configuration format

Add context_servers to Zed's global settings.json (open with Zed → Settings → Open Settings) or to a project's .zed/settings.json for project-scoped servers:

// ~/.config/zed/settings.json — global Zed settings
{
  "context_servers": {
    "my-api-server": {
      "source": {
        "type": "url",
        "url": "https://api.example.com/mcp"
      },
      "settings": {
        "api_key": "${MY_API_KEY}"
      }
    },
    "local-dev-tools": {
      "source": {
        "type": "url",
        "url": "http://localhost:3000/mcp"
      }
    },
    "stdio-tools": {
      "source": {
        "type": "binary",
        "command": "node",
        "args": ["/path/to/server/dist/index.js"]
      },
      "settings": {}
    }
  }
}

The context_servers key uses a named-server map identical in concept to .vscode/mcp.json, but with a different schema. Each server entry has two fields:

FieldRequiredDescription
sourceYesTransport configuration — type: "url" for HTTP/SSE, type: "binary" for stdio subprocess
settingsNoArbitrary key-value pairs passed to the server's initialize request under clientInfo.settings; your server can use these for per-connection configuration

Zed loads context_servers at startup. To reload after editing settings, use Zed: Reload Extensions from the command palette or restart Zed.

HTTP transport configuration

For HTTP servers (including locally hosted development servers), use "type": "url":

"context_servers": {
  "project-tools": {
    "source": {
      "type": "url",
      "url": "https://mcp.myproject.example.com/mcp"
    },
    "settings": {
      "workspace_id": "proj-alpha",
      "environment": "production"
    }
  },
  "staging-tools": {
    "source": {
      "type": "url",
      "url": "https://staging.mcp.myproject.example.com/mcp"
    },
    "settings": {
      "workspace_id": "proj-alpha",
      "environment": "staging"
    }
  }
}

Zed connects to the URL using the MCP Streamable HTTP transport. It sends initialize via HTTP POST, then establishes a GET connection for server-sent events. If your server does not implement the SSE GET endpoint, Zed falls back to polling-based message retrieval. Implement both POST and GET endpoints for full compatibility.

Authentication headers are not natively configurable in Zed's context_servers schema (unlike VS Code's headers field). The recommended approach for authenticated HTTP MCP servers in Zed:

  1. Expose the server on localhost via a local stdio proxy that handles authentication and forwards to the remote HTTP server
  2. Use an environment variable in the server process for the API key and read it at request time (process.env.MCP_API_KEY)
  3. For team-shared servers, use IP allowlist or mTLS rather than bearer token authentication to avoid per-developer key management

Stdio transport configuration

For locally running MCP servers launched as subprocesses, use "type": "binary":

"context_servers": {
  "local-search": {
    "source": {
      "type": "binary",
      "command": "node",
      "args": [
        "/Users/dev/projects/search-mcp/dist/index.js",
        "--index", "/Users/dev/search-index"
      ]
    },
    "settings": {
      "max_results": 20
    }
  },
  "python-tools": {
    "source": {
      "type": "binary",
      "command": "/Users/dev/.pyenv/versions/3.12.0/bin/python",
      "args": ["-m", "my_mcp_server"],
      "env": {
        "DATABASE_URL": "postgres://localhost:5432/dev",
        "LOG_LEVEL": "debug"
      }
    }
  }
}

Note: the env key under source for binary-type servers is available in newer Zed versions. For older versions, environment variables must be set at the system level (via .zshrc / .bashrc) because Zed launches stdio subprocesses inheriting its own environment, which on macOS includes the GUI application environment rather than the shell environment. If your stdio MCP server needs shell-defined environment variables, launch Zed from the terminal (zed .) rather than from Spotlight or Dock, or use a wrapper script that sets environment variables explicitly:

#!/bin/bash
# /usr/local/bin/my-mcp-launcher
export DATABASE_URL="postgres://localhost:5432/dev"
export API_KEY="$(cat ~/.secrets/my-api-key)"
exec node /path/to/my-mcp-server/dist/index.js "$@"
"context_servers": {
  "my-server": {
    "source": {
      "type": "binary",
      "command": "/usr/local/bin/my-mcp-launcher"
    }
  }
}

Tools in the Zed AI assistant panel

After Zed connects to a configured MCP server, discovered tools appear in the assistant panel. Open the assistant with Cmd+? (macOS) or Ctrl+? (Linux/Windows). A tools indicator in the panel header shows how many tools are available from connected servers.

Unlike VS Code (which requires the user to switch to "agent mode" to access MCP tools), Zed's assistant is always in tool-capable mode when context servers are connected. The LLM decides whether to call a tool based on your message — you do not need to switch modes or explicitly invoke tools.

Zed's tool invocation flow:

  1. You send a message to the assistant
  2. Zed includes all registered tool schemas in the system prompt sent to the LLM
  3. The LLM returns a response that includes a tool call (if appropriate)
  4. Zed shows the proposed tool call in the chat with an inline approval prompt
  5. You click Run to execute the tool call
  6. The tool result is appended to the conversation and the LLM generates its final response

Zed's approval step is similar to VS Code's: the developer must explicitly allow each tool call. Unlike VS Code, Zed does not have a "always allow" persistent permission for MCP tools — each session starts fresh. This is a security-conscious design choice that prevents a malicious workspace settings file from permanently granting a tool the ability to run without prompt.

Project-level context server configuration

Zed supports project-level settings in .zed/settings.json at the workspace root. Project-level context servers merge with global context servers — if the same server name appears in both, the project setting overrides the global one:

// .zed/settings.json — project-specific context servers
{
  "context_servers": {
    "project-specific-tools": {
      "source": {
        "type": "url",
        "url": "http://localhost:4000/mcp"
      },
      "settings": {
        "project_root": "/path/to/project",
        "schema_version": "2"
      }
    }
  }
}

Project-level .zed/settings.json is typically committed to git — it's the Zed equivalent of VS Code's .vscode/mcp.json. For team use, avoid putting secrets in this file. Unlike VS Code, Zed does not have a built-in input variable substitution mechanism for context servers — use environment variables via wrapper scripts or a local credential management tool instead.

Debugging MCP connections in Zed

Zed logs MCP protocol activity to its application log file. Access it via View → Debug → Open Log File (or search for "Log" in the command palette). The log includes the full JSON-RPC exchange for all context server connections:

[2026-06-26T14:23:01Z INFO] ContextServer "project-tools": connecting to http://localhost:4000/mcp
[2026-06-26T14:23:01Z DEBUG] → {"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","clientInfo":{"name":"Zed","version":"0.148.0"},"capabilities":{"tools":{}}}}
[2026-06-26T14:23:01Z DEBUG] ← {"jsonrpc":"2.0","id":1,"result":{"protocolVersion":"2024-11-05","serverInfo":{"name":"project-tools","version":"1.0.0"},"capabilities":{"tools":{}}}}
[2026-06-26T14:23:01Z DEBUG] → {"jsonrpc":"2.0","id":2,"method":"tools/list"}
[2026-06-26T14:23:01Z DEBUG] ← {"jsonrpc":"2.0","id":2,"result":{"tools":[{"name":"search","description":"Search the project codebase","inputSchema":{"type":"object","properties":{"query":{"type":"string"}}}}]}}
[2026-06-26T14:23:01Z INFO] ContextServer "project-tools": connected, 1 tool(s) registered

Common failure patterns and their log signatures:

Log message patternCauseFix
connection refusedServer not running on the configured URL/portStart the server; check port number in settings
initialize timeoutServer accepts connection but hangs before responding to initializeCheck server startup logs; look for blocking operations before the MCP server is ready
tools/list returned 0 toolsTool registration failed silently; tools list is empty but server is "connected"Add error logging to your tool registration code; check server-side startup logs
binary not found (stdio)Command or path in source.command doesn't exist or isn't executableUse absolute paths; verify the binary exists with which node or similar
JSON parse error (stdio)Stdio server is writing non-JSON to stdout (e.g., a console.log debug statement)Redirect all non-MCP output to stderr; only write JSON-RPC messages to stdout

Differences from Claude Desktop and VS Code MCP clients

If your MCP server already works with Claude Desktop or VS Code, it will generally work with Zed — all three implement the same MCP protocol. However, there are a few behavioral differences to be aware of:

BehaviorClaude DesktopVS CodeZed
Transport supportstdio + HTTPstdio + HTTP + SSE (legacy)stdio + HTTP
Tool approval per-callYesYesYes
"Always allow" tool permissionNoYes (session or permanent)No
Config file location~/Library/Application Support/Claude/claude_desktop_config.json.vscode/mcp.json or settings.json~/.config/zed/settings.json or .zed/settings.json
Header injection for HTTPNot built-in (use proxy)Yes — headers field in server configNot built-in (use env vars or proxy)
Input variable substitution for secretsNoYes — ${input:…} syntaxNo (use environment variables)
Tool annotations (readOnlyHint, etc.)Reads but no UI differentiationYes — color-coded approval promptsReads but minimal UI differentiation
Server hot-reloadRestart Claude DesktopCommand Palette → MCP: Restart ServerCommand Palette → Reload Extensions

For MCP servers targeting multiple clients, test your server against Zed's MCP client specifically. The most common Zed-specific issues are: environment variable injection for stdio servers (Zed inherits GUI environment, not shell environment) and authentication headers for HTTP servers (not natively supported, requires a proxy or env-var-based approach).

Monitoring MCP servers used in Zed

When your MCP server goes down, Zed's assistant panel stops showing tools — but Zed displays no user-visible error. The tools icon in the assistant panel may still show a count from the last successful connection, or it may disappear silently. Developers notice only when they try to use a tool and it fails, or when the tool doesn't appear in the suggestion list.

AliveMCP probes your server every 60 seconds with a full protocol check — initialize + tools/list — and alerts you immediately when the handshake fails. This is especially important for project-level context servers committed in .zed/settings.json: every developer who opens the project depends on your server being available, and a team-wide outage will generate multiple confused Slack messages before anyone pinpoints the MCP server as the cause.

Frequently asked questions

Which Zed version added MCP support?

Zed added MCP context server support in version 0.140.0 (late 2024). The context_servers configuration key has been stable since then. Check your Zed version with Zed → About Zed; if it's below 0.140.0, update via Zed: Install CLI and download the latest release from zed.dev. Zed updates automatically when auto-update is enabled in settings.

Can I use MCP tools with any AI model in Zed, or only specific ones?

Zed's tool support depends on the AI provider configured in settings. Tool calls are available when using Claude models (via Anthropic's API or GitHub Copilot as a provider) and OpenAI models that support tool calling (GPT-4o and later). Older models (GPT-3.5, earlier Claude versions) do not support tool schemas in the format Zed sends. Check Zed's AI provider settings to confirm your configured model supports tool calling.

How do I configure a different MCP server for each project in Zed?

Create a .zed/settings.json file at each project root with the appropriate context_servers key. Project-level settings take precedence over global settings for the same server name. You can also use different server names across projects to avoid conflicts — Zed merges all context servers from both global and project settings, using the project's version when names collide.

My stdio MCP server works in Claude Desktop but not in Zed. What's different?

The most common cause is the environment difference: Claude Desktop on macOS sets up a shell-like environment before launching stdio servers, while Zed inherits its GUI launch environment, which lacks shell initializations from .zshrc or .bashrc. If your server depends on PATH entries set in your shell config (e.g., for node, Python, or other binaries not in /usr/bin), use absolute paths in the Zed configuration or use a wrapper shell script that explicitly sources the shell config before launching the server.

Does Zed support MCP resources (not just tools)?

Zed's MCP client implementation focuses on the tools capability. Resource access (resources/list, resources/read) is available in newer Zed versions as part of the assistant's context management, but the primary use case in Zed is tool invocation. If your MCP server registers both tools and resources, Zed will use the tools for inline tool calls and may surface resources as context options in the assistant panel depending on your Zed version.

Further reading

Know when your Zed MCP server is down — before your team does

AliveMCP probes your MCP endpoint every 60 seconds with a full protocol check, so you're alerted before developers notice tools disappearing from the Zed assistant. Free for public endpoints.

Start monitoring free