Skip to main content

MCP Server

The optional module jeap-deploymentlog-mcp lets AI agents read the current deployment state and search the deployment history of a Deployment Log instance via the Model Context Protocol (MCP). It builds on the jEAP MCP starter, which provides the MCP endpoint (Spring AI, SYNC, STATELESS, Streamable HTTP), execution limits, a stable error contract and metrics.

The MCP endpoint is an addition to the REST API and is open: it requires no authentication (see Security). The REST API keeps its HTTP basic authentication and is not changed by the module.

Tools​

ToolPurpose
get_systemsAll systems with their aliases and the number of components deployed per environment (stage)
get_componentsThe components of one system with their deployed version per environment, paginated
get_deployed_versionThe version of one component currently deployed on one environment
find_deploymentsThe recorded deployments by system, component, environment, version, Jira issue, time and state, paginated: the deployment history

All tools are read-only and only report what the Deployment Log knows. For the current state (get_systems, get_components, get_deployed_version), a version is only "deployed" once a code deployment of it has been reported as successful: running, failed or cancelled deployments and configuration-only deployments do not change the deployed version. find_deployments lists all recorded deployments, whatever their state.

Fields without a value are left out of the results; no field is ever null. The paginated tools return the filters a page was selected with once, in filters, with the stored names (e.g. the system name for an alias, the environment as stored); the fields these filters fix are left out of the entries. Agents typically start with get_systems to find the name of a system, then list its components with get_components.

get_systems​

No parameters. Returns all systems of the instance, ordered by name (case-insensitive), not paginated:

{
"items": [
{"name": "jme", "aliases": ["jme-old"], "deployedComponents": {"DEV": 12, "REF": 12, "PROD": 9}},
{"name": "retired-system"}
],
"total": 2,
"source": {"name": "deploymentlog", "retrievedAt": "2026-11-30T10:15:30.001+01:00"}
}

deployedComponents counts the components currently deployed per environment, in staging order; environments without a deployed component of the system are left out, and a system without any deployed component has no deployedComponents. aliases are left out if the system has none. The other tools accept the name and the aliases as systemName.

get_deployed_version​

ParameterRequiredDescription
componentNameyesName of the component, matched exactly (case-sensitive)
environmentyesName of the environment, e.g. DEV, REF, ABN, PROD, matched case-insensitively
systemNamenoName (case-insensitive) or alias (exact) of the system; only needed if the component name exists in several systems
{
"systemName": "jme",
"componentName": "jme-order-service",
"environment": "REF",
"status": "DEPLOYED",
"version": "1.42.0",
"deployedAt": "2026-11-30T09:12:44.512+01:00",
"source": {"name": "deploymentlog", "retrievedAt": "2026-11-30T10:15:30.001+01:00"}
}
statusMeaning
DEPLOYEDversion is deployed; deployedAt is when its deployment completed
UNDEPLOYEDThe component was undeployed from the environment at undeployedAt; no version is deployed there
NOT_DEPLOYEDNo deployment of the component on the environment is recorded (also once the housekeeping has removed an old undeployment); version, deployedAt and undeployedAt are left out

source names the instance (its MCP server name) and when the data was read. The deployment the state comes from is found with find_deployments (system, component, environment and version), which also returns its deploymentId.

get_components​

ParameterRequiredDescription
systemNameyesThe system whose components are listed (name case-insensitive, or alias); see get_systems
environmentnoOnly list this environment (case-insensitive)
includeUndeployednoAlso list components undeployed from an environment, default false
offsetnoNumber of entries to skip, default 0
limitnoMaximum number of entries, 1–200, default 100

The system is required and the page size limited so that a result stays small enough for an agent (a page of 100 entries is about 16 000 characters); for an overview over all systems, use get_systems. The result is a page {filters, items, total, offset, limit, nextOffset, source}:

