kagimcp-zed

The Kagi MCP Extension for Zed is a Rust-based project that integrates Kagi Search and Universal Summarizer into Zed's AI Assistant. Built on Kagi's privacy-focused infrastructure, it offers a lightweight MCP server and allows users to choose from multiple summarization engines. Leveraging Rust's performance, it features a modular design that enhances reusability.

GitHub Stars

0

User Rating

Not Rated

Forks

0

Issues

0

Views

2

Favorites

0

README
Kagi MCP Extension for Zed

A pure Rust implementation providing Kagi Search and Universal Summarizer integration for Zed's AI Assistant through the Model Context Protocol (MCP).

Features
  • 🔍 Kagi Search: Access Kagi's privacy-focused search engine
  • 📄 Content Summarization: Summarize web pages, documents, and videos
  • ⚙️ Configurable Engines: Choose from multiple Kagi summarization engines
  • 🔒 Privacy-First: Built on Kagi's privacy-focused infrastructure
  • 🦀 Pure Rust: No Python dependencies, native performance
  • 📦 Modular: Reusable libraries for the broader ecosystem
Architecture

This project is structured as a Cargo workspace with focused, lightweight crates:

📚 Components
  • kagiapi - Pure Rust client for Kagi's APIs (search, summarizer)
  • kagi-mcp-server - Lightweight MCP server implementation (400 LOC)
  • kagimcp-zed - Zed extension (WebAssembly)
🎯 Benefits
  • Simple: Custom MCP implementation that's easy to understand and modify
  • Type-safe: Strongly typed APIs with comprehensive error handling
  • Performance: Native Rust performance, no Python overhead
  • Maintainable: Focused codebase without complex external dependencies
Quick Start
1. Prerequisites

Get Kagi API Access:

  1. Request API access by emailing support@kagi.com (currently in closed beta)
  2. Get your API key from Kagi Settings
2. Install & Configure Extension
  1. Install in Zed: Extensions → Search "Kagi MCP Server" → Install
  2. Automatic Setup: The MCP server binary is automatically downloaded on first use
  3. Configure: Add to your Zed settings:
{
  "context_servers": {
    "kagimcp": {
      "settings": {
        "kagi_api_key": "YOUR_KAGI_API_KEY_HERE",
        "kagi_summarizer_engine": "cecil"
      }
    }
  }
}
Usage Examples

Ask Zed's AI Assistant:

🔍 Search:

  • "Search for the latest AI safety research"
  • "Find recent climate change news"
  • "Search for Rust async programming guides"

📄 Summarize:

Configuration
Required
  • kagi_api_key: Your Kagi API key
Optional
  • kagi_summarizer_engine: Engine to use (default: "cecil")
    • Options: "cecil", "daphne", etc.
    • See Kagi docs
Example Configuration
{
  "context_servers": {
    "kagimcp": {
      "settings": {
        "kagi_api_key": "your-api-key-here",
        "kagi_summarizer_engine": "cecil"
      }
    }
  }
}
Troubleshooting

Extension not working?

  1. Check that the MCP server binary downloaded successfully (check Zed logs)
  2. Confirm API key is valid and has permissions
  3. Ensure you have internet access for initial binary download

API errors?

  • Ensure you have Kagi Search API access (closed beta)
  • Double-check your API key in settings

Binary download issues?

  • The extension automatically downloads the MCP server binary from GitHub releases
  • If download fails, check your internet connection and GitHub access
  • Binaries are cached locally for offline use after first download
Development
Prerequisites
# Install Rust and required target
rustup default stable
rustup target add wasm32-unknown-unknown
Local Development
# Clone and build
git clone https://github.com/jmylchreest/kagimcp-zed.git
cd kagimcp-zed

# Build all components
cargo build --package kagiapi
cargo build --package kagi-mcp-server --release
cargo build --target wasm32-unknown-unknown --release

# Run tests
cargo test --workspace
cargo fmt -- --check
cargo clippy --workspace -- -D warnings
cargo clippy --target wasm32-unknown-unknown -- -D warnings

# Test MCP server locally
KAGI_API_KEY=your_key ./target/release/kagi-mcp-server
Release Management

Releases are fully automated through GitHub Actions:

# Create and push a tag - that's it!
git tag v0.1.0
git push origin v0.1.0

# GitHub Actions automatically:
# 1. Builds cross-platform binaries with GoReleaser
# 2. Creates GitHub release with assets
# 3. Publishes Zed extension to registry
Crate Documentation
🔧 kagiapi

Pure Rust client for Kagi's APIs with async/await support.

use kagiapi::{KagiClient, SummarizerEngine, SummaryType};

let client = KagiClient::new("your-api-key");
let results = client.search("rust programming", Some(10)).await?;
let summary = client.summarize("https://example.com", None, None, None).await?;
🔧 kagi-mcp-server

Lightweight MCP server specifically for Kagi integration.

use kagi_mcp_server::KagiMcpServer;

let server = KagiMcpServer::new(api_key, engine);
server.run().await?;
📦 Binary Usage

Command-line MCP server with flexible configuration options.

# Run with environment variables
KAGI_API_KEY=your_key kagi-mcp-server

# Or with command line args
kagi-mcp-server --api-key your_key --summarizer-engine muriel
Release Process

This project uses GoReleaser for automated builds and releases:

Automated Releases
  1. Tag a version: git tag v0.1.0 && git push origin v0.1.0
  2. GitHub Actions automatically builds binaries for all platforms
  3. Release created with assets named: kagi-mcp-server_{OS}_{ARCH}.{ext}
Local Testing

For local testing, just use standard cargo commands - no special tools needed.

Cross-Platform Builds

GoReleaser automatically builds for:

  • Linux: x86_64, ARM64
  • macOS: x86_64 (Intel), ARM64 (Apple Silicon)
  • Windows: x86_64
Links
License

MIT License - see LICENSE