Connect an agent over MCP
Register the Archidocs MCP server with your coding agent, so it can answer architecture questions and edit the Model, the architecture your YAML files describe.
Before you start
Section titled “Before you start”- Node.js 22.18 or later. A global install is optional. See Installation.
- The repo has a Workspace, the
archidocs/folder. The Quick start creates one.
1. Register the server
Section titled “1. Register the server”archidocs init has already done this for most agents. It writes the server into .mcp.json at the repo root, which Claude Code, VS Code and Copilot read, and updates .cursor/mcp.json or .vscode/mcp.json when the repo has one. It replaces only its own archidocs entry and keeps your other servers. Commit .mcp.json, so everyone who clones the repo gets the server. Run init again after you change how you install Archidocs, and it updates the entry.
The entry runs one command from the repo root, in the form that runs there: archidocs mcp --workspace archidocs with a global install, npx archidocs mcp --workspace archidocs with a dev dependency, or npx -y archidocs@1.2.0 mcp --workspace archidocs on demand. From a code repo, the path differs: see In a code repo.
archidocs mcp --workspace archidocsTo register it by hand, or with an agent init doesn’t write for, pick your coding agent and add the command where it reads MCP servers.
From the repo root:
claude mcp add --scope project archidocs -- archidocs mcp --workspace archidocsIt writes .mcp.json at the repo root. Commit it, so everyone who clones the repo gets the server. Or write the file yourself:
{ "mcpServers": { "archidocs": { "type": "stdio", "command": "archidocs", "args": ["mcp", "--workspace", "archidocs"] } }}Start claude in the repo and approve the server when it asks. /mcp lists it as connected.
Create .cursor/mcp.json in the repo:
{ "mcpServers": { "archidocs": { "type": "stdio", "command": "archidocs", "args": ["mcp", "--workspace", "${workspaceFolder}/archidocs"] } }}Cursor replaces ${workspaceFolder} with the repo root, the folder that holds .cursor/. Cursor doesn’t say which folder it starts a server in, so the path starts there. The server appears under MCP in Cursor’s settings. Turn it on there.
Create .mcp.json at the repo root:
{ "mcpServers": { "archidocs": { "type": "stdio", "command": "archidocs", "args": ["mcp", "--workspace", "archidocs"] } }}Claude Code reads the same file. Run MCP: List Servers from the Command Palette to start the server and see its state.
Create .codex/config.toml in the repo:
[mcp_servers.archidocs]command = "archidocs"args = ["mcp", "--workspace", "archidocs"]Codex reads a project’s .codex/config.toml only once you trust the project. To add the server for every project instead, run this. It writes ~/.codex/config.toml.
codex mcp add archidocs -- archidocs mcp --workspace archidocsIn the codex TUI, /mcp lists the server.
If the CLI isn’t installed globally, run it with npx. Set "command" to "npx", and start args with "-y", "archidocs".
Check it worked
Section titled “Check it worked”Run the command from your config with --check added, from the repo root. It starts the server, connects to it as an agent would, and exits:
archidocs mcp --workspace archidocs --checkarchidocs 1.2.0 MCP server (check): Workspace /home/me/shop/archidocs — 1 Projects, 3 Elements; check: 0 errors, 0 warnings; writes onok: 32 tools; list_teams answeredWhen the agent starts the server, it prints the same first line to stderr once it has loaded the Workspace, and one line for each write. Your agent shows that in its MCP log: claude --debug in Claude Code, MCP: List Servers › Show Output in VS Code, and the MCP Logs output channel in Cursor. Set ARCHIDOCS_LOG=debug in the server’s environment to log every read call too.
Then ask the agent what breaks if one of your databases goes down: “what breaks if the Orders DB goes down?”. It calls get_impact and answers from the Model. It lists each affected Element, a Service or other part of the Model, with its Owner.
If it didn’t
Section titled “If it didn’t”Run the --check command above. When the path is wrong, it prints why and exits with 2:
archidocs: --workspace "archidcos" is not a folder.A folder that exists but holds no Workspace, and no Workspace above it, prints No workspace.yaml found in this folder, its archidocs/ folder, or any folder above. instead.
Correct --workspace in your config. The path is relative to the folder the coding agent starts the server in, usually the repo root.
When the Workspace loads but has problems, the first line counts the check errors; run archidocs check to see them. A published Bundle that can’t be read is reported as can't load it: …, with the reason.
In a code repo
Section titled “In a code repo”An agent working on a Service’s code can keep the Model in step from there. Clone the Workspace repo beside the code repo, and register the same command with --workspace pointing at that checkout:
archidocs mcp --workspace ../architecture/archidocsIn args, that is ["mcp", "--workspace", "../architecture/archidocs"]. archidocs init --skill --workspace ../architecture/archidocs installs the skill in the code repo and writes that entry into its .mcp.json. Without --workspace, it writes no config. See Install the agent skill.
From a published site, read-only
Section titled “From a published site, read-only”To answer questions without a checkout, serve the Bundle a published viewer site holds:
archidocs mcp --bundle https://architecture.example.com/workspace.bundle.json --viewer-url https://architecture.example.com/Only the read tools are offered. The server re-reads the site’s Revision index and the Bundle at most once a minute, so it follows new deploys. With --viewer-url, results link to the same View in the published viewer.
Over HTTP
Section titled “Over HTTP”For a coding agent that connects to a URL instead of starting a process, start the server yourself:
archidocs mcp --http --port 3737 --workspace archidocsIt listens on http://127.0.0.1:3737/mcp only, and leaves the write tools off unless you add --allow-writes. Register the URL:
claude mcp add --scope project --transport http archidocs http://127.0.0.1:3737/mcp{ "mcpServers": { "archidocs": { "url": "http://127.0.0.1:3737/mcp" } }}{ "mcpServers": { "archidocs": { "type": "http", "url": "http://127.0.0.1:3737/mcp" } }}[mcp_servers.archidocs]url = "http://127.0.0.1:3737/mcp"Related
Section titled “Related”Documents the beta branch at cd98671, ahead of the latest release, v1.4.0.