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 the platform package or source install flow.

ToolParametersDescription
capsem_createname?, ramMb?, cpuCount?, env?, image?Create and boot a new session from a profile. RAM/CPU fall back to profile VM defaults. Returns session ID.
capsem_runcommand, timeout?Run a command in a fresh one-shot VM and destroy it after completion. Returns stdout, stderr, exit_code.
capsem_listList sessions with ID, name, profile, status, RAM, CPUs, uptime, and telemetry.
capsem_infoidSession details: ID, name, profile, status, RAM, CPUs, version, plugin/profile metadata, telemetry.
capsem_resumenameResume a stopped named session or get ID of a running one. Returns session ID.
capsem_suspendidSuspend a retained session to disk (saves RAM + CPU state).
capsem_stopidStop a session.
capsem_deleteidDelete a session permanently. Destroys all retained state for that VM.
capsem_forkid, name, description?Fork a running or stopped session into a retained VM/template.
capsem_purgeall?Clean up disposable sessions. Set all=true to include retained 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_vm_logsid, grep?, tail?Serial + process 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, tool, network, 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_serversList configured MCP servers with connection status and tool counts.
capsem_mcp_toolsserver?List discovered MCP tools across all connected servers. Filter by server name to scope to one.
capsem_mcp_callname, arguments?Call an MCP tool by namespaced name (e.g. github__search_repos) with JSON arguments.
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_timeline", "arguments": { "id": "<id>", "layers": "net,model,tool,fs", "limit": 50 } }

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.