Kagi MCP server
by rehanzo
A Model Context Protocol (MCP) server for Kagi search & other tools.
What is Kagi MCP server
Kagi MCP server
Setup Intructions
Before anything, unless you are just using non-search tools, 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.
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"
Installing via Smithery
Alternatively, you can install Kagi for Claude Desktop via Smithery:
npx -y @smithery/cli install kagimcp --client claude
Setup with Claude Desktop
// 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" // Defaults to "cecil" engine if env var not present
}
}
}
}
Pose query that requires use of a tool
e.g. "Who was time's 2024 person of the year?" for search, or "summarize this video: https://www.youtube.com/watch?v=jNQXAC9IVRw" for summarizer.
Debugging
Run:
npx @modelcontextprotocol/inspector uvx kagimcp
Local/Dev Setup Instructions
Clone repo
git clone https://github.com/kagisearch/kagimcp.git
Install dependencies
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
Setup with Claude Desktop
Using MCP CLI SDK
# `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"
Manually
# 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_SUMMARIZER_ENGINE": "YOUR_ENGINE_CHOICE_HERE" // Defaults to "cecil" engine if env var not present
}
}
}
}
Pose query that requires use of a tool
e.g. "Who was time's 2024 person of the year?" for search, or "summarize this video: https://www.youtube.com/watch?v=jNQXAC9IVRw" for summarizer.
Debugging
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
.
Advanced Configuration
- Level of logging is adjustable through the
FASTMCP_LOG_LEVEL
environment variable (e.g.FASTMCP_LOG_LEVEL="ERROR"
)- Relevant issue: https://github.com/kagisearch/kagimcp/issues/4
- Summarizer engine can be customized using the
KAGI_SUMMARIZER_ENGINE
environment variable (e.g.KAGI_SUMMARIZER_ENGINE="daphne"
)- Learn about the different summarization engines here
Leave a Comment
Comments section will be available soon. Stay tuned!
Frequently Asked Questions
What is MCP?
MCP (Model Context Protocol) is an open protocol that standardizes how applications provide context to LLMs. Think of MCP like a USB-C port for AI applications, providing a standardized way to connect AI models to different data sources and tools.
What are MCP Servers?
MCP Servers are lightweight programs that expose specific capabilities through the standardized Model Context Protocol. They act as bridges between LLMs like Claude and various data sources or services, allowing secure access to files, databases, APIs, and other resources.
How do MCP Servers work?
MCP Servers follow a client-server architecture where a host application (like Claude Desktop) connects to multiple servers. Each server provides specific functionality through standardized endpoints and protocols, enabling Claude to access data and perform actions through the standardized protocol.
Are MCP Servers secure?
Yes, MCP Servers are designed with security in mind. They run locally with explicit configuration and permissions, require user approval for actions, and include built-in security features to prevent unauthorized access and ensure data privacy.
Related MCP Servers
21st.dev Magic AI Agent
It's like v0 but in your Cursor/WindSurf/Cline. 21st dev Magic MCP server for working with your frontend like Magic
Requirements:
A Model Context Protocol Server for connecting with Adfin APIs
AgentQL MCP Server
Model Context Protocol server that integrates AgentQL's data extraction capabilities.
AgentRPC
A universal RPC layer for AI agents. Connect to any function, any language, any framework, in minutes.
Aiven MCP Server
Model Context Protocol server for Aiven
IoTDB MCP Server
Apache IoTDB MCP Server
Apify Model Context Protocol (MCP) Server
Model Context Protocol (MCP) Server for Apify's Actors
APIMatic Validator MCP Server
APIMatic Validator MCP Server for validating OpenAPI specs via APIMatic's API with MCP
๐ Audiense Insights MCP Server
Audiense Insights MCP Server is a server based on the Model Context Protocol (MCP) that allows Claude and other MCP-compatible clients to interact with your Audiense Insights account
Bankless Onchain MCP Server
Bringing the bankless onchain API to MCP
Submit Your MCP Server
Share your MCP server with the community
Submit Now