{
  "markdown": "# @heuresis/mcp\n\nA Model Context Protocol (MCP) server that exposes a Heuresis workspace\nto any MCP-capable client (Claude Desktop, Claude Code, Cursor,\nWindsurf, custom agents). The server logs into the user's Heuresis\naccount, talks to the same Supabase project the webapp talks to, and\nrespects the same RLS. Webapp and MCP are two front-ends to one cloud\nworkspace.\n\nCurrent version: `1.0.0-rc.13`.\n\n## Install\n\n```bash\nnpm install -g @heuresis/mcp\n# or on demand without installing:\nnpx -y @heuresis/mcp\n```\n\n> **Package name vs. command name.** The npm package is `@heuresis/mcp`; the\n> command it installs is `heuresis-mcp`. A bare `npx -y @heuresis/mcp` (no\n> subcommand) starts the MCP server fine, but `npx @heuresis/mcp login` can\n> fail with `heuresis-mcp: not found` because npx derives the command name\n> from the scope-stripped package name (`mcp`), which doesn't match. To run a\n> subcommand reliably on every npm/OS, name the binary explicitly with `-p`:\n>\n> ```bash\n> npx -y -p @heuresis/mcp heuresis-mcp login\n> ```\n\n## Quickstart\n\n### 1. Link this machine to your Heuresis account\n\n```bash\nnpx -y -p @heuresis/mcp heuresis-mcp login\n```\n\nThe CLI prints a device code and a one-click URL of the form\n`https://heuresis.app/device?code=XXXX-XXXX`. Open it in your browser,\nsign in if you aren't already, and confirm the device. The CLI polls\nin the background and writes credentials to\n`~/.heuresis/credentials.json` (chmod 600 on POSIX) the moment you\nconfirm. Subsequent runs of the MCP are silent.\n\nThe login flow rides three Supabase Edge Functions:\n`mcp-device-init`, `mcp-device-grant`, and `mcp-device-poll`.\n\nTo unlink a machine: `npx -y -p @heuresis/mcp heuresis-mcp logout`, or open\nSettings ▸ Connected devices in the webapp to revoke remotely.\n\n`npx -y -p @heuresis/mcp heuresis-mcp whoami` confirms which account a machine\nis currently linked to.\n\n### 2. Point your MCP client at it\n\n**Claude Desktop.** Edit\n`~/Library/Application Support/Claude/claude_desktop_config.json` on\nmacOS, or `%APPDATA%/Claude/claude_desktop_config.json` on Windows:\n\n```json\n{\n  \"mcpServers\": {\n    \"heuresis\": { \"command\": \"npx\", \"args\": [\"-y\", \"@heuresis/mcp\"] }\n  }\n}\n```\n\n**Claude Code / Cursor / Windsurf.** Drop a `.mcp.json` in the\nworkspace root:\n\n```json\n{\n  \"mcpServers\": {\n    \"heuresis\": { \"command\": \"npx\", \"args\": [\"-y\", \"@heuresis/mcp\"] }\n  }\n}\n```\n\nRestart the client. The Heuresis tools appear in the tool menu.\n\n### 3. CLI subcommands\n\n```bash\nnpx -y -p @heuresis/mcp heuresis-mcp whoami   # show the linked account + device\nnpx -y -p @heuresis/mcp heuresis-mcp logout   # delete the credentials file\nnpx -y -p @heuresis/mcp heuresis-mcp --help   # all options\nnpx -y @heuresis/mcp --no-realtime            # boot the server with live sync off (persisted)\nnpx -y @heuresis/mcp --realtime               # re-enable live sync\n```\n\n## Headless mode (CI, cloud agents, disposable containers)\n\nDevice pairing writes a **refresh token** to disk. That works great on a\npersonal machine, but it does **not** survive disposable/ephemeral\nenvironments (CI runners, cloud agent containers, \"Claude Code on the web\"):\nthe filesystem is wiped between runs, and a Supabase refresh token is\n**single-use under rotation** — so a token baked into config dies after the\nfirst session.\n\nFor those environments, skip pairing and let the server **sign in fresh on\nevery boot** from your account email + password (a password is not consumed on\nuse, so it works forever with no re-pairing). Set three env vars:\n\n```bash\nHEURESIS_EMAIL=you@example.com          # your Heuresis account email\nHEURESIS_PASSWORD=your-account-password # secret — store it in a secrets manager\nHEURESIS_ANON_KEY=sb_publishable_...    # project anon/publishable key (public, not a secret)\n# optional: HEURESIS_SUPABASE_URL=...   # defaults to the production project\n```\n\nWhen `HEURESIS_EMAIL` + `HEURESIS_PASSWORD` are present they take precedence\nover any `credentials.json`, and the MCP server authenticates per boot — no\ndevice link required. Requirements:\n\n- Email + password sign-in must be enabled for the Supabase project, and the\n  account must have a password set (passwordless / magic-link-only accounts\n  need a password added first).\n- Treat `HEURESIS_PASSWORD` as a secret. Prefer a dedicated account if your\n  environment can only expose env vars that are visible to its users.\n\n## Live sync\n\nWhen the MCP boots in cloud mode it subscribes to the workspace over\nSupabase Realtime and notifies the client whenever a `nodes`, `edges`,\n`projects`, or `ideas` row changes. Edits made in the webapp show up\nin the agent's view without a manual refresh, and writes from one\nMCP-connected client reach any other connected client the same way.\nPass `--no-realtime` to disable the subscription (useful if the\nchatter is noisy or the client logs every notification). The\npreference is saved to `~/.heuresis/config.json` so the flag only\nneeds to be passed once.\n\n## Tools\n\n34 tools total: 31 data tools against the cloud workspace, plus 3\noperator tools that drive the same ideation operators the webapp uses.\n\n**Reads (10).** `get_workspace_summary`, `list_projects`,\n`get_project_graph`, `list_concepts`, `list_edges`, `get_subtree`,\n`get_concept`, `search_concepts`, `find_concepts`,\n`list_recent_decisions`. Most agent sessions start with\n`get_workspace_summary` or `list_projects`.\n\n**Writes (21).** Concepts: `add_concept`, `update_concept`,\n`bulk_add_concepts`, `set_parent`, `validate_concept`, `set_standing`,\n`archive_concept`, `unarchive_concept`, `star_concept`,\n`remove_concept`. Edges: `link_concepts`, `add_kref`. Ideas:\n`create_idea`, `rename_idea`, `recolor_idea`, `set_idea_members`,\n`add_to_idea`, `delete_idea`. Projects: `create_project`,\n`update_project`, `delete_project`. Every write stamps a row in\n`public.provenance` with `origin='mcp'` so the webapp's session log\nshows which surface made the change.\n\n**Operator runs (3).** `run_operator` (generate candidates with\nBranch / Matrix / ASIT / TRIZ / Combine / Free / Contradiction),\n`run_operator_and_commit` (same, plus commit the result in one\nround-trip), and `expand_concept` (recursive Branch, capped at depth ×\nbreadth ≤ 60).\n\nTool input shapes mirror their counterparts in the webapp's\n`src/agent/tools.ts`, so an agent that uses both surfaces sees a\nuniform contract.\n\nWave-shipping: `find_in_files` (in-browser embedding search) is in the\nwebapp but not yet on the MCP.\n\n## Legacy snapshot mode (deprecated)\n\nThe original read-only snapshot reader still works as a fallback while\nusers migrate to cloud auth. With no `~/.heuresis/credentials.json`\nand the `HEURESIS_SNAPSHOT` env var set, the server reads a JSON\nexport from disk and exposes the original read-only tool set\n(`get_workspace_summary`, `list_projects`, `search_concepts`,\n`get_concept`, `get_subtree`, `get_project_graph`,\n`list_recent_decisions`).\n\n```bash\nexport HEURESIS_SNAPSHOT=\"/absolute/path/to/your-export.json\"\nnpx @heuresis/mcp\n```\n\nThis path is deprecated and will be removed in a later release. It is\nhere so existing setups keep working through the migration to cloud\nauth.\n\n## License\n\nAGPL-3.0-or-later.\n",
  "bytes": 7153,
  "sha": "95ea1564b6eb31c2c9b61ea9bc8248bc521c982c4f7a868b1546fa522f057809",
  "repo_slug": "toremlabs/heuresis-mcp",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_toremlabs_heuresis_86178ac2/readme"
}