@withrigor/mcp-server
v0.5.2
Published
Model Context Protocol server for Rigor — exposes Rigor projects to coding agents (Claude Code, Codex, Cursor) so users can summon their agent from inside Rigor without switching to their IDE. Also ships rigor-watch, a daemon that wakes a local agent when
Downloads
2,017
Readme
@withrigor/mcp-server
Model Context Protocol server for Rigor — lets users summon their coding agent from inside a Rigor project without switching to their IDE.
This is the transport layer that connects your coding agent (Claude Code, Codex, Cursor, any MCP-compatible client) to a Rigor project. Once connected, the agent can:
- Read the full project context in one call (
rigor_get_pickle) - Claim pending tasks (
/rigorruns, visualize requests, comment replies) - Write markdown docs with rich blocks (charts, metrics, mermaid, tables)
- Query the connected database
- Post annotations, suggestions, and replies to comment threads
Previously, an external agent had to be invoked manually via a terminal command (/rigor). With MCP, the agent is connected once and watches for work inside the session — users click a "Summon" button in Rigor and the agent picks up the task immediately.
Install
Via Claude Code / Claude Desktop
Add to your ~/.claude/claude_desktop_config.json (Claude Desktop) or .mcp.json in your project root (Claude Code):
{
"mcpServers": {
"rigor": {
"command": "npx",
"args": ["-y", "@withrigor/mcp-server"],
"env": {
"RIGOR_BASE_URL": "https://withrigor.dev",
"RIGOR_API_TOKEN": "rg_...",
"RIGOR_AGENT_ID": "claude-code"
}
}
}
}Get your RIGOR_API_TOKEN from the /agent-setup page in your Rigor project.
Local development
cd mcp
pnpm install
pnpm buildThen point your MCP client at node /absolute/path/to/mcp/dist/server.js.
Environment variables
| Variable | Required | Default | Description |
|---|---|---|---|
| RIGOR_BASE_URL | no | https://withrigor.dev | Base URL of the Rigor instance. Use http://localhost:3000 for local dev. |
| RIGOR_API_TOKEN | yes | — | Per-project bearer token. From /agent-setup. |
| RIGOR_AGENT_ID | no | mcp:coding-agent | Identifier for this agent in audit logs and presence indicators. |
Tools exposed
| Tool | Purpose |
|---|---|
| rigor_get_pickle | One-shot project context: schema, formulas, themes, feature set |
| rigor_get_state | Full project state including doc bodies |
| rigor_get_pending | Lightweight list of pending work |
| rigor_watch_tasks | Long-poll (up to 120s) for new tasks |
| rigor_claim_task | Atomically claim a task before working on it |
| rigor_submit_task_result | Return a structured result for a claimed task |
| rigor_write_doc | Create or update a plan document (markdown) |
| rigor_annotate | Post an intervention chip on a doc |
| rigor_reply | Reply to an existing comment thread |
| rigor_query_db | Read-only SELECT against the connected DB |
| rigor_render_mermaid | Render mermaid to SVG |
Typical session loop
1. rigor_get_pickle({ project_id }) → baseline context
2. rigor_get_pending() → any work waiting?
3. For each pending task:
a. rigor_claim_task({ notification_id })
b. Execute (write doc / build chart / answer comment / …)
c. rigor_submit_task_result({ notification_id, result_type, result_data })
4. rigor_watch_tasks({ project_id }) → block for new work
5. Loop.Design notes
- stdio transport — matches Claude Desktop, Claude Code, Cursor conventions
- Per-project scope — one token = one project. Run multiple servers for multiple projects.
- Long-poll client-side — Rigor's HTTP API isn't long-poll native, so
rigor_watch_taskspolls/api/coplanner/agent/pendingevery 2s up to the deadline. Simple and reliable. - SQL guard —
rigor_query_dbrejects anything that doesn't start withWITHorSELECT. Write/DDL queries are never allowed through the MCP.
