MCP setup

The Model Context Protocol (MCP) is how Engrym integrates with AI coding agents. Once the MCP server is wired, your agent — Claude Code, Claude Desktop, Cursor, Windsurf, Gemini CLI, Codex, or ChatGPT — automatically pulls team context, queries the Brain, logs decisions, and broadcasts intents on your behalf.

What is MCP?

MCP is a JSON-RPC protocol developed by Anthropic that lets an AI agent talk to external tools. The agent sees a list of available tools (with descriptions), picks the right one for the user's request, and invokes it. Engrym ships an MCP server (@engrym/mcp-server on npm) with tool descriptions written as agent-facing prompts — the model reads them directly and decides when to use each tool.

The server runs locally over stdio, spawned on demand via npx — no global install required.

Set up with one command

The recommended path is the one-liner from the dashboard onboarding flow (it appears when you create a project, alongside your setup token):

ENGRYM_SETUP_TOKEN=<your-token> npx @engrym/cli setup claude-code

Replace claude-code with your tool: claude-code, claude-desktop, cursor, windsurf, gemini, or codex. (ChatGPT connects differently — as a hosted remote connector; see Remote connector below.)

This single command:

  1. Validates the token against the Engrym API and resolves your project automatically.
  2. Writes the credential once, to ~/.engrym/config.yaml (file mode 600).
  3. Registers the MCP server with the tool. The registration spawns npx -y @engrym/mcp-server@latest — the credential is never written into any tool's config; the server reads it from ~/.engrym/config.yaml at startup.

Pass the token via the ENGRYM_SETUP_TOKEN environment variable (preferred — it stays out of your shell history) rather than the --token flag.

What each tool target does

ToolMechanism
claude-codeRuns claude mcp add --scope user (requires the claude CLI on your PATH); registers in the user-scope config
claude-desktopMerges into claude_desktop_config.json
cursorMerges into ~/.cursor/mcp.json
windsurfMerges into ~/.codeium/windsurf/mcp_config.json
geminiMerges into ~/.gemini/settings.json
codexPrints a TOML [mcp_servers.engrym] snippet to paste into ~/.codex/config.toml

Every registration is the same credential-free spawn directive:

{
  "mcpServers": {
    "engrym": {
      "command": "npx",
      "args": ["-y", "@engrym/mcp-server@latest"],
      "env": {}
    }
  }
}

Restart the tool after setup — most agents cache the tool list.

Windsurf

