Skip to content

Latest commit

 

History

History
79 lines (58 loc) · 2.62 KB

File metadata and controls

79 lines (58 loc) · 2.62 KB

Architecture

Overview

This Zed extension provides MCP (Model Context Protocol) integration for searching Bun documentation. It's implemented as a pure Rust binary that communicates with Zed via stdio.

Components

1. Zed Extension (Rust WASM)

  • Location: src/lib.rs
  • Purpose: Implements context_server_command to provide the command Zed needs to start the MCP server
  • Build Target: wasm32-wasip2

2. MCP Binary (Rust Native)

Communication Flow

graph LR
    A["Zed<br/>(stdio)"] <-->|Extension WASM| B["Native Binary<br/>(stdin/stdout)"]
    B -->|HTTPS| C["bun.com/docs/mcp"]
    C -->|HTTPS| B
Loading
  1. Extension: Returns command to execute native binary
  2. Binary: Reads JSON-RPC from stdin, makes HTTPS requests, writes responses to stdout
  3. Zed: Communicates with binary via stdio pipes

Platform Support

Platform Architecture Binary Name
Linux aarch64 bun-docs-mcp-proxy-linux-aarch64
Linux x86_64 bun-docs-mcp-proxy-linux-x86_64
macOS aarch64 bun-docs-mcp-proxy-macos-aarch64
macOS x86_64 bun-docs-mcp-proxy-macos-x86_64
Windows aarch64 bun-docs-mcp-proxy-windows-aarch64.exe
Windows x86_64 bun-docs-mcp-proxy-windows-x86_64.exe

Build Process

# Build extension WASM
cargo build --target wasm32-wasip2 --release

The binary is downloaded automatically.
See: kjanat/bun-docs-mcp-proxy/releases

Migration History

Originally implemented in TypeScript, migrated to pure Rust for:

  • Zero runtime dependencies - No Node.js or Bun required
  • 10x faster startup - 4ms vs 40ms+ for JavaScript runtimes
  • Smaller footprint - 2.7 MB vs 50+ MB with runtime
  • Better platform support - Native binaries for 6 platforms

Migration completed in commit kjanat/bun-docs-mcp-zed@16daa944a9fb12d58a19c23751f5b4bb18fb3a68 (November 2025).
For detailed history, see git log from https://github.com/kjanat/bun-docs-mcp-zed/compare/8a68491...HEAD onward.