# Kagi Session Mcp

> An MCP server that lets your agent search Kagi using your existing browser session.

- **Type:** MCP server
- **Install:** `agentstack add mcp-checksumdev-kagi-session-mcp`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [ChecksumDev](https://agentstack.voostack.com/s/checksumdev)
- **Installs:** 0
- **Category:** [Web & Browser](https://agentstack.voostack.com/c/web-and-browser)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [ChecksumDev](https://github.com/ChecksumDev)
- **Source:** https://github.com/ChecksumDev/kagi-session-mcp

## Install

```sh
agentstack add mcp-checksumdev-kagi-session-mcp
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# kagi-session-mcp

An MCP server that lets your agent search [Kagi](https://kagi.com) using your existing browser session. No API key, no extra subscription, no extra config: it reads the Kagi cookie from whatever browser you're already logged into.

## Install

Until the first crates.io release, install straight from git:

```sh
cargo install --git https://github.com/checksumdev/kagi-session-mcp --locked
```

This builds and drops `kagi-session-mcp` in `~/.cargo/bin`, which is already on your `PATH` if cargo is set up normally. The `--locked` flag reuses the repo's `Cargo.lock` so you get the same dependency versions that CI tested with. To pin further:

```sh
# pin to a release tag
cargo install --git https://github.com/checksumdev/kagi-session-mcp --tag v0.1.0 --locked

# pin to a specific commit
cargo install --git https://github.com/checksumdev/kagi-session-mcp --rev  --locked
```

Or build locally:

```sh
git clone https://github.com/checksumdev/kagi-session-mcp
cd kagi-session-mcp
cargo build --release
```

The binary ends up at `target/release/kagi-session-mcp`.

## Configure your client

The server speaks plain MCP over stdio, so it works anywhere stdio-based MCP is supported. Click your client:

Claude Desktop

Edit `claude_desktop_config.json`:

- macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
- Windows: `%APPDATA%\Claude\claude_desktop_config.json`

```json
{
  "mcpServers": {
    "kagi": {
      "command": "kagi-session-mcp"
    }
  }
}
```

Restart Claude.

Claude Code

```sh
claude mcp add kagi -- kagi-session-mcp
```

Cursor

Edit `~/.cursor/mcp.json` (or the project-local `.cursor/mcp.json`):

```json
{
  "mcpServers": {
    "kagi": {
      "command": "kagi-session-mcp"
    }
  }
}
```

VS Code

Edit `.vscode/mcp.json` in your workspace (or the user-level equivalent):

```json
{
  "servers": {
    "kagi": {
      "type": "stdio",
      "command": "kagi-session-mcp"
    }
  }
}
```

Windsurf

Edit `~/.codeium/windsurf/mcp_config.json`:

```json
{
  "mcpServers": {
    "kagi": {
      "command": "kagi-session-mcp"
    }
  }
}
```

Cline

In Cline's settings, open `cline_mcp_settings.json` and add:

```json
{
  "mcpServers": {
    "kagi": {
      "command": "kagi-session-mcp",
      "disabled": false
    }
  }
}
```

Continue

Edit `~/.continue/config.json`:

```json
{
  "experimental": {
    "modelContextProtocolServers": [
      { "transport": { "type": "stdio", "command": "kagi-session-mcp" } }
    ]
  }
}
```

Zed

In `~/.config/zed/settings.json`:

```json
{
  "context_servers": {
    "kagi": {
      "command": { "path": "kagi-session-mcp", "args": [] }
    }
  }
}
```

Gemini CLI, OpenCode, anything else

Anything that speaks stdio MCP works. Just point it at `kagi-session-mcp` with no arguments.

## Manual session token

If your browser is locked down (Chrome v20 ABE, headless setups, sandboxed profiles) you can paste a Session Link token from `kagi.com/settings?p=user_details`:

```json
{
  "mcpServers": {
    "kagi": {
      "command": "kagi-session-mcp",
      "env": { "KAGI_SESSION_TOKEN": "your-session-link-token" }
    }
  }
}
```

## Tools

| Tool | What it does |
| ---- | ------------ |
| `kagi_search` | Web search with operators, lens, time/region/safe filters, pagination |
| `kagi_fastgpt` | Grounded one-shot Q&A with inline `[N]` citations |
| `kagi_wikipedia` | Knowledge-panel lookup |
| `kagi_suggest` | Autocomplete |
| `kagi_news` / `kagi_images` / `kagi_videos` / `kagi_podcasts` | Per-vertical search |
| `kagi_list_lenses` | List the user's configured Kagi Lenses |
| `kagi_fetch` | Authenticated URL fetch (cookie only sent to kagi.com) |
| `kagi_status` | Report which session was discovered and how |

`kagi_search` accepts `query`, `limit`, `page`, `time` (day/week/month/year), `region` (e.g. `us`, `de`), `safe` (off/moderate/strict), and `lens` (toolbar slot 0..7). It supports the full Kagi operator set: `site:`, `filetype:`, `-exclude`, `"exact phrase"`, `before:YYYY-MM-DD`, and `after:YYYY-MM-DD`.

## Troubleshooting

Run `kagi_status` from your agent. If `session_found` is false:

- **`App-Bound Encryption`** (Chrome 127+): the cookie can't be decrypted from outside the browser. Use `KAGI_SESSION_TOKEN` instead.
- **`no kagi session found`**: log in to Kagi in any supported browser, then retry.
- **`session was found but kagi rejected it`**: cookie expired. Reload Kagi in the browser, then retry.

For deeper logs, set `RUST_LOG=kagi_session_mcp=debug` and re-launch the host. Logs go to stderr (stdout is reserved for the MCP JSON-RPC frames).

## Contributing

PRs welcome. There's a short [CONTRIBUTING.md](./CONTRIBUTING.md) covering issue conventions, commit format, and how to handle Kagi changing its markup or routes, which is the most common reason this repo needs patches.

## License

MIT. See the [LICENSE](./LICENSE) file for details.

## Sponsor

If this saves your agent some search time, you can buy me a coffee on [Ko-fi](https://ko-fi.com/checksum). And please pay for Kagi too: agentic search is exactly the kind of usage that funds the work they do.

## Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [ChecksumDev](https://github.com/ChecksumDev)
- **Source:** [ChecksumDev/kagi-session-mcp](https://github.com/ChecksumDev/kagi-session-mcp)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** yes
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/mcp-checksumdev-kagi-session-mcp
- Seller: https://agentstack.voostack.com/s/checksumdev
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