{
"filters": {"systemName": "jme", "environment": "REF"},
"items": [
{"componentName": "jme-order-service", "status": "DEPLOYED", "version": "1.42.0", "deployedAt": "2026-11-30T09:12:44.512+01:00"}
],
"total": 1, "offset": 0, "limit": 100,
"source": {"name": "deploymentlog", "retrievedAt": "2026-11-30T10:15:30.001+01:00"}
}

filters has the stored systemName, the environment if given and includeUndeployed: true if set. Each item has the fields of get_deployed_version without source and without the fields given in filters (systemName always, environment if filtered). Items are ordered by component name and environment staging order; while nextOffset is set, calling again with offset = nextOffset returns the next page. nextOffset is left out on the last page.

find_deployments​

ParameterDescription
systemNameOnly deployments of this system (name case-insensitive, or alias)
componentNameOnly deployments of components with this name (exact); in all systems unless systemName is given
environmentOnly deployments on this environment (case-insensitive)
versionOnly deployments of this version (exact)
jiraIssueOnly deployments whose changelog contains this Jira issue, e.g. JEAP-1234 (case-insensitive)
fromOnly deployments started at or after this time, ISO-8601 with offset, e.g. 2026-09-01T00:00:00+02:00
toOnly deployments started before this time (exclusive), ISO-8601 with offset
stateOnly deployments in this state: STARTED (still running), SUCCESS, FAILURE, CANCELLED
offsetNumber of entries to skip, 0–10000, default 0
limitMaximum number of entries, 1–100, default 20

All parameters are optional, but at least one filter is required; the given filters are combined with AND. The filters are the ones of GET /api/deployment-records, with the name handling of the other tools (system aliases, case-insensitive environments) plus the state. An unknown system, component or environment is an error rather than an empty result.

The result is a page {filters, items, total, offset, limit, nextOffset, source} ordered newest first by start time, then by deploymentId. filters echoes the given filters with the stored names (system, component and environment as stored, the Jira issue upper case). Each item, here without filters fixing any of its fields:

{
"deploymentId": "jme-order-service-ref-20261130-0912",
"systemName": "jme",
"componentName": "jme-order-service",
"environment": "REF",
"version": "1.42.0",
"state": "SUCCESS",
"undeployment": false,
"deploymentTypes": ["CODE"],
"startedAt": "2026-11-30T09:10:02.100+01:00",
"endedAt": "2026-11-30T09:12:44.512+01:00",
"startedBy": "jenkins-jme",
"jiraIssueKeys": ["JME-812", "JME-815"],
"comparedToVersion": "1.41.0"
}

The fields a filter fixes (systemName, componentName, environment, version, state) are left out of the items; with a componentName but no systemName filter, systemName is kept, as the component name can exist in several systems. deploymentId is always there: it is the {id} under which the deployment was recorded (PUT /api/deployment/{id}) and the only field that tells two deployments of the same version to the same environment apart. endedAt is left out while a deployment is running, comparedToVersion if the changelog has none. startedBy is who (usually which technical user) started the deployment, as reported by the pipeline; the tool offers no filter on it. Deployments recorded between two calls shift the following pages; to page through a stable result, pass source.retrievedAt of the first page as to in the following calls. Offsets are capped at 10000; narrow the filters, e.g. with from and to, to look further back.

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 lists the known environments or the components of the system.

CodeMeaning
INVALID_PARAMETERA parameter is blank, longer than 255 characters, out of range, not a timestamp or not a Jira issue key, or a required filter is missing
SYSTEM_NOT_FOUNDNo system with this name or alias; get_systems lists the systems
COMPONENT_NOT_FOUNDNo component with this name (in this system)
AMBIGUOUS_COMPONENTThe component name exists in several systems; pass systemName
ENVIRONMENT_NOT_FOUNDNo environment with this name
SOURCE_UNAVAILABLEThe Deployment Log database could not be read; the call can be retried later

Missing deployments are therefore never errors (they are a status), and unknown names are never reported as NOT_DEPLOYED. In addition, the codes of the jEAP MCP starter can occur: TIMEOUT, CAPACITY_EXCEEDED, RESULT_TOO_LARGE and INTERNAL_ERROR (with a correlation id for the log).

