Skip to content

keshav1998/zed-mcp-proxy

Repository files navigation

zed-mcp-proxy

Crates.io Crates.io Downloads GitHub Release Documentation

CI Quality Test Coverage Coverage Tests Codecov

Security Audit Dependencies MSRV unsafe forbidden

Benchmarks Performance MCP Protocol Transport Config

License: MIT GitHub Stars GitHub Issues GitHub PRs

A high-performance, minimal MCP (Model Context Protocol) proxy for Zed editor integration. This binary acts as a protocol bridge between Zed's STDIO interface and remote MCP servers using HTTP/SSE/WebSocket transports.

πŸ“– Documentation

πŸ“š Complete Documentation | πŸš€ Quick Start | βš™οΈ Configuration | πŸ” Authentication | πŸ› Troubleshooting

⚑ Quick Start

  1. Install the proxy:

    cargo install zed-mcp-proxy
  2. Test connection:

    zed-mcp-proxy https://mcp.deepwiki.com
  3. Configure Zed (add to Zed settings):

    {
      "experimental": { "mcp": true },
      "mcp_servers": {
        "deepwiki": {
          "command": "zed-mcp-proxy",
          "args": ["https://mcp.deepwiki.com"]
        }
      }
    }
  4. Restart Zed and enjoy MCP features! πŸŽ‰

Need help? Check the πŸ“š Full Documentation or πŸš€ Quick Start Guide.

πŸš€ Features

  • Official MCP SDK: Built with rmcp v0.3.0 for full MCP 2025-03-26 protocol compliance
  • Auto Transport Detection: Automatically detects and uses HTTP/SSE/WebSocket transports based on URL patterns
  • OAuth2 Authentication: Built-in browser-based OAuth2 flow with secure token storage
  • Configuration Options: Supports TOML configuration files with extensive customization options
  • Zero Configuration: Works out-of-the-box with sensible defaults for most MCP servers
  • High Performance: Minimal overhead proxy with async Rust implementation
  • Cross-Platform: Supports Linux, macOS, and Windows

πŸ“¦ Installation

Quick Install

cargo install zed-mcp-proxy

Other methods: πŸ“– Complete Installation Guide

πŸ”§ Usage

Basic Usage

zed-mcp-proxy https://your-mcp-server.com

With Configuration

zed-mcp-proxy --config config.toml https://server.com

Detailed guides: πŸ“– Usage Documentation | βš™οΈ Configuration Guide

Transport Auto-Detection

The proxy automatically chooses the best transport:

  • WebSocket: ws://, wss://, /ws, /websocket
  • Server-Sent Events: /sse, /events
  • HTTP: Default for all other URLs

Learn more: πŸ”— Transport Guide

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    STDIO    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    HTTP/SSE    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚     Zed     β”‚ ◄────────► β”‚ zed-mcp-    β”‚ ◄───────────► β”‚ MCP Server  β”‚
β”‚  Extension  β”‚             β”‚    proxy    β”‚                β”‚             β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜             β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

The proxy handles:

  1. Protocol Translation: STDIO ↔ HTTP/SSE message conversion
  2. Connection Management: Maintains persistent connections to remote servers
  3. Error Handling: Graceful error recovery and reporting
  4. Authentication: OAuth2 support for secure endpoints (when configured)

πŸ“š Documentation

Topic Description Link
Quick Start Get up and running in 5 minutes πŸ“– Quick Start
Installation Complete installation guide πŸ“– Installation
Configuration All configuration options πŸ“– Configuration
Authentication OAuth2 setup and troubleshooting πŸ“– Authentication
Transport Types HTTP, SSE, WebSocket transports πŸ“– Transports
Zed Integration Detailed Zed editor setup πŸ“– Integration
Troubleshooting Common issues and solutions πŸ“– Troubleshooting
Examples Real-world configurations πŸ“– Examples

πŸ”§ Advanced Features

OAuth2 authentication is automatic for supported servers:

zed-mcp-proxy https://mcp.devin.ai  # Browser opens for auth

Detailed setup: πŸ” Authentication Guide

This provides a seamless authentication experience without manual configuration.

OAuth2 Configuration

You can configure OAuth2 in your configuration file:

[auth]
client_id = "your-client-id"
client_secret = "your-client-secret"  # optional for public clients
redirect_uri = "http://localhost:{port}/callback"  # {port} is automatically replaced
scopes = ["mcp:read", "mcp:write"]

Or using environment variables:

export MCP_OAUTH_CLIENT_ID="your-client-id"
export MCP_OAUTH_CLIENT_SECRET="your-client-secret"  # optional for public clients
export MCP_OAUTH_REDIRECT_URI="your-redirect-uri"

The {port} placeholder in the redirect URI is automatically replaced with the actual port of the local callback server.

πŸ“‹ Protocol Support

Full support for MCP protocol features:

  • Tools: Execute tools and return results
  • Resources: Access and manipulate resources
  • Prompts: Handle prompt requests and responses
  • Sampling: Support for model sampling requests
  • Notifications: Bidirectional notification support
  • Progress: Progress tracking for long-running operations

πŸ”§ Configuration

Configuration File

The proxy supports a TOML configuration file for more detailed configuration:

# Example configuration
endpoint_url = "https://mcp.example.com"

[transport]
connection_timeout_secs = 10
service_setup_timeout_secs = 5

[logging]
level = "debug"
format = "plain"

[auth]
client_id = "your-client-id"
client_secret = "your-client-secret"
redirect_uri = "http://localhost:8080/callback"
scopes = ["mcp:read", "mcp:write"]

Configuration options include:

  • Transport settings: Connection timeouts, transport type
  • Logging configuration: Log level, format, output destination
  • Authentication: OAuth2 credentials and settings
  • Reconnection settings: Automatic reconnection with exponential backoff

See the example configuration file for a complete list of options.

Logging

Control logging level with the RUST_LOG environment variable or in the configuration file:

# Debug level logging
RUST_LOG=debug zed-mcp-proxy https://your-server.com

# Info level (default)
RUST_LOG=info zed-mcp-proxy https://your-server.com

# Error level only
RUST_LOG=error zed-mcp-proxy https://your-server.com

Signal Handling

The proxy responds to standard signals:

  • Ctrl+C (SIGINT): Graceful shutdown
  • SIGTERM: Graceful shutdown

🚧 Development

Building from Source

git clone https://github.com/keshav1998/zed-mcp-proxy
cd zed-mcp-proxy
cargo build --release

Running Tests

cargo test

Code Quality

cargo clippy
cargo fmt

πŸ“ˆ Performance

  • Binary Size: ~3.8MB (release build)
  • Memory Usage: <10MB typical runtime
  • Startup Time: <100ms cold start
  • Latency: <1ms protocol overhead

πŸ”„ Supported MCP Versions

  • MCP 2025-03-26: Full support (latest specification)
  • MCP 2024-11-05: Backwards compatibility maintained
  • Transport Protocols: HTTP, SSE, WebSocket, Streamable HTTP

🀝 Contributing

Contributions are welcome! Please see our Contributing Guide for details.

Development Setup

  1. Clone the repository
  2. Install Rust (1.70+)
  3. Run cargo build
  4. Run tests with cargo test

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ”— Related Projects

πŸ“š Documentation

πŸ†˜ Support


Made with ❀️ for the Zed and MCP communities

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published