Skip to content

MCP Tools

When the capsem-mcp stdio server is registered with your AI CLI, the agent gains 26 tools for creating and driving VM sessions, running commands, reading and writing files inside the guest, querying telemetry, reading host logs, and calling into the guest MCP path.

All tools use camelCase parameter names on the wire (e.g. ramMb, cpuCount). The source of truth is crates/capsem-mcp/src/main.rs.

Register the server in your AI CLI settings. For Claude Code:

{
"mcpServers": {
"capsem": { "command": "capsem-mcp" }
}
}

The binary is installed to ~/.capsem/bin/capsem-mcp by capsem setup.

ToolParametersDescription
capsem_createname?, ramMb?, cpuCount?, env?, image?Create and boot a new session. Named sessions are persistent. RAM/CPU fall back to the user’s configured defaults. Returns session ID.
capsem_runcommand, timeout?Run a command in a fresh temporary session. Auto-provisions and destroys the VM. Returns stdout, stderr, exit_code.
capsem_listList all sessions (running and stopped persistent) with ID, name, status, RAM, CPUs, uptime, and telemetry.
capsem_infoidSession details: ID, name, status, persistent, RAM, CPUs, version, telemetry.
capsem_resumenameResume a stopped persistent session (or get ID of a running one). Returns session ID.
capsem_suspendidSuspend a session to disk (saves RAM + CPU state). Persistent sessions only.
capsem_stopidStop a session. Persistent sessions preserve state; ephemeral sessions are destroyed.
capsem_deleteidDelete a session permanently. Destroys all state including persistent data.
capsem_persistid, nameConvert a running ephemeral session to a persistent named session.
capsem_forkid, name, description?Fork a running or stopped session into a new stopped persistent session. Works as a reusable template.
capsem_purgeall?Kill all temporary sessions. Set all=true to also destroy persistent sessions.
ToolParametersDescription
capsem_execid, command, timeout?Run a shell command inside a running session. Returns stdout, stderr, exit_code. Default 30s timeout.
capsem_read_fileid, pathRead a file from the guest filesystem. Returns text content.
capsem_write_fileid, path, contentWrite a file into the guest filesystem.
ToolParametersDescription
capsem_inspect_schemaGet CREATE TABLE statements for all session telemetry tables. Call before capsem_inspect to know what columns are available.
capsem_inspectid, sqlRun a read-only SQL query against a session’s telemetry database. Returns columns and rows.
capsem_vm_logsid, grep?, tail?Security, process, and serial logs for a session. grep filters lines, tail limits to last N lines.
capsem_service_logsgrep?, tail?Latest capsem-service logs (last ~100 KB). grep + tail filters.
capsem_host_logsname, grep?, tail?, maxBytes?Read an allowlisted host log by symbolic name: service, mcp, gateway, tray, or app.
capsem_panicssince?, limit?, id?Extract structured Rust panics and backtraces from recent host logs.
capsem_triagesince?, limit?, id?Summarize recent panics, dropped IPC frames, server errors, and slow operations.
capsem_timelineid, traceId?, since?, limit?, layers?Render a time-ordered session timeline across exec, MCP, network, security, filesystem, and model events.

These tools let the agent exercise the full guest MCP path through /run/capsem-mcp-server and framed MITM MCP on vsock:5002 (policy + telemetry) without having to drive capsem_exec by hand.

ToolParametersDescription
capsem_mcp_connectorsprofile?List Profile V2 mcpServers entries for the selected or requested profile.
capsem_mcp_addid, profile?, disabled?, type?, command?, args?, env?, url?, headers?, bearerToken?, credential_refs?, allowed_tools?Add a standard MCP server entry plus Capsem governance metadata to a user profile.
capsem_mcp_deleteid, profile?Delete a direct user Profile V2 MCP server entry.
ToolParametersDescription
capsem_versionMCP server version and service connectivity status.

One-shot command in a disposable VM:

{ "tool": "capsem_run", "arguments": { "command": "curl -s https://api.github.com/zen" } }

Iterative debugging in a long-lived VM:

{ "tool": "capsem_create", "arguments": { "name": "dev" } }
{ "tool": "capsem_exec", "arguments": { "id": "<id>", "command": "capsem-doctor -k net" } }
{ "tool": "capsem_inspect", "arguments": { "id": "<id>", "sql": "SELECT domain, decision, status_code FROM net_events ORDER BY timestamp DESC LIMIT 10" } }

Fork a template and boot from it:

{ "tool": "capsem_fork", "arguments": { "id": "<id>", "name": "python-ready" } }
{ "tool": "capsem_create", "arguments": { "image": "python-ready" } }

For CLI equivalents of these commands see the CLI reference.