Agents & MCP
stndp ships a local MCP server so a coding agent (Claude Code, Cursor, Codex,
Gemini CLI, Windsurf, …) can read and write the same shared context you do — with no hosted server
and no second login: it reuses your stn login token. One
line of agent config is the whole integration, and stn agent setup writes it for you.
The MCP server is one of three ways agents reach stndp, and they share one source
of truth: the stn CLI (any shell-capable agent), the MCP
server (typed tools + the curated agent surface), and the rules block in
CLAUDE.md/AGENTS.md/GEMINI.md (the when & why). An agent can
always learn the workflow at runtime with stn guide (or the MCP guide tool)
and any command with stn <command> --help.
This extends your agent's memory rather than replacing it. Its built-in memory lives for one session on one machine; stndp gives it a shared, durable layer underneath — so what it learns survives the session, and what a teammate's agent wrote is already there when yours starts.
Setup
stn agent setup # auto-detect: Claude Code + Cursor (+ Codex/Gemini/Windsurf if present)
stn agent setup --target claude # auto | claude | cursor | codex | gemini | windsurf
stn agent setup --no-rules # skip the CLAUDE.md / AGENTS.md / GEMINI.md rules block
stn agent setup --no-hooks # skip the Claude Code SessionStart hook
stn agent doctor # verify the wiring: login, MCP server, config, rules, hook
What it writes (idempotently — safe to re-run; restart your agent afterward).
auto always configures Claude Code + Cursor and adds the others only when it detects
you use them:
- Claude Code —
.mcp.jsonin the project, aCLAUDE.mdrules block, and a SessionStart hook in.claude/settings.jsonthat runsstn globso every session auto-captures your repo/commit context without the agent having to remember. - Cursor —
.cursor/mcp.json, plus anAGENTS.mdrules block. - Codex — a
[mcp_servers.stndp]table in~/.codex/config.toml(override the dir withCODEX_HOME), plus anAGENTS.mdrules block. - Gemini CLI — a
mcpServersentry in.gemini/settings.json, plus aGEMINI.mdrules block. - Windsurf — a
mcpServersentry in its global~/.codeium/windsurf/mcp_config.json, plus anAGENTS.mdrules block.
The MCP server config is simply {"command": "stn", "args": ["mcp"]}. The rules
block is intentionally short: the golden rules plus a pointer to stn guide — the live
playbook the CLI, the MCP guide tool, and the block all render from one source, so
they never drift. It tells the agent to use stndp by default and record at the right altitude
(one atomic claim per node, link don't narrate): glob/resume at
the start of a task, search before reasoning from scratch, load
file-context before editing a file, decide on every choice (including
“why NOT”), file a bug when it diagnoses and fixes one, open an
episode only for a genuine multi-step arc (and close it with the surprise),
link the tickets/PRs it touches, and checkpoint when it pauses.
stn mcp # run the MCP server over stdio (normally launched by your agent, not by hand)
What the agent gets
Tools. guide (the workflow playbook — how and when to use the
rest), glob (capture this session's git/repo context),
resume, search, timeline, decide,
checkpoint, episode_start/episode_close (the arc of a unit
of work — plan → done → result, with the surprise), bug (a
symptom → cause → fix a future agent can search), get_context (everything connected
to a node), list_blockers, link, file_context, and
whoami. Each tool's description is prescriptive about when to call it (and
when NOT to — most work needs no episode), so agents log decisions, bugs and episodes as a
byproduct of work rather than only on request.
Resources (read-only context the agent can load directly):
stndp://decisions/recent, stndp://blockers/open, and
stndp://checkpoints/recent.
Prompts (canned flows): start-task (resume + search before
starting), wrap-up (checkpoint + log decisions before stopping), and
log-decision.
Attribution & review
Writes from an agent are labelled — set STNDP_AGENT_LABEL (e.g.
claude-code, codex; defaults to mcp) so the platform can
attribute them. Agent-asserted claims arrive pending — decisions, a closed episode's
outcome/result, and a bug's root cause/fix; you review and promote them with
stn decisions --agent --pending /
stn episodes --pending / stn bug list --pending, then
stn decision confirm ID (or stn episode confirm /
stn bug confirm). Under the hood the server speaks spec-compliant JSON-RPC 2.0 over
stdio and reuses your CLI token — there is no separate agent login.