Agents and MCP
archidocs mcp serves the Model to coding agents over the Model Context Protocol (MCP). It is the viewer’s twin: what a person can see in the viewer, an agent can ask the MCP server, and both answers come from the same Model.
"What breaks if the mainframe goes down?" → get_impact { "id": "core:mainframe", "direction": "upstream" }Read tools
Section titled “Read tools”The read tools answer the same questions as the viewer:
- How are two Services connected?
find_paths - What does an outage affect?
get_impact - Where is a Service deployed, and at which URL?
get_deployments - What does a Team own?
list_owned - Which decisions sit behind an Element?
list_adrs - What changed between two Revisions?
get_changes
Started with --viewer-url, the server adds a link to each result that opens the same thing in the published viewer. So an agent can hand a person the picture.
Write tools
Section titled “Write tools”Over a checkout of the Workspace, the write tools edit the YAML in place. They add or update Elements, Relationships, Deployments and Views, propose ADRs, and remove things. Each one:
- keeps the file’s comments and formatting, and returns a diff of what it changed;
- refuses any change that would fail
archidocs check, with each issue’s rule and file:line; - refuses to remove something still referenced, and lists each reference;
- can be tried first with
dry_run: true, which returns the diff and writes nothing.
The agent edits files in your checkout, as a person would. Committing, opening the pull request and reviewing it stay with you.
Two places to serve from
Section titled “Two places to serve from”- A checkout,
archidocs mcp --workspace ./archidocs: read and write tools, for an agent working in the Workspace repo. - A published Bundle,
archidocs mcp --bundle https://architecture.example.com/workspace.bundle.json: read tools only, from a site thatarchidocs buildpublished. Any agent can answer architecture questions without a checkout, from the latest published Revision.
The server talks over stdio by default, which is how coding agents start MCP servers. --http serves Streamable HTTP on a loopback address instead, with the write tools off unless --allow-writes turns them on.
The authoring guide
Section titled “The authoring guide”The MCP tools say what they do. The authoring guide says how to model well with them: the Model’s rules, the edit loop, and a topic for each task, such as bootstrapping a Project from code.
It ships with the CLI, so it always matches it. The MCP tool get_guide("authoring") serves it, and archidocs guide prints it. get_authoring_guide serves the same and is deprecated, kept for skills installed by older versions. archidocs init installs a skill that points agents at it.
Other skills build on the authoring guide, each with a guide of its own. fill-gaps finds what the Model leaves empty and interviews you to fill it: get_guide("fill-gaps") serves it, and archidocs guide --skill fill-gaps prints it.
The guides on this site cover the same tasks for people, and each links its agent topic.
Consulting the Model while coding
Section titled “Consulting the Model while coding”The consult skill is for an agent changing a Service’s code, not the Model. Before a change that reaches past the Service, such as a public API, a dependency or deployment config, it reads the Model and reports the Service’s consumers, the Teams to tell, its Deployments and its ADRs. It stops only when an accepted ADR contradicts the change or the change breaks another Team’s consumer. It never writes the Model; when the code and the Model drift apart, it hands off to the authoring guide. get_guide("consult") serves it, and archidocs guide --skill consult prints it. See Consult the Model while coding.
Describing an architecture in prose
Section titled “Describing an architecture in prose”An agent doesn’t need code to build a Model. The describe skill, served by get_guide("describe"), has it work from your own explanation: you describe how your systems fit together, and it plays back a draft and asks only what is ambiguous, round by round. It never makes up Environments, URLs or Owners, and writes nothing until you approve the first draft. See Describe an architecture in prose.
Why it works this way
Section titled “Why it works this way”- Same answers for people and agents. The viewer and the MCP server read the same Bundle, so an agent can’t tell you something the diagram contradicts.
- Writes refuse an invalid Model. Every write checks the whole Workspace with the change applied. The Model is valid after every step, and a refusal names the rule and the line, so the agent can fix its own mistake.
- No cascading removals. Removing a Service that others depend on would silently change their files. Refusing, with the list of references, leaves that choice to whoever asked.
- Edits stay in your checkout. A change to the architecture is accepted in review, like a change to code. So the agent writes files, and the pull request stays with you.
- Read-only from a Bundle, and over HTTP by default. A published site has no files to write. The HTTP server has no sign-in, so writing over it has to be turned on.
- The guide ships with the CLI. An agent that reads it from the installed version can’t follow rules from a newer or older release.
Related
Section titled “Related”Documents the beta branch at cd98671, ahead of the latest release, v1.4.0.