Skip to content

MCP Server

CLI

The MCP server is how your agent accesses .archcore/. It gives agents tools to list, search, read, create, update, and link documents — and prompts that orchestrate full multi-document cascades — all within the conversation.

You usually don’t need to think about MCP directly — archcore init sets it up automatically. This page explains what happens under the hood and how to configure it manually.

Once MCP is configured, agents interact with your documents through 10 tools:

ActionToolDescription
Browselist_documentsList documents filtered by type, layer, or status
Searchsearch_documentsFull-text and path-reference search across bodies
Readget_documentGet full document content with relations
Createcreate_documentCreate new documents from templates
Updateupdate_documentModify title, status, or content
Deleteremove_documentRemove a document permanently
Linkadd_relationCreate a relation between two documents
Unlinkremove_relationRemove a relation
Browse linkslist_relationsView all relations or filter by document
Bootstrapinit_projectInitialize .archcore/ from inside a session

See MCP tools reference for the complete API with parameters and examples.

The MCP server starts even when .archcore/ doesn’t exist yet. From inside a fresh repo, an agent can call the init_project tool to create the directory and write a default settings.json — no shell command required. The tool is idempotent: calling it on an already-initialized project just returns the existing settings.

init_project only sets up .archcore/. To install hooks or register the MCP server with other coding agents, run archcore hooks install and archcore mcp install from the shell.

The server also exposes 5 prompts — pre-orchestrated multi-document cascades that an agent runs end-to-end with a confirmation gate between phases. Most MCP-aware clients surface them as slash commands.

PromptWhat it does
product_trackPRD → Plan (lightweight feature flow)
architecture_trackADR → Spec → Plan (technical design + implementation)
standard_trackADR → Rule → Guide (codify a team standard)
sources_trackMRD → BRD → URD (market / business / user discovery)
iso_trackBRS → StRS → SyRS → SRS (formal ISO 29148 cascade)

Example. In your agent, run:

/product_track feature_name="user notifications"

The agent drafts the PRD, asks you to confirm, then derives a Plan and links it back with plan implements prd. You can stop at any gate.

See MCP prompts reference for arguments and full chain details.

The MCP server doesn’t just expose tools — it teaches agents how to use them. On connect, an agent receives instructions covering:

  • Which document type to use for each situation
  • Naming conventions and slug rules
  • When to create vs. update documents
  • How to use relations properly
  • Status lifecycle (draft -> accepted -> rejected)
  • When to call init_project (empty repo + user wants to create a document)

These instructions are sent automatically. You don’t need to explain Archcore conventions to your agent.

Terminal window
archcore init

archcore init auto-detects installed agents and configures MCP for each one, writing the config file so the agent launches the MCP server on startup.

Install for all detected agents:

Terminal window
archcore mcp install

Or for a specific agent:

Terminal window
archcore mcp install --agent claude-code

To configure MCP by hand, add to your agent’s MCP config:

{
"mcpServers": {
"archcore": {
"command": "archcore",
"args": ["mcp"]
}
}
}

Config file locations vary by agent — see Agent integrations for details.

By default archcore mcp reads documents from the current working directory. Some agents launch the server from a directory that isn’t the workspace root (e.g., a desktop app’s install directory, or a profile-scoped runner). In those cases, point the server at the right project:

  • Flagarchcore mcp --project /absolute/path/to/repo
  • EnvironmentARCHCORE_PROJECT_ROOT=/absolute/path/to/repo archcore mcp

Precedence: --project > ARCHCORE_PROJECT_ROOT > current working directory. The path must exist; it does not need to contain .archcore/ yet — init_project can bootstrap it from the session.

Example MCP config that pins an absolute project root:

{
"mcpServers": {
"archcore": {
"command": "archcore",
"args": ["mcp", "--project", "/Users/me/code/my-repo"]
}
}
}

If you set a language in your config:

Terminal window
archcore config set language ru

The MCP server instructions will include a directive for the agent to write document content in that language.

Hooks inject a summary of your .archcore/ directory into the agent’s context the moment a session starts — before you type anything. This means the agent can reference your decisions, rules, and patterns from the first message.

Hooks are optional — MCP tools work without them — but they make the experience significantly smoother.

  1. You start an agent session (e.g., open Claude Code)
  2. The agent triggers its SessionStart event
  3. The hook runs archcore hooks <agent-id> session-start
  4. Archcore outputs a list of available documents with their types and titles
  5. The agent receives this project context alongside the conversation

Hooks are installed automatically during archcore init. To install manually:

Terminal window
archcore hooks install

Or for a specific agent:

Terminal window
archcore hooks install --agent claude-code

For Claude Code, the hook is added to .claude/settings.json:

{
"hooks": {
"SessionStart": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "archcore hooks claude-code session-start"
}
]
}
]
}
}

See Hooks for everything hooks emit and how to write custom ones.

  • You always start by asking about context — if your workflow is to ask the agent “what documents exist?” at the start, hooks don’t add much.
  • Your agent doesn’t support hooks — some agents lack hook support; MCP tools still work fine.
  • You prefer explicit control — some users prefer to decide when the agent loads context.

The MCP server runs as a subprocess launched by your coding agent. When the agent starts, it spawns archcore mcp and communicates over stdin/stdout using JSON-RPC 2.0 (stdio transport). The server stays running for the session.