From cde36c87101ca84bf7601932e45296c5138172cd Mon Sep 17 00:00:00 2001 From: Phil Date: Wed, 11 Nov 2026 09:16:13 -0700 Subject: [PATCH] Mac: Hermes web search through Kagi's hosted MCP server Hermes's built-in web search was the free Brave API, which returns 429s under agent bursts; real-user reports (Hermes #80201, PR #36838, HN) also rule out self-hosted SearXNG for always-on use. The user has Kagi, so: - Kagi's own hosted MCP server (https://mcp.kagi.com/mcp, Bearer API key, paid API with a monthly cap set in Kagi). Its two tools, kagi_search_fetch and kagi_extract, are marked read-only, so trust: untrusted never asks. - agent.disabled_toolsets gains `web`, removing the built-in web_search/web_extract everywhere, so Kagi is the only search path. - KAGI_API_KEY from the vault into ~/.hermes/.env. Co-Authored-By: Claude Opus 5.5 --- group_vars/mac/main.yml | 23 ++++++++++++++++++++--- roles/mac/README.md | 3 ++- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/group_vars/mac/main.yml b/group_vars/mac/main.yml index d73253e..6fd4433 100644 --- a/group_vars/mac/main.yml +++ b/group_vars/mac/main.yml @@ -38,9 +38,11 @@ hermes_settings: # a host cwd never becomes the container's working directory anyway. terminal.cwd: . terminal.container_memory: 3072 # MB; must fit in the Podman VM (podman_machine_memory) - # Kanban is for multi-agent boards (unused here) and its 14 tools were 25 KB - # of the 65 KB of tool definitions sent with every message. - agent.disabled_toolsets: [kanban] + # kanban: multi-agent boards (unused here); its 14 tools were 25 KB of the + # 65 KB of tool definitions sent with every message. + # web: Hermes's built-in web_search/web_extract (was the free Brave API, + # rate-limited). Search and page fetching go through Kagi's MCP server. + agent.disabled_toolsets: [kanban, web] skills.write_approval: true # skills Hermes writes wait for your approval # Never run these, even in the sandbox and even under /yolo (examples from # Hermes's hardening guide). Case-insensitive globs over the whole command. @@ -92,6 +94,7 @@ hermes_settings: delegation.model: deepseek/deepseek-v4.1-flash mcp_servers.karakeep: "{{ hermes_mcp_karakeep }}" + mcp_servers.kagi: "{{ hermes_mcp_kagi }}" # MCP servers. Each stdio server runs in a throwaway Podman container (not on # the Mac itself); secrets come from ~/.hermes/.env (hermes_env_secrets) and @@ -129,9 +132,23 @@ hermes_mcp_karakeep: resources: false prompts: false +# Kagi (web search and page fetching), Kagi's own hosted MCP server: nothing +# runs on the Mac. Paid API, $12/1k searches and $4/1k pages, prepaid with a +# monthly cap set in Kagi. Both tools are marked read-only, so "untrusted" +# never asks. https://kagi.com/api/docs/openapi/section/mcp +hermes_mcp_kagi: + url: https://mcp.kagi.com/mcp + headers: + Authorization: "Bearer ${KAGI_API_KEY}" + trust: untrusted + tools: + resources: false + prompts: false + # Secrets written to ~/.hermes/.env (single-quoted), from the vault. hermes_env_secrets: KARAKEEP_API_KEY: "{{ vault_cogitator02.karakeep_api_key }}" + KAGI_API_KEY: "{{ vault_cogitator02.kagi_api_key }}" # Keys `hermes config set` refuses without --force although Hermes reads them # (agent.reasoning_effort: hermes-agent #140221). diff --git a/roles/mac/README.md b/roles/mac/README.md index a6a7006..f081ab5 100644 --- a/roles/mac/README.md +++ b/roles/mac/README.md @@ -36,7 +36,8 @@ Manages cogitator-02, an Apple Silicon Mac on the tailnet (`mac.yml`, `mcp_servers.` entries in `hermes_settings`, each running in a throwaway Podman container. Secrets they need are in `hermes_env_secrets` (from the vault) and written to `~/.hermes/.env`. Today: Karakeep, with - only search/read/create/tag tools registered. + only search/read/create/tag tools registered, and Kagi's hosted server for + web search and page fetching (Hermes's built-in `web` toolset is off). - **Podman VM** (tag `podman`): a launchd job (`local.podman-machine`) that starts the VM running Hermes's sandbox at login, and `podman_machine_memory` for its size. A resize stops the VM and starts it again through that job.