Windsurf (Codeium's editor) is a local stdio host, wired exactly like Cursor or Codex.

Fastest path — one command writes the config for you:

  1. Run the setup command with your token:

    ENGRYM_SETUP_TOKEN=<your-token> npx @engrym/cli@latest setup windsurf
    
  2. Restart Windsurf so it loads the Engrym tools.

Manual path — if you'd rather edit the config by hand:

  1. Open (or create) ~/.codeium/windsurf/mcp_config.json.

  2. Add the Engrym server:

    {
      "mcpServers": {
        "engrym": {
          "command": "npx",
          "args": ["-y", "@engrym/mcp-server@latest"]
        }
      }
    }
    
  3. Restart Windsurf so the Engrym tools load.

Verifying the wire

In Claude Code, claude mcp list should show engrym as connected. Then ask the agent a question about your project:

"What's our team context right now?"

If the wire is healthy, the agent invokes get_team_context against the Engrym MCP server and answers from project truth — not from training-set memory.

The tools the server exposes

The server exposes 23 tools. Descriptions ship with the server as agent-facing prompts, so agents know when to call each one without extra prompting. They group into six jobs: orient, read, coordinate, write, extract, and reconcile.

Orient — get the lay of the land

ToolWhat it does
get_project_briefThe cold-start orientation pack for a project the agent doesn't know yet. One read returns the north-star, active constraints, active conventions, recent decisions, and current focus
get_init_briefThe first-run summary — what the Brain already knows AND what it doesn't, with honest counts of decisions, conflicts, and constraints, plus the decisions nobody wrote a rationale for
get_team_contextReturns the team's accumulated knowledge — conventions, constraints, recent decisions, active work by teammates. Agents call it at session start
get_session_stateRetrieves the latest persisted session state, so a session can resume where the last one left off — including across machines
list_projectsDiscovers which Engrym projects the credential can reach, so an agent can read knowledge from a sibling project, not just the one it's connected to

Read — pull the right knowledge

ToolWhat it does
query_brainSearch across Brain atoms by keyword, category, or scope, ordered by relevance
get_relevant_knowledgeLoads the conventions and constraints that govern the exact file or topic being worked on — the local rules, inherited unprompted
get_related_atomsWalks the knowledge graph out from one atom — what it was derived from, what extends it, what contradicts it — so the reasoning around a decision is visible, not read in isolation
get_atom_sourceReturns the citation for an atom — the exact source document and section it came from — before the agent relies on a claim or repeats it
get_timelineA changelog over the project's knowledge: what changed since a given date, or how one decision evolved through its supersession history

Coordinate — work alongside other agents

ToolWhat it does
broadcast_intentAnnounces what the agent is about to work on, with the files it expects to touch, so other agents are aware
release_intentMarks a previously broadcast intent as done
check_conflictsChecks whether other team members' active intents overlap the files about to be edited
get_active_intentsLists the currently active intents in the project for situational awareness
save_session_statePersists session state — last task, recently touched files, unfinished work — so the next session can resume, possibly on another machine

Write — add to the Brain

ToolWhat it does
add_brain_entryCreates a new Brain atom — a convention, constraint, or context fragment — with metadata
log_decisionRecords a significant architectural, design, or convention decision with its rationale and alternatives, so future sessions understand the WHY
write_documentWrites a plain-Markdown project document; the Brain re-derives atoms from it asynchronously. Born provisional — nothing becomes canonical until a human ratifies it in the dashboard

Extract — fill the Brain in agent mode

ToolWhat it does
pull_extraction_workPulls agent-mode extraction work — the documents that need extraction plus the prompt to extract them with — so the agent runs the extraction on its own model and subscription. Gated: only when the user asks, or when the project's auto-pull consent explicitly authorizes it
submit_extractionPosts one document's extraction result back as a keep/change/add/remove diff of knowledge atoms. Submissions land provisional and ratification-gated — a proposal, not a publication

Reconcile — keep the docs honest about the code

ToolWhat it does
find_contradictionsSurfaces places where the team's knowledge disagrees with itself — a decision that violates a constraint, or two atoms asserting opposites — for a human to review. A recommender, not an actor: it flags, it never resolves
get_reconciliation_claimsFetches the project's documented claims (decisions, conventions, constraints) so an agent can read the actual code locally and judge whether the code still honors each one. Engrym never sees the code
submit_reconciliation_verdictReports one verdict per claim — upheld, violated, or uncertain — with a pointer to where the agent looked. Never the code itself. A violated verdict routes to the human review queue

Troubleshooting

Remote connector (hosted, no local install)

There is also a hosted remote MCP server at https://engrym-mcp-remote.fly.dev/mcp. It runs the same tools over Streamable HTTP and authenticates with OAuth — so you authorize once in the browser instead of writing a credential to disk, and nothing needs to be installed locally. This is the path for surfaces where npx can't run (the iPad / iPhone Claude Code apps, claude.ai/code on the web), and it works on the desktop too.

Two ways to connect:

The remote server speaks standard MCP OAuth discovery (RFC 9728 protected-resource metadata + dynamic client registration with PKCE), so any MCP client that supports OAuth-backed HTTP servers can connect by pointing at the same URL.

When to use which: reach for the local stdio path above when you're on a machine where npx runs and you want the one-command engrym setup flow; reach for the remote connector when you want browser-based OAuth with no local install, or when you need Engrym on a surface that can't spawn a local process.

Next steps