home / mcp / kagi mcp server

Kagi MCP Server

The Official Model Context Protocol (MCP) server for Kagi search & other tools.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "kagisearch-kagimcp": {
      "command": "uvx",
      "args": [
        "kagimcp"
      ],
      "env": {
        "KAGI_API_KEY": "YOUR_API_KEY_HERE",
        "KAGI_SUMMARIZER_ENGINE": "YOUR_ENGINE_CHOICE_HERE"
      }
    }
  }
}

You can run and connect to the Kagi MCP server to power your Claude and Codex workflows with fast, machine-assisted search and summarization. This MCP server is designed to run locally and be controlled from your preferred MCP clients, letting you perform searches and summarizations through a consistent interface while keeping API keys securely in your environment.

How to use

You interact with the Kagi MCP server from your MCP client by starting the MCP process locally and pointing your client to the local server entry point. Use the provided stdio configuration to run the server and supply your API key. Once the server is running, your MCP client can route search and summarization requests through the Kagi MCP server for fast, context-aware results. If you want to disable any client’s default web search to avoid conflicts, configure the client accordingly so that only the Kagi MCP server handles those tasks.

How to install

Prerequisites you need before installing the MCP server include a runtime for the local MCP process and a way to run commands from your shell.

Step 1: Install the required runtime for local MCP execution.

MacOS/Linux: Use the following script to install the unified runtime tool you will need to run the MCP server.

curl -LsSf https://astral.sh/uv/install.sh | sh

Windows: Install the same runtime tool with PowerShell.

powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

Local/Dev setup steps for Kagi MCP server

Clone the Kagi MCP server repository and set up a local development environment so you can run and test the server locally.

Step 1: Clone the repository.

git clone https://github.com/kagisearch/kagimcp.git

Step 2: Install the required runtime and dependencies.

# Create and activate virtual environment
uv venv

# Activate (macOS/Linux)
source .venv/bin/activate

# Activate (Windows)
.venv\Scripts\activate

# Install dependencies
uv sync

Setup with Claude Desktop

Configure Claude Desktop to use the Kagi MCP server by pointing it to the local MCP runner along with your API key.

// claude_desktop_config.json
// Can find location through:
// Hamburger Menu -> File -> Settings -> Developer -> Edit Config
{
  "mcpServers": {
    "kagi": {
      "command": "uvx",
      "args": ["kagimcp"],
      "env": {
        "KAGI_API_KEY": "YOUR_API_KEY_HERE",
        "KAGI_SUMMARIZER_ENGINE": "YOUR_ENGINE_CHOICE_HERE"
      }
    }
  }
}

Setup with OpenAI Codex CLI

To add the Kagi MCP server to Codex CLI, use the following command. This registers the server so Codex can communicate with it.

codex mcp add kagi --env KAGI_API_KEY=<YOUR_API_KEY_HERE> -- uvx kagimcp
```
This writes out the configuration to your Codex config file so you can rotate keys there before running Codex again.

Pose query that requires use of a tool

When you want to perform a search or summation that benefits from an external tool, phrase your query to require tool usage, for example: “Who was time's 2024 person of the year?” for search, or “summarize this video: https://www.youtube.com/watch?v=jNQXAC9IVRw” for summarization.

Debugging

If you need to inspect the MCP configuration and environment, you can run the inspector locally to verify your setup.

npx @modelcontextprotocol/inspector uvx kagimcp

Advanced Configuration

There are a few knobs you can tune in advanced setups. You can adjust logging level and the summarizer engine by setting environment variables in your MCP client configuration or in the local environment where the MCP server runs.

- Level of logging can be controlled via FASTMCP_LOG_LEVEL (for example, FASTMCP_LOG_LEVEL="ERROR"). - The summarizer engine can be selected with KAGI_SUMMARIZER_ENGINE, for example KAGI_SUMMARIZER_ENGINE="daphne".

If you enable HTTP transport for the MCP client, you can combine it with other options like --port and --host to customize where the server is exposed.

Available tools

Inspector

MCP Inspector for debugging and inspecting the MCP server during development. Run the inspector to view MCP activity and verify endpoint behavior.