feat(mcp): expose CLI-parity Kagi tools#130
Conversation
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
There was a problem hiding this comment.
💡 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".
c86bfd1 to
703883b
Compare
703883b to
f3ebbf6
Compare
There was a problem hiding this comment.
💡 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".
| 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)?; |
There was a problem hiding this comment.
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 👍 / 👎.
| } | ||
|
|
||
| if name == "kagi_cli" { | ||
| return mcp_cli_passthrough(arguments, config); |
There was a problem hiding this comment.
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 👍 / 👎.
What changed
kagi mcpfrom the initial small tool set to CLI-parity Kagi tooling.--default-output <format>so MCP calls can default to formats liketoon.--enable-mutating-tools.Validation
cargo checkcargo test mcp_ --test integration-cli -- --nocapturecargo test