Skip to main content

MCP server

The optional module jeap-archrepo-mcp lets AI agents search and read the systems and components of the architecture model, and how they integrate - their dependencies, interfaces and published data models - via the Model Context Protocol (MCP). It builds on the jEAP MCP starter, which provides the MCP endpoint (Spring AI, SYNC, STATELESS, Streamable HTTP), OAuth2 authentication, execution limits, a stable error contract and metrics.

The MCP endpoint is an addition to the REST APIs: neither /api/** nor the docs API is changed by the module.

Tools​

ToolPurpose
find_systemsSearch the systems by name, alias, description, team or component name, paginated
get_systemOne system with its owning team and its deployed components
get_componentOne component with its type, system, owning team, source and when that source last saw it
get_dependenciesThe incoming, outgoing and internal REST, event and command dependencies of a system or component, paginated
get_interfacesThe REST endpoints a system or component provides and the events and commands it takes part in, paginated
get_data_modelsThe database tables a system or component published and its message payload schemas, paginated

All tools are read-only and report what the model holds after the last update - see Ids, sources and freshness. Undeployed components are never returned: they are kept in the model for housekeeping only, like everywhere else a reader sees the model. Likewise, the integration tools only show current relations: no deleted ones, and none to or from an undeployed component.

find_systems​

ParameterDescription
queryText to search for in the name, the aliases and the description of the systems
teamName, or part of it, of the team owning the system or one of its deployed components
componentNameName, or part of it, of one of the system's deployed components
offsetNumber of entries to skip, default 0
limitMaximum number of entries, 1-200, default 50

All parameters are optional. The filters are case-insensitive substring matches and are combined with AND; without any filter, every system is listed. The result is a page {items, total, offset, limit, nextOffset, source}, ordered by system name (ignoring case); while nextOffset is set, calling again with offset = nextOffset returns the next page.

{
"items": [
{
"id": "4f0c2a1e-8b7d-4c35-9a52-0d6c3e8f1b27",
"name": "jme",
"description": "jEAP microservice examples",
"aliases": ["jme-examples"],
"ownerTeam": "team-blue",
"componentCount": 12
}
],
"total": 1,
"offset": 0,
"limit": 50,
"nextOffset": null,
"source": {
"name": "archrepo",
"retrievedAt": "2026-12-01T10:15:30.001+01:00",
"modelUpdatedAt": "2026-12-01T01:35:12.840+01:00"
}
}

componentCount counts the deployed components only.

get_system​

ParameterRequiredDescription
systemyesId, name or alias of the system; names and aliases are matched ignoring case, and a name wins over another system's alias

The system is resolved like everywhere else in the arch repo: by name, and by an alias only where no system carries that name - names and aliases share one namespace.

{
"id": "4f0c2a1e-8b7d-4c35-9a52-0d6c3e8f1b27",
"name": "jme",
"description": "jEAP microservice examples",
"aliases": ["jme-examples"],
"confluenceLink": "https://confluence.example.ch/display/JME",
"ownerTeam": {
"name": "team-blue",
"contactAddress": "team-blue@example.ch",
"jiraLink": "https://jira.example.ch/projects/JME",
"confluenceLink": "https://confluence.example.ch/display/BLUE"
},
"components": [
{
"id": "9b1d6c0e-2f4a-4e8b-b1c7-5a3d2e9f0c11",
"name": "jme-order-service",
"type": "BACKEND_SERVICE",
"description": "Takes the orders",
"ownerTeam": "team-blue",
"importer": "GRAFANA",
"lastSeen": "2026-12-01T01:35:09.112+01:00"
}
],
"source": {"name": "archrepo", "retrievedAt": "2026-12-01T10:15:30.001+01:00", "modelUpdatedAt": "2026-12-01T01:35:12.840+01:00"}
}

components are the deployed components, ordered by name. type is one of BACKEND_SERVICE, FRONTEND, GATEWAY, MOBILE_APP, SELF_CONTAINED_SYSTEM and UNKNOWN. Relations, interfaces and data models are not part of the result - see the integration tools.

get_component​

ParameterRequiredDescription
componentyesId or name of the component; names are unique across all systems and matched ignoring case
systemnoId, name or alias of the system the component must belong to
{
"id": "9b1d6c0e-2f4a-4e8b-b1c7-5a3d2e9f0c11",
"name": "jme-order-service",
"type": "BACKEND_SERVICE",
"description": "Takes the orders",
"system": {"id": "4f0c2a1e-8b7d-4c35-9a52-0d6c3e8f1b27", "name": "jme"},
"ownerTeam": {
"name": "team-blue",
"contactAddress": "team-blue@example.ch",
"jiraLink": "https://jira.example.ch/projects/JME",
"confluenceLink": "https://confluence.example.ch/display/BLUE"
},
"importer": "GRAFANA",
"createdAt": "2025-03-14T08:02:51.004+01:00",
"lastSeen": "2026-12-01T01:35:09.112+01:00",
"source": {"name": "archrepo", "retrievedAt": "2026-12-01T10:15:30.001+01:00", "modelUpdatedAt": "2026-12-01T01:35:12.840+01:00"}
}

The integration tools​

get_dependencies, get_interfaces and get_data_models are each asked about either a system or a component:

ParameterDescription
systemId, name or alias of a system, resolved like get_system; it stands for all its deployed components
componentId or name of a deployed component, resolved like get_component
offsetNumber of entries to skip, default 0
limitMaximum number of entries; the range and the default are per tool

Exactly one of system and component is required; neither or both is an INVALID_PARAMETER. Because the rule spans two parameters, the published schema marks neither as required.

The result is a page {subject, items, total, offset, limit, nextOffset, source}. subject is the system or the component as it was resolved - {kind, id, name, system}, with kind SYSTEM or COMPONENT and system set for a component - so that an agent sees which system an alias led to. While nextOffset is set, calling again with offset = nextOffset returns the next page. The entries of one result have a type, and the tool's type parameter filters by it.

Relations and contracts refer to components by name. A name that is no deployed component of the landscape - a client only a Pact or a metric knows, or another system's business name in an event relation - is shown with that name and id: null.

get_dependencies​

ParameterDescription
directionOnly OUTGOING, INCOMING or INTERNAL dependencies
typeOnly dependencies through a REST_API, an EVENT or a COMMAND
limit1-200, default 50

Plus system or component, and offset. Every entry is one current relation of the model, in the dependency direction: the consumer is the side that depends, the provider the side depended upon, for every type. Each side also carries a role naming it unambiguously:

typeconsumerproviderStored in the model as
REST_APIthe client, CLIENTthe server, SERVERconsumer and provider alike
EVENTthe consumer, CONSUMERthe publisher, PUBLISHERconsumer and provider alike
COMMANDthe sender, SENDERthe receiver, RECEIVERthe other way round: the sender as provider

A command is stored as the message flows, with the sender as provider; this tool turns it around so that consumer and provider mean the same for every type. The docs API serves the relations as stored.

direction is seen from the subject: OUTGOING when the subject depends on the other side (it calls the REST API, consumes the event, sends the command), INCOMING when the other side depends on the subject, and INTERNAL when both sides belong to the system asked about. Entries are ordered by type (REST_API, EVENT, COMMAND), direction, consumer, provider and endpoint or message type.

{
"subject": {"kind": "SYSTEM", "id": "4f0c2a1e-8b7d-4c35-9a52-0d6c3e8f1b27", "name": "jme", "system": null},
"items": [
{
"id": "7d3e5b20-91c4-4f6a-8e2b-3c1d0a9f4e65",
"type": "REST_API",
"direction": "INCOMING",
"consumer": {"role": "CLIENT", "id": "c2a7f1d4-5e8b-4a3c-9f06-1b2d3e4f5a6b", "name": "billing-service",
"system": {"id": "0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d", "name": "billing"}},
"provider": {"role": "SERVER", "id": "9b1d6c0e-2f4a-4e8b-b1c7-5a3d2e9f0c11", "name": "jme-order-service",
"system": {"id": "4f0c2a1e-8b7d-4c35-9a52-0d6c3e8f1b27", "name": "jme"}},
"restApi": {"id": "5e6f7a8b-9c0d-4e1f-a2b3-c4d5e6f7a8b9", "method": "POST", "path": "/orders"},
"pactUrl": "https://pactbroker.example.ch/pacts/provider/jme-order-service/consumer/billing-service/latest",
"lastSeen": "2026-12-01T01:35:09.112+01:00",
"messageType": null
},
{
"id": "1f2e3d4c-5b6a-4978-8a9b-0c1d2e3f4a5b",
"type": "COMMAND",
"direction": "OUTGOING",
"consumer": {"role": "SENDER", "id": "3c4d5e6f-7a8b-4c9d-8e0f-1a2b3c4d5e6f", "name": "jme-order-worker",
"system": {"id": "4f0c2a1e-8b7d-4c35-9a52-0d6c3e8f1b27", "name": "jme"}},
"provider": {"role": "RECEIVER", "id": "c2a7f1d4-5e8b-4a3c-9f06-1b2d3e4f5a6b", "name": "billing-service",
"system": {"id": "0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d", "name": "billing"}},
"restApi": null,
"pactUrl": null,
"lastSeen": null,
"messageType": {"id": "8a9b0c1d-2e3f-4a5b-9c6d-7e8f9a0b1c2d", "name": "ChargeCommand",
"definingSystem": {"id": "0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d", "name": "billing"}}
}
],
"total": 2, "offset": 0, "limit": 50, "nextOffset": null,
"source": {"name": "archrepo", "retrievedAt": "2026-12-01T10:15:30.001+01:00", "modelUpdatedAt": "2026-12-01T01:35:12.840+01:00"}
}
FieldMeaning
idStable id of the relation
consumer, provider{role, id, name, system}; id and system are null for a name that is no deployed component
restApiThe REST endpoint called, {id, method, path} - REST_API only
pactUrlThe Pact verifying the dependency, if any - REST_API only
lastSeenWhen a source last saw the call, if known - REST_API only
messageTypeThe event or command type, {id, name, definingSystem} - EVENT and COMMAND only; id is null if the model has no message type of that name

The sources of a relation are not returned: they are read only while the model is being imported, and loading them for every relation of the model would cost a query per relation.

get_interfaces​

ParameterDescription
typeOnly REST_API, EVENT or COMMAND interfaces
limit1-200, default 50

Plus system or component, and offset. The interfaces of a subject are:

  • REST_API: the endpoints its components provide - {type, id, method, path, provider, openApi}, where provider is the serving component and openApi the {version, serverUrl} of the OpenAPI spec it pushed, or null.
  • EVENT and COMMAND: the message types its components have a contract with, in any role, and - asked about a system - the message types the system defines. Each is {type, id, name, definingSystem, topic, scope, description, documentationUrl, descriptorUrl, participants}. participants are the subject's own components with a contract: {component, role, versions, topic}, the role being PUBLISHER or CONSUMER of an event, SENDER or RECEIVER of a command, and versions the versions the contract covers. A message type the system defines without a contract of its own components has none.

Entries are ordered by type (REST_API, EVENT, COMMAND), then by provider, path and method, or by name.

{
"subject": {"kind": "COMPONENT", "id": "9b1d6c0e-2f4a-4e8b-b1c7-5a3d2e9f0c11", "name": "jme-order-service",
"system": {"id": "4f0c2a1e-8b7d-4c35-9a52-0d6c3e8f1b27", "name": "jme"}},
"items": [
{
"type": "REST_API",
"id": "5e6f7a8b-9c0d-4e1f-a2b3-c4d5e6f7a8b9",
"method": "POST",
"path": "/orders",
"provider": {"id": "9b1d6c0e-2f4a-4e8b-b1c7-5a3d2e9f0c11", "name": "jme-order-service",
"system": {"id": "4f0c2a1e-8b7d-4c35-9a52-0d6c3e8f1b27", "name": "jme"}},
"openApi": {"version": "1.2.0", "serverUrl": "https://jme.example.ch/jme-order-service"}
},
{
"type": "EVENT",
"id": "6b7c8d9e-0f1a-4b2c-8d3e-4f5a6b7c8d9e",
"name": "JmeOrderPlacedEvent",
"definingSystem": {"id": "4f0c2a1e-8b7d-4c35-9a52-0d6c3e8f1b27", "name": "jme"},
"topic": "jme-order-placed",
"scope": "public",
"description": "An order was placed",
"documentationUrl": null,
"descriptorUrl": "https://registry.example.ch/descriptor/jme/event/JmeOrderPlacedEvent.json",
"participants": [
{"component": {"id": "9b1d6c0e-2f4a-4e8b-b1c7-5a3d2e9f0c11", "name": "jme-order-service",
"system": {"id": "4f0c2a1e-8b7d-4c35-9a52-0d6c3e8f1b27", "name": "jme"}},
"role": "PUBLISHER", "versions": ["1.1.0", "2.0.0"], "topic": "jme-order-placed"}
]
}
],
"total": 2, "offset": 0, "limit": 50, "nextOffset": null,
"source": {"name": "archrepo", "retrievedAt": "2026-12-01T10:15:30.001+01:00", "modelUpdatedAt": "2026-12-01T01:35:12.840+01:00"}
}

get_data_models​

ParameterDescription
typeOnly DATABASE_TABLE or MESSAGE_SCHEMA entries
nameOnly tables and message types whose name contains this text, ignoring case
limit1-100, default 20 - lower than the other tools, as a table is a large entry

Plus system or component, and offset. The published data models of a subject are:

  • DATABASE_TABLE: the tables of the database schemas its components published, with partitions reduced - {type, component, schemaName, schemaVersion, name, columns, primaryKey, foreignKeys, partitions}. columns are {name, type, nullable} in the published order, primaryKey is {name, columnNames}, foreignKeys are {name, columnNames, referencedTableName, referencedColumnNames}, and partitions is null for a table that stands for no partitions.
  • MESSAGE_SCHEMA: the payload schemas of the events and commands its components have a contract with, or that the system asked about defines - {type, messageType, kind, versions}, kind being EVENT or COMMAND. Only the relevant versions are listed, oldest first: the versions the contracts of the subject's components cover, and every version the registry has of a message type the system asked about defines. Each version is {version, known, keySchemaName, keySchemaUrl, valueSchemaName, valueSchemaUrl, compatibleVersion, compatibilityMode}; the Avro schemas themselves are not included, the URLs lead to them. known is false for a version a contract names but the message type registry does not have, whose other fields are then null.

Entries are ordered by type (DATABASE_TABLE, MESSAGE_SCHEMA), then by component and table, or by message type. In addition to the page, every result carries databaseSchemas: a summary of each database schema of the subject, not paginated, since it is small - empty when only message schemas are asked for.

FieldMeaning
componentThe component that published the schema
name, versionName of the database schema and its version, i.e. the version of the component that published it
readablefalse if the stored schema could not be read; it then contributes no tables
tableCountNumber of table entries, after reducing partitions and leaving out infrastructure tables
partitionedTablesHow many of these entries stand for partitions
hiddenTablesThe infrastructure tables left out
{
"subject": {"kind": "COMPONENT", "id": "9b1d6c0e-2f4a-4e8b-b1c7-5a3d2e9f0c11", "name": "jme-order-service",
"system": {"id": "4f0c2a1e-8b7d-4c35-9a52-0d6c3e8f1b27", "name": "jme"}},
"databaseSchemas": [
{"component": {"id": "9b1d6c0e-2f4a-4e8b-b1c7-5a3d2e9f0c11", "name": "jme-order-service",
"system": {"id": "4f0c2a1e-8b7d-4c35-9a52-0d6c3e8f1b27", "name": "jme"}},
"name": "data", "version": "3.4.0", "readable": true, "tableCount": 2, "partitionedTables": 1,
"hiddenTables": ["flyway_schema_history", "shedlock"]}
],
"items": [
{
"type": "DATABASE_TABLE",
"component": {"id": "9b1d6c0e-2f4a-4e8b-b1c7-5a3d2e9f0c11", "name": "jme-order-service",
"system": {"id": "4f0c2a1e-8b7d-4c35-9a52-0d6c3e8f1b27", "name": "jme"}},
"schemaName": "data",
"schemaVersion": "3.4.0",
"name": "orders",
"columns": [{"name": "id", "type": "uuid", "nullable": false},
{"name": "placed_at", "type": "timestamptz", "nullable": true}],
"primaryKey": {"name": "orders_pkey", "columnNames": ["id"]},
"foreignKeys": [],
"partitions": {"count": 2, "firstSuffix": "_2025", "lastSuffix": "_2026"}
},
{
"type": "MESSAGE_SCHEMA",
"messageType": {"id": "6b7c8d9e-0f1a-4b2c-8d3e-4f5a6b7c8d9e", "name": "JmeOrderPlacedEvent",
"definingSystem": {"id": "4f0c2a1e-8b7d-4c35-9a52-0d6c3e8f1b27", "name": "jme"}},
"kind": "EVENT",
"versions": [
{"version": "1.1.0", "known": true, "keySchemaName": null, "keySchemaUrl": null,
"valueSchemaName": "JmeOrderPlacedEvent", "valueSchemaUrl": "https://registry.example.ch/schema/JmeOrderPlacedEvent_v1.1.0.avsc",
"compatibleVersion": "1.0.0", "compatibilityMode": "BACKWARD"}
]
}
],
"total": 3, "offset": 0, "limit": 20, "nextOffset": 2,
"source": {"name": "archrepo", "retrievedAt": "2026-12-01T10:15:30.001+01:00", "modelUpdatedAt": "2026-12-01T01:35:12.840+01:00"}
}

Partitioned tables​

A published schema does not say which tables are partitions, so they are recognised by name and shape - the rule the jEAP Doc Service applies to the same schemas, so that an agent sees the tables the generated documentation shows:

  1. A table whose name ends in a last segment of digits (_2024, _20260904) or of digits with a tag of one to four letters (_p3, _ym110) belongs to the stem before that segment.
  2. Two or more tables of one stem whose columns (name, type, nullability, in order) and primary key columns are identical are taken as the partitions of one table. Foreign keys are not compared, since a partition of a child table points at the counterpart partition of its parent. Nothing validates a date: _202613 counts like _202612.
  3. They are reduced to one entry named <stem>_*, whose partitions say how many tables it stands for and the first and last suffix, ranged by tag and then by number (_9 before _10).
  4. In addition to the Doc Service: if the schema also has the table <stem> itself with the same columns and primary key - the partitioned table - the partitions are reduced to that table, which keeps its name.
  5. A foreign key pointing into a partition names the entry the partition was reduced to.

The tables of Flyway and ShedLock (flyway_schema_history, shedlock), which every jEAP service has and which describe no data of its own, are left out and listed in hiddenTables.

Ids, sources and freshness​

Ids. Every system and component carries the id under which the arch repo stores it, next to its name, and so do relations, REST endpoints and message types. Each tool accepts the id of a system or component wherever it accepts the name, so an agent can keep working with an id it got from an earlier call - e.g. from the consumer of a dependency into get_interfaces.

  • A component keeps its id while it exists, also when it moves to another system - after a rename of its system or an alias moved to another system.
  • A system keeps its id while it exists, including a rename that only changes the case of its name. A real rename in the configuration removes the system and creates a new one with a new id; its components move to the new system and keep their ids (see Configuration).
  • A component removed from the model and imported again later, or a system removed from the configuration and declared again, gets a new id.
  • Ids are per instance: two instances - for example one per environment - have different ids for the same component. Use the names, which are unique, to correlate elements across instances.

Sources. importer names the source that last imported or saw a component: DEPLOYMENT_LOG for the deployment log, GRAFANA for the runtime metrics (Prometheus on AWS or RHOS), and so on. Live metrics win over the deployment log, so a component that both see is attributed to GRAFANA - see Importers. Systems and teams come from the configuration of the instance - see Configuration.

Freshness. lastSeen is when the component's source last saw it. Every result carries a source with

FieldMeaning
nameName of the instance (its MCP server name), so an organisation running several instances can tell them apart
retrievedAtWhen the data was read
modelUpdatedAtWhen the scheduled model update last completed, i.e. when all importers last brought the model up to date; null before the first update

Errors​

A failed call is an MCP tool result with isError: true and a structured {code, message}. The message is meant for the agent to correct its call, e.g. it points to find_systems for an unknown system.

CodeMeaning
INVALID_PARAMETERA parameter is missing, blank, longer than 255 characters, contains control characters or is out of range, or an integration tool got neither or both of system and component
SYSTEM_NOT_FOUNDNo system with this id, name or alias
COMPONENT_NOT_FOUNDNo deployed component with this id or name (in this system)
SOURCE_UNAVAILABLEThe architecture model could not be read from the database; the call can be retried later

In addition, the codes of the jEAP MCP starter can occur: FORBIDDEN, TIMEOUT, CAPACITY_EXCEEDED, RESULT_TOO_LARGE and INTERNAL_ERROR (with a correlation id for the log).

Security​

Open by default​

For now the tools are open to every caller, by team decision: the module sets jeap.mcp.security.anonymous-access of the jEAP MCP starter to true, so a request without a token reaches the endpoint, and every tool permits it. No authorization server, role or sign-in is needed to use them.

What they serve is mostly public already: systems, components and teams with their contact addresses (GET /api/model, GET /api/model/export), relations (GET /api/model/{system}/relations) and REST endpoints and OpenAPI specs (GET /api/openapi/**) are read without authentication - see Security. Message schemas are only named and linked. The exception is get_data_models: the tables, columns and keys of the database schemas are served by the REST APIs only with a role (/external-api/dbschemas with external-database-schema / read, the docs API with architecture-model / read). While the tools are open, get_data_models serves them to every caller - deliberately; the REST APIs stay as they are.

Even so:

  • A token that is present is still validated: an expired token, or one of an unknown issuer, key or audience, is rejected with 401.
  • Opening the MCP endpoint opens nothing else. The docs API keeps requiring its role, /api/** its basic credentials.
  • The protected resource metadata stays published at /.well-known/oauth-protected-resource, and jeap.mcp.security.resource-uri stays required: the starter requires it on every OAuth2 resource server, which the arch repo always is.

Requiring the role​

Set jeap.mcp.security.anonymous-access: false to switch authentication on. The same property decides both whether a request without a token reaches the endpoint and whether the tools permit every caller, so the two cannot disagree. Then:

  • Authentication: the MCP endpoint is an OAuth2 resource server on a filter chain of its own, ordered between the basic-auth chain of /api/** and the jEAP chain serving everything else - see Security. Requests without a valid bearer token are answered with 401 and a WWW-Authenticate header pointing to the protected resource metadata at /.well-known/oauth-protected-resource, from which an MCP client learns where to obtain a token. Issuer, signature, expiry and audience of the token are checked. The HTTP basic credentials of /api/** are not accepted.
  • Function authorization: all tools require the semantic role <system-name>_@architecture-model_#read, the role of the docs API, where <system-name> is jeap.security.oauth2.resourceserver.system-name of the instance. The module fails the startup if no system name is configured.
  • tools/list only requires authentication, so a caller without the role sees the tool names and descriptions but cannot call them. The descriptions contain nothing confidential.

Either way there is deliberately no data authorization per system: like the docs API, every caller allowed to call the tools may read the whole model. The starter does not log tool parameters or results.

Setting up an instance​

  1. Add the module next to jeap-archrepo-web (or jeap-archrepo-instance), with the same version:

    <dependency>
    <groupId>ch.admin.bit.jeap</groupId>
    <artifactId>jeap-archrepo-mcp</artifactId>
    <version>${jeap-archrepo.version}</version>
    </dependency>
  2. Set the external URL of the MCP endpoint. The instance already is a jEAP OAuth2 resource server with a system name, which the docs API requires anyway:

    jeap:
    security:
    oauth2:
    resourceserver:
    system-name: my-system # system part of the role my-system_@architecture-model_#read
    authorization-server:
    issuer: https://keycloak.example.ch/realms/my-realm
    mcp:
    security:
    resource-uri: https://archrepo.example.ch/my-archrepo-service/mcp

    resource-uri must be exactly the URL the MCP clients connect to, including the servlet context path: it is published as the resource of the protected resource metadata, and MCP clients compare the two.

  3. Route the MCP endpoint and the metadata to the instance. Under a context path these are /<context-path>/mcp and /<context-path>/.well-known/oauth-protected-resource. Per-client rate limits belong to the ingress or API gateway (see the jEAP MCP starter) - all the more while the tools are open.

That is all while the tools are open. To require the role instead:

  1. Set jeap.mcp.security.anonymous-access: false.

  2. In the authorization server, give the users or clients of the agents the role <system-name>_@architecture-model_#read, and provide a client the MCP clients can sign in with - depending on the client, a pre-registered public client or dynamic client registration. Tokens must carry the instance's resource id in their audience (default: spring.application.name, see the jEAP security starter for resource-id and audience validation).

  3. Make sure the instance sees the external scheme and host: the resource_metadata URL of the 401 challenge is built from the incoming request, so behind a reverse proxy the forwarded headers have to be honoured (server.forward-headers-strategy, which Spring Boot only enables by itself on Kubernetes and the cloud platforms it detects).

Defaults​

The module contributes the following defaults with the lowest precedence; an instance can override each of them.

PropertyDefault
spring.ai.mcp.server.namearchrepo
spring.ai.mcp.server.typeSYNC
spring.ai.mcp.server.protocolSTATELESS
spring.ai.mcp.server.stateless.mcp-endpoint/mcp
spring.ai.mcp.server.capabilities.resource/prompt/completionfalse (only tools)
jeap.mcp.security.anonymous-accesstrue (open, see Security)
jeap.mcp.tools.find_systems.timeout10s
jeap.mcp.tools.get_system.timeout5s
jeap.mcp.tools.get_component.timeout5s
jeap.mcp.tools.get_dependencies.timeout10s
jeap.mcp.tools.get_interfaces.timeout10s
jeap.mcp.tools.get_data_models.timeout10s
jeap.mcp.limits.max-concurrent-calls4
jeap.mcp.tools.find_systems.max-concurrent-calls2
jeap.mcp.tools.get_dependencies.max-concurrent-calls2
jeap.mcp.tools.get_interfaces.max-concurrent-calls2
jeap.mcp.tools.get_data_models.max-concurrent-calls2
jeap.archrepo.mcp.query-timeout-seconds4

spring.ai.mcp.server.name is also returned as source.name. The execution limits (jeap.mcp.limits.*, jeap.mcp.tools.<name>.*) are described in the jEAP MCP starter.

Protecting the database​

Every tool call holds a database connection while it runs, from the same pool (spring.datasource.hikari.maximum-pool-size, 10 by default) the REST APIs use, and of which the model update holds one for the whole import. The defaults above therefore keep agents from taking up that pool:

  • At most 4 tool calls run at the same time per instance, and at most 2 each of the tools that read across the whole model - find_systems, and the integration tools, which go through every relation and every message type; further calls are rejected immediately with CAPACITY_EXCEEDED and can be retried. Raise the limits only together with the pool size.
  • The queries of a tool call run with a transaction timeout of jeap.archrepo.mcp.query-timeout-seconds, which becomes the statement timeout: the database cancels a slow query itself, instead of letting it run on, holding its connection, after the starter has given up on the call at the tool timeout. Keep it below the tool timeouts. A cancelled query is reported as TIMEOUT.
  • Like the docs API, every tool assembles the model from the systems and their components, so its cost grows with the landscape. The queries are read-replica transactions: with a read replica configured (jeap.datasource.replica.enabled, see Security), they run on the replica instead of the primary database.

Connecting a client​

The endpoint is a Streamable HTTP MCP server at https://<host>/<context-path>/mcp. While the tools are open, a client connects without signing in; with the role required, it signs in through the OAuth flow it discovers from the 401 response. For example:

# Claude Code
claude mcp add --transport http archrepo https://archrepo.example.ch/my-archrepo-service/mcp

# GitHub Copilot CLI
copilot mcp add --transport http archrepo https://archrepo.example.ch/my-archrepo-service/mcp

For the GitHub Copilot plugin of the JetBrains IDEs and VS Code, add the server to mcp.json:

{
"servers": {
"archrepo": {
"type": "http",
"url": "https://archrepo.example.ch/my-archrepo-service/mcp"
}
}
}

The client versions tested end to end against a deployed instance are listed here once the instance has been rolled out.

Adding the server to an agent marketplace​

An agent marketplace distributes MCP servers and skills as versioned plugins, so the users of an organisation install the server with one command instead of configuring its URL themselves, and get updates in place. The jEAP Agent Marketplace is one: a single repository serving GitHub Copilot CLI, Claude Code and OpenAI Codex CLI (and OpenCode through an npm package). Its maintainer documentation describes the layout and the release process; the following is what an Architecture Repository plugin needs.

The URL of the MCP server is specific to an instance. A marketplace therefore offers the server of the instance its users work with - the organisation's own marketplace, or one plugin per instance in a shared one - rather than the library shipping a plugin.

  1. Create a plugin directory, e.g. plugins/archrepo/, with the MCP server configuration for Copilot and Claude Code in .mcp.json:

    {
    "mcpServers": {
    "archrepo": {
    "type": "http",
    "url": "https://archrepo.example.ch/my-archrepo-service/mcp"
    }
    }
    }

    and for Codex the same content in .codex-mcp.json, which the Codex plugin manifest .codex-plugin/plugin.json references with "mcpServers": "./.codex-mcp.json".

  2. Add the plugin manifests (.claude-plugin/plugin.json for Copilot and Claude Code, .codex-plugin/plugin.json for Codex) with name, version and a description, and a README.md saying what the server offers - and, once the instance requires the role, which role a user needs (<system-name>_@architecture-model_#read). For OpenCode, the plugin registers the server at runtime instead (.opencode-plugin/index.ts), as the jeap-dev-toolkit plugin does.

  3. Register the plugin in both marketplace manifests: in .claude-plugin/marketplace.json (Copilot and Claude Code) with an entry in plugins such as

    {
    "name": "archrepo",
    "description": "Architecture Repository: search and read the systems and components of the application landscape.",
    "version": "1.0.0",
    "source": "./plugins/archrepo"
    }

    and the corresponding entry in .agents/plugins/marketplace.json (Codex), as described in the maintainer documentation.

  4. Release it like any plugin of the marketplace: the version in the plugin manifests and in the marketplace entry in lockstep, and a changelog entry.

The users then install it in their agent, e.g. copilot plugin install archrepo@<marketplace> or /plugin install archrepo@<marketplace> in Claude Code. While the tools are open, the server works right away, like the public jEAP MCP server of the jeap-dev-toolkit plugin. Once the instance requires the role, the plugin needs no change: on the first call the agent starts the OAuth flow it discovers from the 401 response, and a user without the role gets FORBIDDEN from every tool.

Testing​

The integration tests run the module the way an AI client uses it: over HTTP, with the MCP client and the signed tokens of jeap-spring-boot-mcp-starter-test, against PostgreSQL, and under a servlet context path. They cover what only the assembled application shows, in both access modes:

TestCovers
ArchRepoMcpToolsITThe system and component tools: schemas, reading the model inside the tool call, the results, the error contract, the defaults
ArchRepoMcpIntegrationToolsITThe integration tools on a seeded landscape: schemas, every direction and role of the dependencies (the command turned around), interfaces, partitions reduced, relevant message versions, paging, errors, defaults
ArchRepoMcpOpenAccessITThe default: calls without a token, a present token still validated, nothing else opened
ArchRepoMcpProtectedAccessITanonymous-access: false: token validation, the OAuth challenge and metadata, the role, /api/** and the docs API next to the MCP endpoint

The tool logic itself is covered by unit tests.

  • Security - the filter chains and the semantic roles
  • Docs API - the REST API reading the same model with the same role
  • Configuration - where the properties live
  • Importers - the sources behind importer and lastSeen
  • Getting started - the minimal instance configuration