unikraft mcp
The server speaks the Model Context Protocol over stdin and stdout, or over
HTTP with --listen, so an AI assistant such as Claude Code, Claude Desktop
or Cursor can manage Unikraft Cloud through typed tools instead of shelling
out to the CLI.
Every resource type gets list, create, edit and delete tools, named like
instance_list or volume_create. A list tool also fetches specific resources
when given keys. Instances additionally get instance_control for start,
stop, restart and suspend, and instance_logs. Sandboxes get sandbox_exec,
sandbox_read and sandbox_write for the commands and files inside them.
The tools use the current profile and fan out across its metros exactly like
the matching CLI commands do. Every tool call reads the configuration file
again, so unikraft login and unikraft profile use take effect without
restarting the server. Unless --profile pins one, profile_use lists the
profiles and switches between them.
Pass --resources with a comma-separated list of resource types to serve
only their tools, such as --resources instance,volume,metro. The names
are the prefixes of the tool names. A shorter tool list costs an assistant
less context on every turn.
The documentation is served as resources: unikraft://docs is the table of
contents and unikraft://docs/<path> a page, such as unikraft://docs/cli/fields.
Pages are fetched from the documentation site when read, so they cost
nothing until an assistant asks for one.
Diagnostics always go to stderr, because stdout carries the protocol in stdio
mode. Raise them with --log-level debug. A --timeout ends the whole
session when it expires.
Register the server with a client as a stdio server, for example:
{"mcpServers": {"unikraft": {"command": "unikraft", "args": ["mcp"]}}}
With --listen host:port the same tools are served over HTTP at /mcp, with
a liveness check at /healthz, still using this profile's credentials. Pass
--tls-cert and --tls-key to serve HTTPS instead. Only loopback addresses
are accepted unless --allow-remote is given. TLS encrypts the traffic but
does not authenticate clients, so then put an authenticating proxy in front,
since every client acts as you. A --timeout then stops accepting requests
and drains the calls in flight. Clients register the server by URL:
{"mcpServers": {"unikraft": {"type": "http", "url": "http://127.0.0.1:8080/mcp"\}\}\}
Code
Examples
Serve every tool over stdio:
Code
Serve only the tools that cannot change anything:
Code
Serve only the instance, volume and metro tools:
Code
Serve another profile with debug logs on stderr:
Code
Serve over HTTP on the loopback interface:
Code
Serve HTTPS on every interface with a certificate:
Code
Serve every interface on an instance whose service terminates TLS:
Code
Options
Code
Options inherited from parent commands
Code
See Also
unikraft: The Unikraft Command-Line Interface.