A missing required parameter (e.g. systemName of get_components) is rejected before the tool runs, by the input validation of the MCP SDK against the tool's schema; that error names the parameter but has no code. A blank one is reported as INVALID_PARAMETER.

Security​

  • No authentication: the MCP endpoint is deliberately open. The module enables anonymous access (jeap.mcp.security.anonymous-access: true) and declares the tools with @PreAuthorize("permitAll()"), so an MCP client needs neither a token nor credentials, and the instance does not need to be a jEAP OAuth2 resource server. No OAuth protected resource metadata is published, so clients do not start an OAuth sign-in.
  • No authorization: every caller who can reach the endpoint may read the deployment state and history of all systems of the instance; they are not considered confidential between the teams using an instance. find_deployments returns startedBy, which the REST read API exposes as well; it is usually a technical user, but can name a person. The starter does not log tool parameters or results, and there is no filter by startedBy.
  • Network access therefore decides who can call the tools. Restrict access to /mcp at the ingress or API gateway where needed; per-client rate limits belong there as well (see the jEAP MCP starter).
  • The REST API (/api/**) keeps its HTTP basic authentication; opening the MCP endpoint does not open it.
  • If the instance is configured as a jEAP OAuth2 resource server anyway, the endpoint stays open, but the starter then also requires jeap.mcp.security.resource-uri, publishes the OAuth metadata at /.well-known/oauth-protected-resource and rejects a request carrying an invalid token with 401.

Setting up an instance​

  1. Add the module next to jeap-deploymentlog-web. With jeap-deploymentlog-service-instance as Maven parent the version is managed; in a multi-module project, use the same version as for jeap-deploymentlog-web:

    <dependency>
    <groupId>ch.admin.bit.jeap</groupId>
    <artifactId>jeap-deploymentlog-mcp</artifactId>
    </dependency>
  2. Route /mcp to the instance, and restrict access to it at the ingress or API gateway where needed (see Security). No security configuration is needed: the endpoint is open with the defaults below.

Defaults​

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

PropertyDefault
spring.ai.mcp.server.namedeploymentlog
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 endpoint)
jeap.mcp.tools.get_deployed_version.timeout5s
jeap.mcp.tools.get_components.timeout10s
jeap.mcp.tools.find_deployments.timeout10s
jeap.mcp.tools.get_systems.timeout5s
jeap.mcp.limits.max-concurrent-calls4
jeap.mcp.tools.get_components.max-concurrent-calls2
jeap.mcp.tools.find_deployments.max-concurrent-calls2
jeap.deploymentlog.mcp.query-timeout-seconds4

spring.ai.mcp.server.name is also returned as source.name, so an organisation running several instances can tell them apart. 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 API uses to record deployments. The defaults above therefore keep agents from taking up that pool:

  • At most 4 tool calls run at the same time per instance (2 each of get_components and find_deployments); 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.deploymentlog.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.
  • If the instance has a read replica, enable it (jeap.datasource.replica.enabled, see jeap-spring-boot-tx): the tool queries are read-replica transactions and then run on the replica instead of the primary database.

Connecting a client​

The endpoint is a Streamable HTTP MCP server at https://<instance>/mcp; the client needs nothing but the URL (no sign-in, no token). For example:

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

# Claude Code
claude mcp add --transport http deploymentlog https://deploymentlog.example.ch/mcp

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

{
"servers": {
"deploymentlog": {
"type": "http",
"url": "https://deploymentlog.example.ch/mcp"
}
}
}

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

Testing​

DeploymentLogMcpToolsIT tests the module the way an AI client uses it: over HTTP with the MCP client of the MCP Java SDK, without any credentials, against an instance that is no OAuth2 resource server. It covers what only the assembled application shows (tool schemas, the open endpoint without OAuth metadata, the error contract, the REST API still requiring basic authentication next to the MCP endpoint); the tool logic itself is covered by unit tests.