Skip to main content

19. MCP Server (AI Assistant Integration)

The MCP (Model Context Protocol) server is a gateway that allows AI assistants, such as Claude, to query and diagnose field data from the Platform using natural language. The assistant can read tag values, gather alarm contexts, browse asset hierarchies, and perform acknowledgement (ack) processing.

It is not a replacement for the REST API — it calls the same V5 service layer within the same JVM, and it uses the same authentication, auditing, and rate limiting as /api/v5/*.

ItemValue
EndpointPOST https://<server>/api/v5/mcp
TransportStreamable HTTP, stateless — safe for restarts as it does not create sessions
SpecificationMCP 2025-11-25 Stable
Provided32 Tools · 7 Resources · 3 Prompts · Autocomplete · Progress · Elicitation

How to Connect​

Step 1 — Issuing api_key​

MCP does not have a separate authentication system and uses the V5 API key as is. Exchange it for the api_token issued by the administrator.

curl -s -X POST "https://<server>/api/v5/auth" \
-H "Content-Type: application/json; charset=UTF-8" \
-d '{"token":"<api_token>"}'
# 200: { "data": { "api_key": "..." }, "meta": { "status": "OK" }, "errors": null }
Success is not «HTTP 200»

Success is achieved only when meta.status is OK and data.api_key is not empty. Additionally, 503 does not mean the credentials are incorrect — it indicates a state where no determination was made because the token store could not be reached. A table detailing what to fix for each response is available in Getting Started §1.8.

Token role must be ADMIN or API

MCP sends all calls, including read calls, as POST. Since the V5 filter only allows POST·PUT·DELETE·PATCH for the ADMIN/API roles, if the token role is USER, even read tools will be rejected with a 403. Even if you plan to use it for read-only purposes, issue the token as ADMIN/API.

Step 2 — Registering with the Client​

# Claude Code
claude mcp add --transport http plantpulse "https://<server>/api/v5/mcp" \
--header "X-API-Key: <api_key>"
// Claude Desktop — .mcp.json
{
"mcpServers": {
"plantpulse": {
"type": "http",
"url": "https://<server>/api/v5/mcp",
"headers": { "X-API-Key": "<api_key>" }
}
}
}

Authorization: Bearer <api_key> can be used instead of X-API-Key. If authentication fails, the WWW-Authenticate: Bearer header is returned along with 401.

Clients connecting from a browser require Origin registration

To prevent DNS rebinding, the Origin header is checked against a whitelist. Native clients that do not send Origin, such as Claude Desktop or Claude Code, are always allowed, but browser-based clients must be registered in AI_MCP_ALLOWED_ORIGINS. Since the default value is empty, all such clients are 403 before registration.

32 Tools​

There are 31 read tools and 1 write tool (acknowledge_alarm). Tools for deletion, control, or configuration changes do not exist by design.

ToolFunctionRequired Arguments
search_entitiesFind domain object by name, ID, or description (Name → ID). Called first when ID is missingquery
list_latest_tag_valuesCurrent tag valuetag_ids
get_tag_historyTag historical data for a periodtag_id, from
get_asset_snapshotTag snapshot for all equipmentasset_id
list_alarmsAlarm list—
acknowledge_alarmAlarm acknowledgement — Reason (comment) is required and recorded in the audit trailalarm_seq, comment
get_alarm_contextAlarm cause diagnosis bundlealarm_seq
list_alarm_suppressionsHidden alarms (Hidden · Suppressed · Out of Service)—
get_alarm_performanceAlarm system performance — same value as GET /alarm/performancescope_type, scope_id
get_edge_statusStatus of a single Edge gatewayedge_id
list_edge_statusEdge gateway list—
get_edge_connection_historyEdge health history (Daily interval)edge_id, date
list_opc_connectionsOPC collection connection list—
get_asset_treeEquipment hierarchy treeasset_id
get_asset_by_externalFind hierarchy node by MES · EAM numberexternal_system, external_id
get_site_overviewSite ontology overviewsite_id
trace_asset_relationsRelationship tracking — Upstream · Downstream impactentity_id
query_knowledge_graphOntology SPARQL querysparql
list_asset_documentsEquipment attached documentsasset_id
get_asset_timelineEquipment event timelineasset_id
list_work_ordersWork order list—
get_work_order_kpiWork order details + KPIorder_id
get_work_order_by_externalFind work order by MES · ERP numberexternal_system, external_id
get_asset_kpiEquipment period KPI summary (Status · Alarm · OEE)asset_id, from
get_asset_scheduleEquipment · Site calendar (Shift · Stop · Holiday)asset_id
list_maintenance_ordersMaintenance order (Call · Repair · Part · ISO code)scope_id
get_maintenance_summaryMaintenance summary (Part · Failure mode · Waiting/Repair · Recurrence)scope_id
get_maintenance_order_by_externalFind maintenance order by CMMS numberexternal_system, external_id
get_connection_healthEquipment hierarchy health rollup—
get_current_timeCurrent server time—
get_eql_referenceEQL reference for console input (Syntax · Event types · Functions · Examples)surface
validate_eqlEQL compilation check (Does not deploy)surface, eql

The keys for maintenance rows are identical to V5 Maintenance Order — maintenance_order_id (character) · maintenance_kind_code · status_code · failure_record_seq · maintenance_plan_id (character) · failure_mode_code · maintainable_item_code. Since maintenance_order_id is either MAINTENANCE_ORDER_000001 or a numeric string from an old row ("12"), do not treat it as a number.

Severity values are ERROR · WARN · INFO

The critical/major/minor seen on the get_connection_health screen labels are display buckets. You must use the canonical value in the list_alarms(severity=) filter for it to be caught.

7 Resources​

These are read-only channels that allow the assistant to browse «what is available» before calling a tool.

pp://sites · pp://ontology/{site_id} · pp://assets/{site_id}/tree · pp://uns/{site_id} · pp://catalog/{store}/tables · pp://catalog/{store}/{table}/schema · pp://domain-graph

{store} only allows metastore · eventstore · analytics.

3 Prompts​

NameProcedure
diagnose-assetAsset failure diagnosis — Alarm → Context → Tag history → Connection → Downstream impact → Cause candidates
shift-briefingShift briefing — Health → Alarm → Order/KPI → Handover summary
alarm-triageAlarm classification — List → Priority → Recommendation → (Upon approval) Acknowledgement

Configuration — AI_MCP_* of pp.mm_config​

This is not a configuration file

The authoritative source is the PostgreSQL pp.mm_config table. plantpulse-ai.properties has been deleted and the read path is gone — refer to the Properties Reference.

KeyDefault ValueMeaning
AI_MCP_ENABLEDtrueIf false, then /api/v5/mcp returns 404
AI_MCP_ALLOWED_ORIGINS(Empty)Browser client Origin whitelist (comma separated)
AI_MCP_TREE_MAX_NODES2000Tree response node limit
AI_MCP_TREE_DEFAULT_DEPTH2get_asset_tree default depth
AI_MCP_TREE_MAX_NODE_TAGS100Number of tags per node
AI_MCP_TREE_ONTOLOGY_MAX_CHARS200000Ontology response character limit
AI_MCP_TREE_ONTOLOGY_DEFAULT_DEPTH3trace_asset_relations default depth
AI_MCP_TREE_ONTOLOGY_MAX_TAGS500Total tag row budget for ontology response

There is only one way to change the values — modifying the configuration screen (/config/index) or pp.mm_config. Since MCP reads the cache for every request, no restart is required.

🔴 PP_AI_MCP_* environment variables do nothing

This applies regardless of whether it is the first boot or not. The seeder that moved environment variables to the table and the ${PP_AI_*} substitution layer were removed on 2026-09-18. Even if provided, they are silently ignored without error — this is noted because «I configured it, so why isn't it working» is the most difficult failure to diagnose. Keys without a row are read using the default values in the table above.

Auditing and Safety​

  • Authentication, rate limiting, and auditing follow the same /api/v5/* filter chain.
  • acknowledge_alarm leaves its own audit trail (Actor MCP). If a reason is missing, the assistant is asked to supplement it; for clients without this capability, it is notified that «Reason is required».
  • Excluded from general change audit hooks. Since everything up to reading is POST, applying a hook would cause every call to be incorrectly recorded as a change.
  • No token transmission path — because it calls the same JVM service layer directly, there is no path to pass the received credentials to another system.

See Also​

Getting Started · Full List of Endpoints · Asset Service