kagi-mcp-server
v0.0.30
Published
NPX wrapper for Kagi MCP Server - Kagi Search and Summarizer integration for AI assistants via Model Context Protocol
Maintainers
Readme
Kagi MCP Server - NPX Wrapper
NPX wrapper for the Kagi MCP Server - run the Kagi Search and Summarizer MCP server without manual binary downloads.
Features
- 🚀 Zero Config: Just run
npx kagi-mcp-server- no installation needed - 📦 Auto-Download: Automatically downloads the correct binary for your platform
- 💾 Cached: Binary is cached after first download for fast subsequent runs
- 🔄 Cross-Platform: Works on macOS (Intel & Apple Silicon), Linux, and Windows
- 🔒 Privacy-First: Built on Kagi's privacy-focused search infrastructure
Prerequisites
- Node.js 16+: Required for NPX execution
- Kagi API Key: Get one from Kagi Settings (requires API access - currently in closed beta, email [email protected] to request access)
Quick Start
# Run with environment variable
KAGI_API_KEY=your-key npx -y kagi-mcp-server
# Or with command line argument
npx -y kagi-mcp-server --api-key your-key
# Show help
npx -y kagi-mcp-server --helpNote: The
-yflag auto-confirms the npx install prompt, which is required for non-interactive use (like MCP clients).
MCP Client Configuration
Claude Desktop
Add this to your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
Linux: ~/.config/Claude/claude_desktop_config.json
{
"mcpServers": {
"kagi": {
"command": "npx",
"args": ["-y", "kagi-mcp-server"],
"env": {
"KAGI_API_KEY": "your-api-key-here"
}
}
}
}With Custom Summarizer Engine
{
"mcpServers": {
"kagi": {
"command": "npx",
"args": [
"-y",
"kagi-mcp-server",
"--summarizer-engine",
"muriel"
],
"env": {
"KAGI_API_KEY": "your-api-key-here"
}
}
}
}Cursor
Add to your Cursor MCP settings (Settings → MCP):
{
"mcpServers": {
"kagi": {
"command": "npx",
"args": ["-y", "kagi-mcp-server"],
"env": {
"KAGI_API_KEY": "your-api-key-here"
}
}
}
}VS Code with Continue.dev
In your Continue configuration (~/.continue/config.json):
{
"experimental": {
"modelContextProtocolServers": [
{
"transport": {
"type": "stdio",
"command": "npx",
"args": ["-y", "kagi-mcp-server"],
"env": {
"KAGI_API_KEY": "your-api-key-here"
}
}
}
]
}
}Zed Editor
For Zed, we recommend using the native Zed extension instead of this npx wrapper. Install "Kagi MCP Server" from the Zed extension marketplace.
However, if you prefer the npx approach, add to your Zed settings:
{
"context_servers": {
"kagi": {
"command": {
"path": "npx",
"args": ["-y", "kagi-mcp-server"],
"env": {
"KAGI_API_KEY": "your-api-key-here"
}
}
}
}
}Generic MCP Client Configuration
For any MCP-compatible client, use these settings:
| Setting | Value |
|---------|-------|
| Transport | stdio |
| Command | npx |
| Arguments | -y, kagi-mcp-server |
| Environment | KAGI_API_KEY=your-api-key |
Available Tools
Once connected, the Kagi MCP Server provides these tools to AI assistants:
🔍 Search Tools
| Tool | Description |
|------|-------------|
| kagi_search | Web search using Kagi's privacy-focused search API |
| kagi_fastgpt | Quick AI-powered answers with automatic web search |
| kagi_enrich_web | Find non-commercial "small web" content and discussions |
| kagi_enrich_news | Find non-mainstream news sources and alternative perspectives |
📄 Summarization
| Tool | Description |
|------|-------------|
| kagi_summarize | Summarize web pages, documents, PDFs, and videos |
Command Line Options
Options:
--api-key KEY Kagi API key (or set KAGI_API_KEY env var)
--summarizer-engine ENGINE Summarizer engine to use (default: cecil)
--help Show help message
--wrapper-help Show npx wrapper help
Summarizer Engines:
cecil - Friendly, conversational summaries (default)
agnes - Formal, professional tone
daphne - Detailed, comprehensive summaries
muriel - Concise, brief summariesEnvironment Variables
| Variable | Required | Description |
|----------|----------|-------------|
| KAGI_API_KEY | Yes | Your Kagi API key |
Security Best Practices
- Never commit your API key to version control
- Use environment variables or secure secrets management
- For CI/CD, use encrypted secrets (GitHub Secrets, etc.)
- Consider using a
.envfile locally (and add it to.gitignore)
How It Works
- On first run, the wrapper downloads the correct pre-built binary for your platform from GitHub releases
- The binary is cached in
~/.cache/kagi-mcp-server/ - Subsequent runs use the cached binary directly
- The wrapper passes all arguments and environment variables through to the native binary
- All MCP communication happens over stdio (stdin/stdout)
Supported Platforms
| OS | Architecture | Binary | |----|--------------|--------| | macOS | x86_64 (Intel) | ✅ | | macOS | arm64 (Apple Silicon) | ✅ | | Linux | x86_64 | ✅ | | Linux | arm64 | ✅ | | Windows | x86_64 | ✅ |
Troubleshooting
Binary Download Fails
# Clear the cache and try again
rm -rf ~/.cache/kagi-mcp-server
npx -y kagi-mcp-serverPermission Denied (Unix)
chmod -R u+w ~/.cache/kagi-mcp-serverServer Not Responding in Claude/Cursor
- Check that your API key is valid at Kagi Settings
- Verify you have Kagi Search API access (closed beta)
- Test the server manually first:
KAGI_API_KEY=your-key npx -y kagi-mcp-server --help - Check the client's logs for error messages
NPX Cache Issues
# Clear npx cache
npx clear-npx-cache
# Or force a fresh download
npx -y kagi-mcp-server@latestWindows-Specific Issues
- Ensure Node.js is in your PATH
- Try running from PowerShell instead of CMD
- Check Windows Defender isn't blocking the binary
Publishing to npm (For Maintainers)
This package is automatically published to npm when a new release is tagged in the repository. The GitHub Actions workflow handles:
- Building platform-specific binaries
- Creating a GitHub release with the binaries
- Publishing the npm package with the matching version
Initial Setup (One-Time)
Follow these steps to enable automatic npm publishing:
Step 1: Create an npm Account
If you don't have one, create an account at npmjs.com/signup
Step 2: Check Package Name Availability
npm view kagi-mcp-serverIf it returns a 404, the name is available. If it's taken, you'll need to either:
- Use a scoped name: change
"name"inpackage.jsonto"@yourusername/kagi-mcp-server" - Pick a different name like
kagimcp-server
Step 3: Generate an npm Automation Token
- Go to npmjs.com and sign in
- Click your avatar (top right) → Access Tokens
- Click Generate New Token → select Automation
- Copy the token (it starts with
npm_...) - you won't see it again!
Step 4: Add the Token to GitHub Secrets
- Go to your GitHub repository:
https://github.com/jmylchreest/kagimcp-zed - Navigate to Settings → Secrets and variables → Actions
- Click New repository secret
- Name:
NPM_TOKEN - Value: Paste your npm automation token
- Click Add secret
Step 5: Publish
Option A: Automatic (recommended)
Just tag a new release - the workflow handles everything:
git tag v0.0.31
git push origin v0.0.31The workflow will:
- Build binaries for all platforms
- Create a GitHub release
- Publish the Zed extension
- Publish to npm with the matching version
Option B: Manual (first time or testing)
cd contrib/npm
# Login to npm (first time only)
npm login
# Update version to match the release
npm version 0.0.31 --no-git-tag-version
# Publish publicly
npm publish --access publicPackage Naming
The package is published as kagi-mcp-server. If you fork this project:
- Change the
namefield inpackage.json - Consider using a scoped name:
@yourusername/kagi-mcp-server
Development
This wrapper is part of the kagimcp-zed project.
Building the Native Binary from Source
# Clone the repository
git clone https://github.com/jmylchreest/kagimcp-zed.git
cd kagimcp-zed
# Build the native binary
cargo build --package kagi-mcp-server --release
# Run directly (without npx wrapper)
KAGI_API_KEY=your-key ./target/release/kagi-mcp-serverTesting the NPX Wrapper Locally
cd contrib/npm
# Run tests
npm test
# Test the wrapper locally
node bin/kagi-mcp-server.js --helpVersion Synchronization
The npm package version should match the Cargo workspace version. The release workflow handles this automatically, but for manual releases:
- Update
Cargo.tomlversion - Update
contrib/npm/package.jsonversion - Tag and push:
git tag v0.0.31 && git push origin v0.0.31
Links
- Repository: github.com/jmylchreest/kagimcp-zed
- npm Package: npmjs.com/package/kagi-mcp-server
- Kagi Search: kagi.com
- Kagi API Docs: help.kagi.com/kagi/api
- MCP Protocol: modelcontextprotocol.io
License
MIT License - see LICENSE
