FROST-Server Documentation

Live documentation for the development version.

MCP Interface

The MCP package adds a Model Context Protocol (MCP) server to the FROST-Server. MCP is the protocol used by LLM agents (AI assistants, IDE agents, chat clients) to interact with external systems. The MCP interface exposes a FROST-Server instance — any FROST data model, not just SensorThings Sensing — to such agents, so they can query and manage sensor data in natural language.

Since the MCP interface is a server on its own, it makes no changes to the SensorThings API or OData interfaces: agents build plain STA requests through the MCP tools, and the MCP layer maps those onto the same core Service as the HTTP interface.

The interface is not part of the SensorThings API standard, nor of the OData standard.

Running the MCP server

The MCP server is a stand-alone package, like the MQTT package: a runnable jar with embedded Jetty, and a docker image. It reads its settings from FrostMcp.properties or environment variables (see settings), boots the FROST core and a message bus exactly like the other front-ends, and serves MCP at http://host:port/mcp (Streamable HTTP transport).

Docker image: fraunhoferiosb/frost-server-mcp

docker run -d --name frost-mcp \
    -p 8080:8080 \
    -v $(pwd)/FrostMcp.properties:/usr/local/FROST/FrostMcp.properties \
    fraunhoferiosb/frost-server-mcp:latest

A minimal FrostMcp.properties:

mcp.port=8080
persistence.persistenceManagerImplementationClass=de.fraunhofer.iosb.ilt.frostserver.persistence.pgjooq.PostgresPersistenceManager
persistence.db.url=jdbc:postgresql://database:5432/sensorthings
persistence.db.username=sensorthings
persistence.db.password=changeMe

The MCP server can be added next to an existing instance sharing the same database.

Tools

Agents interact with the server through eight tools, which cover the full SensorThings API path and query language:

Tool Purpose
frost_get Read any resource by path (entity, entity set, index, property, $value).
frost_query Query an entity set with the full STA query language ($filter, $select, $expand, $orderby, $top, $skip, $count), passing the query parts as arguments.
frost_create Create entities (deep inserts supported).
frost_update Patch entities: mode=patch sends the changed properties, mode=changeset sends an RFC 6902 JSON Patch.
frost_replace Replace an entity (PUT semantics).
frost_delete Delete an entity by id path, e.g. Things(1).
frost_subscribe Subscribe the session to entity-change notifications: an entity set (optionally narrowed with $filter and $select) or a single entity.
frost_unsubscribe Remove one subscription (by id) or all subscriptions of the session.

All tools accept an optional version argument for servers that serve multiple API versions, so one MCP server can serve all versions at once. Results are STA JSON, delivered both as pretty-printed text and as structured content, so both simple and capable clients can use them.

Subscriptions

frost_subscribe turns an MCP session into a lightweight MQTT-style client: change events for the subscribed entities arrive without polling, pushed over the session’s own MCP notification stream.

Note: the MCP server pushes notifications it receives via its own message bus connection. As a stand-alone process it uses the in-JVM internal bus by default, which only sees the events of that process; connect it to the shared bus (bus.busImplementationClass=de.fraunhofer.iosb.ilt.sta.messagebus.MqttMessageBus) to receive events caused by other FROST front-ends writing to the same database.

Resources

MCP resources give the agent orientation about the server and its data model:

URI Content
frost://index The STA index document, as served on /v1.1.
frost://model The complete model: all entity types, with key, property and navigation summaries.
frost://model/{entitySet} Details for one entity set: properties, navigation properties, key.
frost://sta/{path} Any STA resource, e.g. frost://sta/Things(1), with the MCP limits applied.

Since the FROST data model is pluggable, the model resources are generated at server start-up from the actual model in the database, and are not limited to the standard Sensing entities.

Security

The MCP server uses the same authentication providers as the HTTP server: it can run with Basic authentication or Keycloak/OIDC. Sessions are authenticated on the HTTP request, and the MCP server authorises each tool call with the same roles and fine-grained rules (per user, entity type and property) as the HTTP interface. Read-only and write roles apply as usual, and a read-only MCP server can be configured with the mcp.allowTools setting.

Settings

The MCP server has the following settings, in the mcp. group: