Skip to content

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.

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.

Terminal window
archidocs mcp --workspace archidocs

To 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:

Terminal window
claude mcp add --scope project archidocs -- archidocs mcp --workspace archidocs

It writes .mcp.json at the repo root. Commit it, so everyone who clones the repo gets the server. Or write the file yourself:

.mcp.json
{
"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.

If the CLI isn’t installed globally, run it with npx. Set "command" to "npx", and start args with "-y", "archidocs".

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:

Terminal window
archidocs mcp --workspace archidocs --check
archidocs 1.2.0 MCP server (check): Workspace /home/me/shop/archidocs — 1 Projects, 3 Elements; check: 0 errors, 0 warnings; writes on
ok: 32 tools; list_teams answered

When 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.

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.

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:

Terminal window
archidocs mcp --workspace ../architecture/archidocs

In 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.

To answer questions without a checkout, serve the Bundle a published viewer site holds:

Terminal window
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.

For a coding agent that connects to a URL instead of starting a process, start the server yourself:

Terminal window
archidocs mcp --http --port 3737 --workspace archidocs

It listens on http://127.0.0.1:3737/mcp only, and leaves the write tools off unless you add --allow-writes. Register the URL:

Terminal window
claude mcp add --scope project --transport http archidocs http://127.0.0.1:3737/mcp

Documents the beta branch at cd98671, ahead of the latest release, v1.4.0.