Documentation · English and Portuguese · Open source
Language: English

All docs Claude Desktop and Code

Agents

Claude Desktop and Claude Code

Status: documented (follows the official docs; not yet run end to end).

Official docs used: Claude Code MCP, Claude Code permissions, Claude Code routines, Claude Code channels, connect local servers (Claude Desktop), custom remote connectors, mcp-remote.

What you get

  • Pull (both): ask Claude about today's briefing, one category of it or past stories, and change what you follow.
  • Push (Claude Code): Herald fires a Claude Code routine through its API trigger when a briefing is published; the routine starts a cloud session with the briefing in its input. Claude Desktop has no inbound webhook.

Pull: MCP

Claude Code

Same machine (stdio):

claude mcp add --transport stdio --env HERALD_CONFIG=/path/to/herald/config.json herald -- /path/to/herald/.venv/bin/herald-mcp

Keep an option such as --transport stdio between --env and the name: --env takes several KEY=value pairs and would read the name as another one.

Another machine (streamable HTTP). Run uv run herald-mcp --http next to Herald (see the index), then:

claude mcp add --transport http herald https://herald.example.com/mcp --header "Authorization: Bearer $HERALD_MCP_TOKEN"

To share the server with a repository instead, use .mcp.json in its root (--scope project); Claude Code expands ${HERALD_MCP_TOKEN} from the environment:

{
  "mcpServers": {
    "herald": {
      "type": "http",
      "url": "https://herald.example.com/mcp",
      "headers": { "Authorization": "Bearer ${HERALD_MCP_TOKEN}" }
    }
  }
}

Tools to allow. Pre-approve the read-only tools in .claude/settings.json; Claude Code still asks before herald_follow / herald_unfollow:

{
  "permissions": {
    "allow": [
      "mcp__herald__herald_briefing",
      "mcp__herald__herald_categories",
      "mcp__herald__herald_history_search"
    ]
  }
}

Claude Desktop

Edit claude_desktop_config.json (macOS: ~/Library/Application Support/Claude/, Windows: %APPDATA%\Claude\) and restart Desktop completely.

Same machine (stdio):

{
  "mcpServers": {
    "herald": {
      "command": "/path/to/herald/.venv/bin/herald-mcp",
      "env": { "HERALD_CONFIG": "/path/to/herald/config.json" }
    }
  }
}

Another machine. A custom connector (Settings > Connectors) needs a public HTTPS URL, and static request headers there are a beta that not every organization has. The portable way is the mcp-remote bridge, which Desktop runs over stdio and which adds the bearer header:

{
  "mcpServers": {
    "herald": {
      "command": "npx",
      "args": ["mcp-remote", "https://herald.example.com/mcp", "--header", "Authorization:${HERALD_AUTH}"],
      "env": { "HERALD_AUTH": "Bearer <HERALD_MCP_TOKEN>" }
    }
  }
}

(Writing the header without a space after : and keeping Bearer ... in the variable avoids an argument-escaping bug on Windows.) Desktop asks before each tool call; there is no per-tool allow list in the file.

Push: webhook (Claude Code routine)

1. Create the routine on the web (see routines), with a prompt that says to act on the input, for example: "The input is today's Herald briefing. Pick the five items that matter most for me, one line each, with links." Add an API trigger: it shows the routine's URL (https://api.anthropic.com/v1/claude_code/routines/trig_.../fire) and a token, once. The token belongs to that routine only; it is not your Claude login.

2. Point Herald at it. The trigger takes {"text": ...} with bearer auth and two Anthropic headers. In Herald's .env: CLAUDE_ROUTINE_URL (the /fire URL) and CLAUDE_ROUTINE_TOKEN.

{
  "type": "webhook",
  "enabled": true,
  "name": "claude-routine",
  "languages": ["en"],
  "url": "${CLAUDE_ROUTINE_URL}",
  "auth": { "type": "bearer", "token": "${CLAUDE_ROUTINE_TOKEN}" },
  "headers": {
    "anthropic-beta": "experimental-cc-routine-2026-04-01",
    "anthropic-version": "2023-06-01"
  },
  "events": ["briefing.published"],
  "template": "{\"text\": \"$title ($count stories)\\n\\n$markdown\"}"
}

The beta header value comes from the routines docs at the time of writing; if the trigger starts answering 400, check the docs for the current value. Every delivery starts a new cloud session, and Herald retries on 5xx and 429, so a retried delivery can start a second session.

Alternative: channels. Claude Code channels (a research preview) push events into an open interactive session through a local MCP server; the docs include a webhook receiver example. It only works while that session is open, so a routine fits a daily briefing better.

Troubleshooting

Symptom Cause
claude mcp list shows herald as failed wrong path to herald-mcp, or (HTTP) the server is not running or the URL does not end in /mcp
401 from herald-mcp --http the bearer differs from Herald's HERALD_MCP_TOKEN; in .mcp.json use your own variable name, since Claude Code blanks some credential variables (such as ANTHROPIC_API_KEY) in remote headers
Desktop shows no Herald tools config edited but Desktop not fully restarted, or invalid JSON in the file
Run report: webhook:claude-routine HTTP 401 wrong or regenerated routine token
The routine ignores the briefing the input arrives marked as untrusted; the routine prompt must say to act on it

Testing without Claude

uv run herald dev sink --port 8787 --token "$CLAUDE_ROUTINE_TOKEN" --out herald-sink
# CLAUDE_ROUTINE_URL=http://127.0.0.1:8787/ in .env
uv run herald --data-dir /tmp/herald-try run --hours 6

The sink checks the bearer token and saves the {"text": ...} body as herald-sink/evt_<id>.json. Replay it to the routine once you are happy with it:

curl -i -X POST "$CLAUDE_ROUTINE_FIRE_URL" \
  -H "Authorization: Bearer $CLAUDE_ROUTINE_TOKEN" \
  -H "anthropic-beta: experimental-cc-routine-2026-04-01" -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" --data-binary @herald-sink/evt_<id>.json