Skip to content

feat(mcp): expose CLI-parity Kagi tools#130

Merged
Microck merged 1 commit into
mainfrom
feat/mcp-cli-parity
Jun 29, 2026
Merged

feat(mcp): expose CLI-parity Kagi tools#130
Microck merged 1 commit into
mainfrom
feat/mcp-cli-parity

Conversation

@Microck

@Microck Microck commented Jun 28, 2026

Copy link
Copy Markdown
Owner

What changed

  • Expands kagi mcp from the initial small tool set to CLI-parity Kagi tooling.
  • Adds --default-output <format> so MCP calls can default to formats like toon.
  • Gates account/local-state mutation tools behind --enable-mutating-tools.
  • Adds robust JSON-RPC parse error handling and unsupported-tool errors.
  • Documents the expanded MCP surface and updates coverage docs.

Validation

  • cargo check
  • cargo test mcp_ --test integration-cli -- --nocapture
  • cargo test

@mintlify

mintlify Bot commented Jun 28, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
kagi-cli 🟡 Building Jun 28, 2026, 11:56 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 32774a06f6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/main.rs
Comment thread src/main.rs Outdated
Comment thread src/main.rs Outdated
Comment thread src/main.rs Outdated
@Microck Microck force-pushed the feat/mcp-cli-parity branch 2 times, most recently from c86bfd1 to 703883b Compare June 29, 2026 00:07
@Microck Microck force-pushed the feat/mcp-cli-parity branch from 703883b to f3ebbf6 Compare June 29, 2026 00:11
@Microck Microck enabled auto-merge (squash) June 29, 2026 00:13
@Microck Microck merged commit 60ccf61 into main Jun 29, 2026
5 checks passed
@Microck Microck deleted the feat/mcp-cli-parity branch June 29, 2026 00:16

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f3ebbf6579

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/main.rs
let format = mcp_output_format(arguments, &config.default_output_or(OutputFormat::Json))?;
if mcp_bool(arguments, "news") {
let token = resolve_session_token(profile)?;
let request = mcp_news_search_request(arguments)?;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Map kagi_search news time into freshness

When a client uses kagi_search with news: true, the advertised schema exposes the recency filter as time (the CLI flag name), but this branch passes the raw arguments to mcp_news_search_request, which only reads freshness. Requests such as {"news":true,"query":"rust","time":"day"} therefore drop the recency filter and search all news; map time to NewsFreshness here or expose/read the same field name.

Useful? React with 👍 / 👎.

Comment thread src/main.rs
}

if name == "kagi_cli" {
return mcp_cli_passthrough(arguments, config);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Pass selected profile to passthrough commands

When the server is started with a named profile (e.g. kagi mcp --profile work), the structured tools use the profile argument passed into mcp_mutating_tool_call, but kagi_cli drops it here and launches the child with only the requested args. Passthrough commands that read or write auth/profile-scoped state (auth status, search, auth set) then fall back to the default profile or mutate it instead of the selected one, so the escape hatch can use the wrong account; pass the selected profile through to the child command.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant