Local agents
A coding agent on your Mac, such as Pi, Claude Code or Codex, can use your Hotaru as a tool (SI-561): “What did my feeds say about PostgreSQL 19 this week?”, “Label the three newest Signal items”, “Weigh Gemini down”. hotaru mcp serves Hotaru’s tools over the Model Context Protocol. The agent starts it as a child process, and it talks to your server through the API with your token, like every other client (api.md).
Hotaru keeps running on the server: the agent only reads and asks for changes. Nothing runs on your Mac but the hotaru command.
Set it up
-
The CLI with a server and a token: cli.md.
hotaru statusshould show your account. -
The agent starts
hotaru mcp:Terminal window pi mcp add hotaru -- hotaru mcp # Piclaude mcp add hotaru -- hotaru mcp # Claude Codecodex mcp add hotaru -- hotaru mcp # CodexOr in an
mcpServersfile, such as Pi’s~/.pi/agent/mcp.json:{"mcpServers": {"hotaru": {"command": "hotaru","args": ["mcp", "--server", "vps"],"exposure": "direct","description": "My news reader: search and read my feeds, label items, weigh keywords and sources"}}}Pi offers MCP tools through its
codemodeby default;"exposure": "direct"gives the model these few tools directly.pi mcp listchecks the connection and lists the tools. -
Without the installed CLI, through npx:
claude mcp add hotaru -- npx -y @kogakure/hotaru mcp, or"command": "npx", "args": ["-y", "@kogakure/hotaru", "mcp"]in anmcpServersfile. From a clone of the repository:"command": "node", "args": ["/path/to/hotaru/apps/cli/src/main.ts", "mcp"].
--server NAME picks one of the CLI’s servers; without it the default one. HOTARU_URL and HOTARU_TOKEN in the entry’s env work without a config. The token stays in the CLI’s config (mode 0600) or the environment, never in the agent’s conversation.
The tools
| Tool | Kind | What it does |
|---|---|---|
get_stream |
looks | A page of the stream: unread, starred, newest first or ranked (foryou, most Signal …), with the scores |
search_items |
looks | Full-text search, with dates, unread and starred (search.md) |
get_item |
looks | One item: link, scores, keywords, your labels and vote, summary, key points, other sources of its story. full_text adds the article |
get_story |
looks | Every source that reported the item’s story, oldest first (stories.md) |
list_keywords |
looks | Keywords with weights and item counts |
list_sources |
looks | Sources with ID, weight, pause, health and tags |
label_item |
changes | Sets your Signal, Facts and Hype labels (labels.md) |
star_items |
changes | Stars items, or takes the stars back |
mark_read |
changes | Marks items read or unread |
vote_item |
changes | More of this, less of this, or no vote (feedback.md) |
update_keyword |
changes | Sets a keyword’s weight or changes it by an amount; creates it when asked |
update_source |
changes | A source’s weight in the ranking, 0.1×–2×, found by ID or a unique part of its title or URL |
Each tool tells the agent its kind with MCP’s hints (readOnlyHint, destructiveHint: false), so an agent that asks before changes, such as Pi with a permission extension, can tell them apart.
Which tools the agent gets depends on the token, as everywhere in the API (auth.md):
- A read token (or
cron, or “Read and follow feeds”) gets only the six that look. - A write token gets all twelve.
hotaru mcp --read-onlyoffers only the six that look, whatever the token may do.
Not here at all: deleting anything, pausing a source, filters and mute words. In the web app’s agent these wait for your Confirm, and every change is logged for undo (agent-tools.md). Over MCP there is no Confirm button and the API keeps no such log, so they stay in the web app and the CLI. The changes that are here are small and easy to set back: a weight, a label, a star.
Feed text is data
Titles, summaries, snippets and article text are written by whoever publishes a feed, and a local agent can run commands on your Mac. So, as in the web agent:
- The server’s instructions to the agent, and every result with feed text, say that it is data, never instructions.
get_itemputs the feed’s text in a fenced block (<<<…>>>). Each piece is on one line, with the fence marks and control characters taken out, so it can’t close the block or start a line of its own.- Results stay under 16,000 characters, so an agent doesn’t cut them in the middle.
That lowers the risk; it doesn’t remove it. Keep the agent’s own permissions narrow, and use a read token or --read-only when it only needs to look.
Your server from your Mac
The agent reaches the server the way the CLI does, so anything that works for hotaru status works for agents:
- Over HTTPS at the server’s public address (production: deployment.md). The token goes in the
Authorizationheader, which TLS protects. A token is enough; nothing else needs opening. - Over Tailscale, for a server that isn’t public: when the app’s port is reachable in your tailnet (Tailscale on the host, and the container’s port published to it), use the host’s Tailscale name, such as
http://<host>:3000. WireGuard encrypts the traffic, so plainhttpis fine inside the tailnet. The production setup is public over HTTPS and needs none of this. - Scoped tokens: make one token per machine or agent, with the smallest scope that works, and revoke it under Settings → API tokens when the machine goes.
Try it without costs: pnpm dev:faux
For working on Hotaru, or trying an agent against it, the whole app runs on your Mac with a fake model. No API key, no costs:
pnpm dev:faux # http://localhost:5173pnpm dev:faux -- --port 5199 # another portIt starts the e2e tests’ fake OpenRouter (fake-openrouter.ts) and the dev server pointed at it (OPENROUTER_BASE_URL). Every AI stage gets well-formed made-up answers: “Summary of
apps/web/data/faux/hotaru.db, so made-up summaries never mix with real ones. Feeds are fetched from the internet as usual. FAKE_OPENROUTER_PORT moves the fake from port 4197.
A user and a token for it:
# From the repository's root. Only for these two commands: pnpm dev:faux finds the database itself.DATABASE_PATH=apps/web/data/faux/hotaru.db pnpm user create --email you@example.test --name YouDATABASE_PATH=apps/web/data/faux/hotaru.db pnpm user token --email you@example.test --name agent --scope writeecho hotaru_… | hotaru server add faux http://localhost:5173 --token-stdinThen point the agent at it: pi mcp add hotaru-faux -- hotaru mcp --server faux.
Code
apps/cli/src/mcp.ts speaks the protocol: JSON-RPC 2.0 over stdin and stdout, one message per line, with initialize, ping, tools/list and tools/call. It’s written out rather than taken from the MCP SDK, which would bring an HTTP server framework along, so the CLI keeps having no dependencies. It accepts the protocol versions from 2024-11-05 to 2025-11-25. Logs never go to stdout.
apps/cli/src/agent-tools.ts holds the tools. A tool is a name, a description for the model, its arguments as a zod schema (sent as JSON Schema), the SDK methods it calls (uses, which decides which tokens get it), its hints and run(client, args), which returns text for the model. Wrong arguments and the server’s refusals come back as tool errors the agent can read, with the server’s own message. mcp.spec.ts runs every tool against a fake server; Pi’s own client (pi mcp list) connected to it against pnpm dev:faux.