Prerequisites
- Access to Search API: Ensure you have access to the search API. Contact [email protected] for an invite if needed.
Installation
Install uv
MacOS/Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
Windows
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
Setup with Claude Desktop
Configuration
-
Locate the claude_desktop_config.json file:
- Navigate through: Hamburger Menu -> File -> Settings -> Developer -> Edit Config
-
Add the following configuration:
{
"mcpServers": {
"kagi": {
"command": "uvx",
"args": ["kagimcp"],
"env": {
"KAGI_API_KEY": "YOUR_API_KEY_HERE"
}
}
}
}
Automatic Installation via Smithery
npx -y @smithery/cli install kagimcp --client claude
Ask Claude a Question
uvcurl -LsSf https://astral.sh/uv/install.sh | sh
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
Locate the claude_desktop_config.json file:
- Navigate through: Hamburger Menu -> File -> Settings -> Developer -> Edit Config
Add the following configuration:
{
"mcpServers": {
"kagi": {
"command": "uvx",
"args": ["kagimcp"],
"env": {
"KAGI_API_KEY": "YOUR_API_KEY_HERE"
}
}
}
}
npx -y @smithery/cli install kagimcp --client claude
Example:
Who was time's 2024 person of the year?
Debugging
npx @modelcontextprotocol/inspector uvx kagimcp
Local/Dev Setup Instructions
Clone Repository
git clone https://github.com/kagisearch/kagimcp.git
Install Dependencies
-
Install
uv(if not already installed):- Follow the same steps as in the Installation section above.
-
Install MCP Server Dependencies:
cd kagimcp -
Create and Activate Virtual Environment:
uv venv- MacOS/Linux:
source .venv/bin/activate - Windows:
.venv/Scripts/activate
- MacOS/Linux:
-
Sync Dependencies:
uv sync
Setup with MCP CLI SDK
-
Install MCP CLI (if not already installed):
pip install mcp[cli] -
Install MCP:
mcp install /ABSOLUTE/PATH/TO/PARENT/FOLDER/kagimcp/src/kagimcp/server.py -v "KAGI_API_KEY=API_KEY_HERE"
Manual Setup
-
Locate the
claude_desktop_config.jsonfile:- Navigate through: Hamburger Menu -> File -> Settings -> Developer -> Edit Config
-
Add the following configuration:
{ "mcpServers": { "kagi": { "command": "uv", "args": [ "--directory", "/ABSOLUTE/PATH/TO/PARENT/FOLDER/kagimcp", "run", "kagimcp" ], "env": { "KAGI_API_KEY": "YOUR_API_KEY_HERE" } } } }
Debugging
If MCP CLI is Installed
mcp dev /ABSOLUTE/PATH/TO/PARENT/FOLDER/kagimcp/src/kagimcp/server.py
If MCP CLI is Not Installed
npx @modelcontextprotocol/inspector
uv
--directory /ABSOLUTE/PATH/TO/PARENT/FOLDER/kagimcp
run
kagimcp
- Access MCP Inspector at http://localhost:5173.
- Add your Kagi API key in the environment variables under
KAGI_API_KEY.
Notes
- Adjust logging level using the
FASTMCP_LOG_LEVELenvironment variable (e.g.FASTMCP_LOG_LEVEL="ERROR").