This MCP server provides two main tools for integrating Kagi's services with LLMs:
- Search - Perform web searches using Kagi's search API (requires search API access)
- Summarize - Use Kagi's FastGPT to summarize web search results for a query (available to all Kagi users)
Each tool can be enabled/disabled independently using environment variables, allowing you to use only the features you need or have access to.
For the search functionality, ensure you have access to the search API. It is currently in closed beta and available upon request. Please reach out to [email protected] for an invite.
The FastGPT summarize functionality is available to all Kagi users with an API key.
Install uv first.
MacOS/Linux:
curl -LsSf https://astral.sh/uv/install.sh | sh
Windows:
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
# 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_ENABLE_SEARCH": "true",
"KAGI_ENABLE_FASTGPT": "true"
}
}
}
}
Alternatively, you can install Kagi for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install kagimcp --client claude
e.g. "Who was time's 2024 person of the year?"
Run:
npx @modelcontextprotocol/inspector uvx kagimcp
git clone https://github.com/kagisearch/kagimcp.git
Install uv first.
MacOS/Linux:
curl -LsSf https://astral.sh/uv/install.sh | sh
Windows:
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
Then install MCP server dependencies:
cd kagimcp
# Create virtual environment and activate it
uv venv
source .venv/bin/activate # MacOS/Linux
# OR
.venv/Scripts/activate # Windows
# Install dependencies
uv sync
# `pip install mcp[cli]` if you haven't
mcp install /ABSOLUTE/PATH/TO/PARENT/FOLDER/kagimcp/src/kagimcp/server.py -v "KAGI_API_KEY=API_KEY_HERE"
# claude_desktop_config.json
# Can find location through:
# Hamburger Menu -> File -> Settings -> Developer -> Edit Config
{
"mcpServers": {
"kagi": {
"command": "uv",
"args": [
"--directory",
"/ABSOLUTE/PATH/TO/PARENT/FOLDER/kagimcp",
"run",
"kagimcp"
],
"env": {
"KAGI_API_KEY": "YOUR_API_KEY_HERE",
"KAGI_ENABLE_SEARCH": "true",
"KAGI_ENABLE_FASTGPT": "true"
}
}
}
}
e.g. "Who was time's 2024 person of the year?"
Run:
# If mcp cli installed (`pip install mcp[cli]`)
mcp dev /ABSOLUTE/PATH/TO/PARENT/FOLDER/kagimcp/src/kagimcp/server.py
# If not
npx @modelcontextprotocol/inspector \
uv \
--directory /ABSOLUTE/PATH/TO/PARENT/FOLDER/kagimcp \
run \
kagimcp
Then access MCP Inspector at http://localhost:5173
. You may need to add your Kagi API key in the environment variables in the inspector under KAGI_API_KEY
.
KAGI_API_KEY
- Your Kagi API key (required)KAGI_ENABLE_SEARCH
- Enable/disable the search functionality (default: "true")KAGI_ENABLE_FASTGPT
- Enable/disable the FastGPT functionality (default: "true")FASTMCP_LOG_LEVEL
- Adjust logging level (e.g. "ERROR", "INFO", "DEBUG")- Relevant issue: kagisearch#4