Skip to main content

caddyglow-kagi-mcp

MCP server that exposes Kagi services through the Python client shipped by kagi-cli.

Requirements

  • Python 3.12+
  • uv
  • A valid KAGI_SESSION value from your Kagi session link

You can provide KAGI_SESSION through the environment or through a project-local .env file:

KAGI_SESSION="your_session_value_from_link"

Install

uv sync

Run

export KAGI_SESSION="your_session_value_from_link"
uv run kagi-mcp

Or, with .env present:

uv run kagi-mcp

Run without a persistent project environment:

KAGI_SESSION="your_session_value_from_link" uvx caddyglow-kagi-mcp

Run from this checkout with uvx:

KAGI_SESSION="your_session_value_from_link" uvx --from /home/rick/projects-caddy/kagi-mcp kagi-mcp

Check the installed version:

uvx caddyglow-kagi-mcp --version

The server communicates over stdio for MCP clients.

Logging is written to stderr so it does not corrupt MCP stdio messages. The default log level is WARNING; set KAGI_MCP_LOG_LEVEL to INFO or DEBUG when troubleshooting:

KAGI_MCP_LOG_LEVEL=INFO uv run kagi-mcp

HTTP and SSE Transports

Stdio is the default transport. For HTTP clients, run the server with either streamable HTTP or SSE:

KAGI_SESSION="your_session_value_from_link" \
KAGI_MCP_TRANSPORT=streamable-http \
KAGI_MCP_HOST=127.0.0.1 \
KAGI_MCP_PORT=8765 \
uvx caddyglow-kagi-mcp

The streamable HTTP endpoint is:

http://127.0.0.1:8765/mcp

SSE is also supported:

KAGI_SESSION="your_session_value_from_link" \
KAGI_MCP_TRANSPORT=sse \
KAGI_MCP_HOST=127.0.0.1 \
KAGI_MCP_PORT=8765 \
uvx caddyglow-kagi-mcp

The SSE endpoint is:

http://127.0.0.1:8765/sse

Equivalent CLI flags are available:

uvx caddyglow-kagi-mcp --transport streamable-http --host 127.0.0.1 --port 8765

MCP Tools

  • kagi_search(query, fetch_all=False)
  • kagi_ask(text, model="gpt-5-mini", thread=None, internet=True)
  • kagi_summarize(url, summary_type="takeaway")
  • kagi_proofread(text, lang="auto", style="general", level="standard", formality="default", context=None, model="standard")

Each tool calls the kagi_client library directly and returns MCP-friendly dictionaries.

Codex Example

For stdio, add this to ~/.codex/config.toml:

[mcp_servers.kagi]
command = "uvx"
args = ["caddyglow-kagi-mcp"]

[mcp_servers.kagi.env]
KAGI_SESSION = "your_session_value_from_link"
KAGI_MCP_LOG_LEVEL = "WARNING"

For streamable HTTP, start the server separately:

KAGI_SESSION="your_session_value_from_link" \
KAGI_MCP_TRANSPORT=streamable-http \
KAGI_MCP_PORT=8765 \
uvx caddyglow-kagi-mcp

Then add this to ~/.codex/config.toml:

[mcp_servers.kagi]
url = "http://127.0.0.1:8765/mcp"

For SSE, use:

[mcp_servers.kagi]
url = "http://127.0.0.1:8765/sse"

Claude Desktop Example

From this checkout, add the server with the Claude CLI:

claude mcp add kagi \
  --env KAGI_SESSION="your_session_value_from_link" \
  -- uv --directory /home/rick/projects-caddy/kagi-mcp run kagi-mcp

Using uvx instead:

claude mcp add kagi \
  --env KAGI_SESSION="your_session_value_from_link" \
  -- uvx caddyglow-kagi-mcp

Or add the equivalent JSON manually:

{
  "mcpServers": {
    "kagi": {
      "command": "uv",
      "args": ["--directory", "/home/rick/projects-caddy/kagi-mcp", "run", "kagi-mcp"],
      "env": {
        "KAGI_SESSION": "your_session_value_from_link",
        "KAGI_MCP_LOG_LEVEL": "WARNING"
      }
    }
  }
}

Development

uv run pytest
uv run ruff check .

Metadata

Release files for caddyglow-kagi-mcp 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for caddyglow-kagi-mcp 0.1.0
File Size Uploaded Provenance
caddyglow_kagi_mcp-0.1.0.tar.gz 3.9 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for caddyglow-kagi-mcp 0.1.0
File Interpreter ABI Platform
caddyglow_kagi_mcp-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 9.1 kB

Release files / caddyglow_kagi_mcp-0.1.0.tar.gz

Download URL caddyglow_kagi_mcp-0.1.0.tar.gz
Size 3.9 kB
Tags Source
SHA-256 checksum
How to use checksums
ae65b72ef7271bdda45372f23cfbdc367c4f0c765269b64a307322db2b844a3b
BLAKE2b-256 checksum
How to use checksums
8a40f090d4bad405eb6412b5f04c238c92b0a373c5afce1fd132b5b15d074024
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / caddyglow_kagi_mcp-0.1.0-py3-none-any.whl

Download URL caddyglow_kagi_mcp-0.1.0-py3-none-any.whl
Size 5.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
97b5ce2c56ef135b062fe1ed7edc20cf09ea0ea6b8fde830aa5a6f48af67c6c2
BLAKE2b-256 checksum
How to use checksums
8df8e13b491e023edc934a5569eff2d38635a2a67d7b38fe182e913032f9283f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for caddyglow-kagi-mcp 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page