A Node.js implementation of the Kagi MCP server that provides web search capabilities to AI assistants using the Kagi search API.
kagi_web_search
) to avoid conflicts with other MCP serversBefore anything, ensure you have access to the search API. It is currently in closed beta and available upon request. Please reach out to support@kagi.com for an invite.
You can run the server directly without installing it using npx:
KAGI_API_KEY=your_api_key_here npx github:elliottlawson/kagi-mcp-server
git clone https://github.com/elliottlawson/kagi-mcp-server.git
cd kagi-mcp-server
KAGI_API_KEY=your_api_key_here node build/index.js
If you want to modify the code, you'll need to install dependencies and rebuild:
npm install
npm run build
Add the following MCP config to your Claude Desktop configuration:
{
"mcpServers": {
"kagi": {
"command": "npx",
"args": ["github:elliottlawson/kagi-mcp-server"],
"env": {
"KAGI_API_KEY": "YOUR_API_KEY_HERE"
}
}
}
}
Alternatively, if you've cloned the repository:
{
"mcpServers": {
"kagi": {
"command": "node",
"args": ["ABSOLUTE_PATH_TO_REPO/build/index.js"],
"env": {
"KAGI_API_KEY": "YOUR_API_KEY_HERE"
}
}
}
}
For example: "Use Kagi to search for who was time's 2024 person of the year?"
The AI will use the kagi_web_search
tool to perform the search, avoiding conflicts with other search tools.
Run the MCP Inspector to debug the server:
npx @modelcontextprotocol/inspector npx github:elliottlawson/kagi-mcp-server
Or if you've cloned the repository:
npx @modelcontextprotocol/inspector node build/index.js
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-mcp-server/
├── src/
│ ├── index.ts # Main entry point
│ ├── kagi-client.ts # Kagi API client
│ └── utils/
│ └── formatter.ts # Result formatting utilities
├── build/ # Pre-built JavaScript files
│ ├── index.js # Executable entry point
│ ├── kagi-client.js
│ └── utils/
│ └── formatter.js
├── package.json
├── tsconfig.json
└── README.md
If you make changes to the TypeScript code, rebuild the project:
npm run build
To run the server:
npm start
DEBUG
environment variablekagi_web_search
to avoid conflicts with other MCP servers that might have a generic search
toolSeamless access to top MCP servers powering the future of AI integration.