Skip to content

keshav1998/deepwiki-mcp-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

73 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

DeepWiki MCP Server Extension for Zed

A Model Context Protocol (MCP) server extension for the Zed IDE that provides seamless integration with DeepWiki and Devin AI documentation services.

πŸ—οΈ Architecture

This extension uses a two-part architecture with automatic binary download:

Zed ↔ Extension (WASM) β†’ Auto-Downloaded Bridge (Native) ↔ HTTP MCP Server

Components

  1. Extension (WASM) - crates/extension/

    • Lightweight Zed extension compiled to WebAssembly
    • Automatically downloads platform-specific bridge binary
    • Provides configuration UI and command setup
    • No async/HTTP dependencies (WASM-compatible)
  2. Bridge Binary (Native) - crates/bridge/

    • Auto-downloaded from GitHub releases per platform
    • Full HTTP/async capabilities with tokio and reqwest
    • Translates between STDIO (Zed) and HTTP (DeepWiki/Devin)
    • Handles MCP protocol communication

πŸš€ Features

  • Free DeepWiki Access: Query public repository documentation
  • Devin AI Integration: Enhanced AI-powered documentation with API key
  • Automatic Setup: Bridge binary downloaded automatically per platform
  • Type-Safe Configuration: JSON schema validation for settings
  • Secure Authentication: Environment variable-based API key handling
  • Protocol Compliance: Full MCP (Model Context Protocol) support
  • Cross-Platform: Supports Linux (x86_64, ARM64), macOS (Intel, Apple Silicon), Windows

πŸ› οΈ Installation

Prerequisites

  • Rust toolchain (latest stable)
  • Zed IDE
  • WASM target: rustup target add wasm32-wasip1

Install from Zed Extensions Registry (Recommended)

  1. Open Zed
  2. Open Command Palette (Cmd/Ctrl+Shift+P)
  3. Type: "zed: extensions"
  4. Search for: "DeepWiki MCP"
  5. Click Install

The extension will automatically download the appropriate bridge binary for your platform when first used.

Build from Source (Advanced)

If you want to build from source:

  1. Clone the repository:

    git clone https://github.com/keshav1998/deepwiki-mcp-server
    cd deepwiki-mcp-server
  2. Build everything:

    ./build.sh
  3. Install manually in Zed:

    # Copy to Zed extensions directory
    cp -r dist/* ~/.config/zed/extensions/deepwiki-mcp-server/

βš™οΈ Configuration

Basic Setup (Free DeepWiki)

Add to your Zed settings.json:

{
  "context_servers": {
    "deepwiki-mcp-server": {
      "endpoint": "https://mcp.deepwiki.com",
      "protocol": "mcp"
    }
  }
}

Advanced Setup (Devin AI with Authentication)

{
  "context_servers": {
    "deepwiki-mcp-server": {
      "endpoint": "https://mcp.devin.ai",
      "protocol": "mcp",
      "devin_api_key": "your-api-key-here"
    }
  }
}

Environment Variables

For secure API key management:

export DEVIN_API_KEY="your-api-key-here"

πŸ”§ Development

Project Structure

deepwiki-mcp-server/
β”œβ”€β”€ crates/
β”‚   β”œβ”€β”€ extension/          # Zed WASM extension
β”‚   β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”‚   β”œβ”€β”€ lib.rs     # Extension implementation
β”‚   β”‚   β”‚   └── tests.rs   # Extension tests
β”‚   β”‚   └── configuration/ # UI configuration files
β”‚   └── bridge/            # Native bridge binary
β”‚       └── src/
β”‚           β”œβ”€β”€ main.rs    # Bridge entry point
β”‚           └── mcp_bridge/ # MCP protocol implementation
β”œβ”€β”€ extension.toml         # Zed extension manifest
β”œβ”€β”€ build.sh              # Build script
└── scripts/              # Legacy shell scripts (deprecated)

Building Individual Components

# Build extension (WASM)
cargo build --manifest-path crates/extension/Cargo.toml --target wasm32-wasip1

# Build bridge (native)
cargo build --manifest-path crates/bridge/Cargo.toml --release

# Run tests
cargo test --workspace

Code Quality

# Format code
cargo fmt --all

# Run clippy
cargo clippy --workspace --tests -- -D warnings

# Fix clippy issues automatically
cargo clippy --fix --allow-dirty --allow-staged --workspace

πŸƒβ€β™‚οΈ Usage

Once installed and configured:

  1. Open a project in Zed
  2. Access the assistant panel
  3. Use context-aware queries like:
    • "How do I implement authentication in this codebase?"
    • "Show me examples of error handling patterns"
    • "What are the available API endpoints?"

The extension will automatically query relevant documentation and provide contextual answers.

πŸ” MCP Protocol Support

This extension implements the full Model Context Protocol v2024-11-05 specification:

  • βœ… Tools: Interactive documentation queries
  • βœ… Resources: Repository file access
  • βœ… Prompts: Predefined query templates
  • βœ… Initialization: Capability negotiation
  • βœ… Error Handling: Robust error reporting

πŸ›‘οΈ Security

  • WASM Sandboxing: Extension runs in WebAssembly sandbox
  • Process Isolation: Bridge runs as separate process
  • Environment Variables: Sensitive data via env vars only
  • No Hardcoded Secrets: All credentials externally managed
  • Capability-Based: Fine-grained permission system

πŸ› Troubleshooting

Common Issues

  1. Automatic download failed:

    • Check internet connectivity and GitHub access
    • Restart Zed to retry the download
    • Check Zed's extension logs for details
  2. Bridge binary not working:

    • The extension automatically handles binary installation
    • If issues persist, try reinstalling the extension
    • Check platform compatibility (Linux, macOS, Windows supported)
  3. Authentication errors:

    # Check API key in settings
    # Verify endpoint configuration
  4. Manual installation needed:

    # Download from: https://github.com/keshav1998/deepwiki-mcp-server/releases
    # Extract to extension's bin/ directory
    # Extension handles the rest automatically

Debug Mode

Enable debug logging:

export DEBUG=1
export RUST_LOG=debug

Then check Zed's extension logs for detailed information.

🀝 Contributing

We welcome contributions! Please see our development guidelines:

Code Standards

  • Rust Best Practices: Follow Rust API guidelines
  • Security First: No hardcoded secrets, validate inputs
  • WASM Compatibility: Keep extension dependencies minimal
  • Type Safety: Use strong typing throughout
  • Error Handling: Comprehensive error handling with context

Development Workflow

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Make changes following our coding standards
  4. Add tests for new functionality
  5. Run the full test suite: cargo test --workspace
  6. Submit a pull request

πŸ“„ License

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

πŸ™ Acknowledgments

  • Zed Team: For the excellent extension API and WebAssembly architecture
  • MCP Specification: For providing a robust protocol for AI tool integration
  • DeepWiki & Devin: For providing the documentation and AI services

πŸ“ž Support


Built with ❀️ for the Zed community

About

Zed mcp context server extension for deepwiki

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages