Skip to content

v0.4.0

Choose a tag to compare

@ponmeloco ponmeloco released this 16 Sep 12:01
· 13 commits to main since this release
fca0f3f

A minor release that adds a second way to authenticate. In delegated mode the server holds no openITCOCKPIT credential of its own: it acts as the user each request is for, so one instance can serve many users of the same openITCOCKPIT and each of them sees only their own containers.

Warning

Delegated mode is a preview. It depends on user tokens issued by openITCOCKPIT, which ship with an upcoming openITCOCKPIT release. Until then no released openITCOCKPIT accepts them. Everything else in 0.4.0 works with openITCOCKPIT 5.6 and newer today.

Image openitcockpit/mcp-server:0.4.0 · amd64 + arm64
Digest sha256:001452f6aed400e4fbabdc59adea2428d128d85bd80065531189e503504cf3aa
Requires openITCOCKPIT 5.6 or newer · delegated mode (preview): an upcoming openITCOCKPIT release with user tokens
License MIT

Delegated mode (preview)

OITC_AUTH_MODE=static      # the default - every client acts as the user of OITC_APIKEY
OITC_AUTH_MODE=delegated   # no API key - every request acts as the user it carries a token for

In delegated mode a request carries a short-lived token openITCOCKPIT issued for one user, in X-OITC-User-Token. The server passes it on as Authorization: Bearer with every call it makes, and openITCOCKPIT verifies it and answers with that user's containers and permissions. A request without a token is refused before anything reaches openITCOCKPIT. static stays the default and behaves as before.

  • The token is attached to each outgoing request, never to the shared HTTP session. Concurrent requests for different users use that session at the same time, and a test runs sixteen of them at once without one picking up another's token.
  • Cached scope lookups are kept apart per token, not per the user id inside it, which this server does not verify.
  • OITC_APIKEY must be unset and the http transport is required - there is no user to act for over stdio.

Verified against an openITCOCKPIT that issues these tokens: a user with rights on one tenant sees that tenant's host and not the other's, creates a host in their own tenant but finds no container in the other, and the changelog attributes the change to that user. A forged token is rejected by openITCOCKPIT.

Toolsets as data

oitc-mcp --list-toolsets --format json

prints every set with its description, tools, system prompts, skills and whether it contains a tool that changes anything - read from the tools' annotations, so it cannot disagree with what they do. It follows OITC_TOOLSETS_FILE and needs no credentials, so an installer can create one instance per set before any key exists, without naming a set in its own code.

Fixed

  • get_container_tree without a name starts at the top-most containers the account can see. A user limited to tenants cannot see root and got No container found matching 'root'.
  • HTTP 403 is reported as a missing permission, HTTP 401 as an invalid or expired credential. Both used to point at OITC_APIKEY, which in delegated mode does not exist - and a missing role permission is not fixed by checking a key.

Tools

Unchanged: 39 tools - 24 read-only, 15 write. No tool was added, removed, renamed or given a different parameter.

Run it

docker run -d -p 8000:8000 \
  -e MCP_AUTH_TOKEN="a-token-you-generate" \
  -e OITC_AUTH_MODE="delegated" \
  -e OITC_BASEURL="https://openitcockpit.example.org" \
  -e OITC_TOOLSETS="triage" \
  openitcockpit/mcp-server:0.4.0

Important

Delegated mode is a preview and needs an openITCOCKPIT that issues user tokens - one that accepts Authorization: Bearer <token> and has a signing key from oitc api_tokens --generate-key. These ship with an upcoming openITCOCKPIT release; against any current release every call in delegated mode is rejected. Static mode is unaffected.

Note

Pin 0.4.0, don't follow latest. Still 0.x: the tool set and its parameters have not yet held still across releases.

What went into it

  • #10 - delegated mode, toolsets as JSON, and the container tree for users without root