14 min read

Setting Up MCP in Zed: Complete Configuration Guide

Zed is a high-performance code editor built in Rust with native AI integration. This guide covers configuring MCP servers (called “context servers” in Zed)—from extension installation to custom server configuration and agent profiles.

Using MCP with Zed: High-Performance AI Editing

Key Takeaways

  • Zed calls MCP servers "context servers": configured in settings.json under context_servers.
  • Many MCP servers are available as Zed extensions for one-click installation.
  • Create custom agent profiles to control which tools are available in different contexts.
  • Use agent.always_allow_tool_actions to skip tool approval prompts.

What is Zed?

Zed is a next-generation code editor built from the ground up in Rust for maximum performance. Created by the team behind Atom and Tree-sitter, Zed offers native speed, real-time collaboration, and integrated AI assistance.

Zed is designed for speed—it's one of the fastest editors available, with GPU-accelerated rendering and efficient memory usage. The AI features are built-in, not bolted on.

With MCP support (via “context servers”), Zed's AI assistant can access external tools, databases, and APIs—extending its capabilities beyond the codebase.

Context Servers Overview

Zed uses the term “context servers” for MCP servers. There are three ways to add them:

MethodComplexityUse CaseDescription
ExtensionsEasyPopular, pre-packaged serversInstall MCP servers as Zed extensions from the extension gallery.
Custom CommandMediumCustom local serversConfigure local stdio servers with command, args, and environment.
Custom URLMediumRemote/cloud serversConnect to remote HTTP servers with optional headers.

Configuration Location

Context servers are configured in Zed's settings.json file:

BASH
# Open settings with:# Cmd+, (macOS) or Ctrl+, (Linux)# Or via Command Palette: "zed: open settings"# Settings location:# macOS: ~/Library/Application Support/Zed/settings.json# Linux: ~/.config/zed/settings.jsons.json

Installing via Extensions

The easiest way to add MCP servers is through Zed's extension gallery:

  1. Open the Extensions panel (Cmd+Shift+X)
  2. Search for the MCP server you want (e.g., “postgres”, “puppeteer”)
  3. Click “Install” on the extension
  4. Configure any required settings in settings.json
  5. The context server will be available in the AI panel

Popular MCP Extensions

Postgres Context Server

Database

Query and explore PostgreSQL databases

Puppeteer

Automation

Browser automation and web scraping

Fetch

Network

Make HTTP requests to external APIs

Memory

Context

Persistent memory across sessions

Tip

Extensions that provide context servers will appear in Zed's AI assistant automatically once installed. Check the extension's documentation for any required configuration.

Custom Server Configuration

For custom MCP servers not available as extensions, configure them directly in settings.json:

Basic Structure

{
  "context_servers": {
    "server-name": {
      "command": "executable",
      "args": ["arg1", "arg2"],
      "env": {
        "ENV_VAR": "value"
      }
    }
  }
}

Configuration Fields

FieldRequiredDescriptionExample
commandFor stdioCommand to run the MCP server"npx"
argsNoArguments for the command["-y", "@modelcontextprotocol/server-filesystem"]
envNoEnvironment variables{"API_KEY": "your-key"}
urlFor HTTPURL for remote MCP server"https://api.example.com/mcp"
headersNoHTTP headers for authentication{"Authorization": "Bearer token"}

Configuration Examples

Filesystem Server

Allow the AI to read and write files in specific directories:

{
  "context_servers": {
    "filesystem": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-filesystem",
        "/Users/username/projects",
        "/Users/username/documents"
      ]
    }
  }
}

GitHub Integration

{
  "context_servers": {
    "github": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_your_token_here"
      }
    }
  }
}

Remote HTTP Server

Connect to a remote MCP server:

{
  "context_servers": {
    "remote-api": {
      "url": "https://api.example.com/mcp",
      "headers": {
        "Authorization": "Bearer your-api-token"
      }
    }
  }
}

Multiple Servers

{
  "context_servers": {
    "filesystem": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-filesystem", "/home/user/projects"]
    },
    "github": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_xxx"
      }
    },
    "postgres": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-postgres"],
      "env": {
        "POSTGRES_CONNECTION_STRING": "postgresql://user:pass@localhost:5432/db"
      }
    }
  }
}

Agent Profiles

Zed allows you to create custom agent profiles to control which tools are available in different contexts. This is useful for creating specialised AI assistants.

Creating Agent Profiles

Define profiles in your settings.json:

{
  "agent": {
    "profiles": {
      "default": {
        "tools": {
          "filesystem": true,
          "github": true,
          "postgres": false
        }
      },
      "database-admin": {
        "tools": {
          "filesystem": false,
          "github": false,
          "postgres": true
        }
      },
      "full-access": {
        "tools": {
          "filesystem": true,
          "github": true,
          "postgres": true
        }
      }
    }
  }
}

Use Case

Agent profiles let you restrict tools based on your current task. For example, use a “database-admin” profile when working with databases to avoid accidentally using file system tools.

Tool Approval Settings

By default, Zed asks for approval before executing MCP tools. You can configure this behaviour in settings:

Always Allow Tools

To skip approval prompts for all tool actions:

{
  "agent": {
    "always_allow_tool_actions": true
  }
}

Security Warning

Enabling always_allow_tool_actions means the AI can execute tools without your explicit approval. Only enable this for trusted tools and development environments.

Per-Tool Approval

When approval is required (default), Zed will prompt you before each tool execution. You can:

  • Approve: Execute the tool this time
  • Deny: Skip the tool execution
  • View Details: See the parameters before deciding

Troubleshooting

Context server not appearing

  • • Check settings.json syntax is valid JSON
  • • Verify the command exists in your PATH
  • • Restart Zed after configuration changes
  • • Check the Zed logs for error messages

npx servers fail to start

  • • Ensure Node.js is installed and npx is available
  • • Try running the command manually in terminal first
  • • Clear npm cache: npm cache clean --force
  • • Check for proxy or firewall blocking npm registry

Extension not providing tools

  • • Check the extension's documentation for required configuration
  • • Verify any API keys or credentials are set correctly
  • • Try reinstalling the extension
  • • Check for extension updates

Environment variables not working

  • • Zed uses the env block in settings, not shell environment
  • • Ensure values are strings (quoted in JSON)
  • • Try using absolute paths for file-based credentials
  • • Restart Zed after changing environment configuration

How to view logs

  • • Open Command Palette (Cmd+Shift+P)
  • • Search for “zed: open log”
  • • Look for context server related errors

High Performance + Extensibility

Zed combines fast performance with deep AI integration. With context servers, you get the speed of a native editor with the extensibility of MCP, accessing databases, APIs, and external tools without leaving your editor.

Frequently Asked Questions

Zed calls MCP servers "context servers" and configures them in settings.json under the context_servers key. Open settings with Cmd+, (macOS) or Ctrl+, (Linux). The file is located at ~/Library/Application Support/Zed/settings.json (macOS) or ~/.config/zed/settings.json (Linux).

Open the Extensions panel (Cmd+Shift+X), search for the MCP server you want (e.g., "postgres", "puppeteer"), click Install, and configure any required settings in settings.json. The context server will automatically appear in the AI panel.

Yes, set "agent": {"always_allow_tool_actions": true} in your settings.json. However, this means the AI can execute tools without your explicit approval, so only enable this for trusted tools in development environments.

Agent profiles let you control which tools are available in different contexts. Define profiles under agent.profiles in settings.json with tool configurations (true/false). For example, create a "database-admin" profile that only enables database tools.

Check settings.json for valid JSON syntax. Verify the command exists in your PATH. Restart Zed after configuration changes. Open Command Palette and search for "zed: open log" to view error messages related to context servers.

References & Further Reading

Related Articles

Ayodele Ajayi

Principal Engineer based in Kent, UK. Specialising in security governance, cloud architecture, and platform engineering.