MCP · Context for AI agents

Architecture
context for
AI agents.

Your agent asks Keystone about the part of the system it needs: a module, its API, its dependencies and tables. The answer comes as a slice of the model, without reading the whole repository again.

Works over MCP. No repository upload.

Developer

What does a change to OrderService affect?

Agent → Keystonetraverse_architecture(elements: [OrderService], direction: both, depth: 2)
Keystone · model slice
  • OrderControllerOrderServicecalls
  • OrderServiceOrderRepositorycalls
  • OrderRepositoryOrders DBdata
  • orders-serviceorder-eventspublishes

4 relationships · every element with its ID and evidence from the code

Without a model

Every task starts
by learning the system again.

Your agent sees the code, not the architecture. It has to rebuild it from files before every answer.

Many files for one question

To answer about one module, the agent opens dozens of files. That costs time and input tokens.

Hidden dependencies

Links through queues, shared tables and external systems don’t show up in one file and are easy to miss.

Hard to check

The developer has only the agent’s retelling, with nothing to compare it against.

How it works

Build the model once.
Your agent takes what it needs.

Keystone keeps a C4 model of your system: elements, relationships, component APIs and tables. Your agent reads it over MCP, piece by piece.

  1. 01

    Build the model

    Your AI builds it from code, configuration and migrations. You review the proposal and merge it.

  2. 02

    Connect your agent

    Add the Keystone MCP server to Claude Code, Cursor, VS Code with Copilot, Gemini CLI or Windsurf.

  3. 03

    The agent takes a slice

    A module, an element’s neighbours, the path between two elements, or only what changed since last time.

  4. 04

    Check the answer

    Elements in the answer carry IDs and evidence. Open them in Keystone and compare with the diagram.

Connect through MCP with Claude Code, Cursor, VS Code with Copilot, Gemini CLI and other tools.

Connect your AI

What your agent can ask

Architecture questions,
one tool each.

Every one of these tools only reads the model. Your agent changes it only through a proposal that a person reviews.

get_architecture

A whole module

Components, API operations, tables and relationships of one module, or a short map of the whole system.

traverse_architecture

What depends on an element

Incoming and outgoing relationships to the depth you need, filtered by kind of interaction.

find_architecture_path

How two elements connect

The chain of calls and data access between two elements.

search_architecture

Find by name

Elements, APIs and tables by name or description, with IDs for the next request.

get_architecture_delta

What changed

Only the changes to the model since the last read, without loading the whole graph again.

find_antipattern_candidates

Where the risks are

Antipattern candidates: shared databases, cycles of synchronous calls, overloaded services. The agent checks them against the code.

Measured

Fewer input tokens
per module question.

The same questions about modules, APIs and the impact of changes: first with the full graph, then with the module slice. The facts in the answers are the same.

Explore the method and data
−77%

input tokens
per module question

The whole graph97,900
The relevant module22,600
Average input tokens. Same question, same facts in the answer.

Measured on one anonymized project with 281 elements, using Claude Haiku across 120 trials. Questions covered modules, APIs and change impact. These results apply to that task set; system wide questions still require the full graph.

This was measured on one project. Check the effect on your own: give your agent the same task with Keystone and without it.

Before you connect

Data and access,
briefly.

Open the documentation

What data reaches Keystone?

You don’t upload the repository to Keystone. Your AI reads the code in your own environment and sends Keystone what it learns about the architecture: elements, relationships, descriptions and evidence. Descriptions and evidence may contain pieces of code. The code itself is processed by the AI provider you choose, not by Keystone. Companies can also run Keystone inside their own network.

Which AI tools does it work with?

Tools that support MCP, including Claude Code, Cursor, VS Code with Copilot, Gemini CLI and Windsurf. The docs cover connection steps.

Can the agent change the diagram?

Only through a proposal. It arrives as a branch that a person reviews and merges. Merging proposals without conflicts automatically is a separate project setting.

What does the agent see in Keystone?

Only the projects its token can reach, with the rights of the token’s owner. A read-only token changes nothing.

Do I need a diagram first?

No. Your agent builds the first model from the code, and an existing diagram can be extended and checked.

Can I start for free?

There’s a free plan with limits on keystone-core.pro. Start a model and see how the workflow fits your project.

Start with your own system

Give your agent
a map of the system.

Build the model, connect your agent over MCP and compare its answers with Keystone and without it.

Build my architecture

Free plan available · Connect through MCP