Documentation
¶
Overview ¶
MCP Apps extension — server-rendered UI resources for hosts that support it.
AWS tools for the MCP server — S3 operations. All AWS clients share a single configuration loaded by initAWSClients.
Environment variables:
AWS_REGION AWS region (default: us-east-1) AWS_ACCESS_KEY_ID Static access key (optional — falls back to IAM role) AWS_SECRET_ACCESS_KEY Static secret key (required when access key ID is set) AWS_ENDPOINT_URL Override endpoint URL (for MinIO, LocalStack, etc.) MCP_S3_FORCE_PATH_STYLE Use path-style S3 addressing (required for MinIO)
AWS Lambda tools for the MCP server.
AWS SSM Parameter Store and Secrets Manager tools for the MCP server.
Bridge between VaultRun tool handlers and the official MCP Go SDK.
Browser automation MCP tools ¶
VaultRun API client used by the MCP server.
Database bundle — SQLite, PostgreSQL, and MongoDB clients for MCP tools.
MongoDB MCP tool handlers.
PostgreSQL MCP tool handlers.
SQLite MCP tool handlers.
Local filesystem tools for the MCP server. Access is gated by MCP_FS_ALLOWED_PATHS (comma-separated absolute paths).
Flowd tools for the MCP server — local workflow automation via flowctl.
Environment variables:
MCP_FLOWD_ENABLED Set to "true" to expose flowd_* tools (explicit opt-in) FLOWCTL_PATH Path to flowctl binary (default: flowctl) FLOWD_CONFIG Optional config file path passed as --config to flowctl
GitHub API client for the MCP server.
HTTP transport for the VaultRun MCP server. Activated by setting MCP_TRANSPORT=http.
Environment variables (HTTP transport only):
MCP_PORT Listen address (default: :8080, or :443 in ACME mode)
MCP_AUTH_TOKEN Bearer token required on every request (required)
MCP_ACME_DOMAIN Enable Let's Encrypt auto-TLS for this hostname
MCP_ACME_CACHE_DIR Directory to cache ACME account keys and certs (default: /data/mcp-acme-cache)
MCP_ACME_EMAIL Contact email for the ACME account (recommended; enables expiry notices)
MCP_TLS_CERT Path to TLS certificate file (alternative to ACME)
MCP_TLS_KEY Path to TLS private key file (alternative to ACME)
MCP_ALLOWED_ORIGINS Comma-separated CORS origins (default: *)
MCP_TRUSTED_PROXIES Comma-separated CIDRs/IPs of trusted reverse proxies.
When empty (default) X-Forwarded-For is NOT trusted and the
rate limiter keys on the real TCP peer address. Set this only
when running behind a known proxy, otherwise clients could
spoof their source IP to bypass per-IP rate limiting.
MCP_RATE_LIMIT Max requests per minute per IP — global (default: 60)
MCP_RATE_LIMIT_WRITE Additional per-IP limit for workspace-write tools like
upload_file and delete_file (default: MCP_RATE_LIMIT/2)
MCP_RATE_LIMIT_HEAVY Additional per-IP limit for resource-creating tools like
run_command, create_session, create_snapshot, create_artifact
(default: MCP_RATE_LIMIT/3, minimum 1)
VaultRun MCP Server — exposes VaultRun sandbox capabilities as MCP tools.
Usage (stdio transport — default, for Claude Desktop/Code):
VAULTRUN_BASE_URL=http://localhost:8080 \ VAULTRUN_API_KEY=vr_yourkeyhere \ ./vaultrun-mcp
Usage (HTTP transport — for OpenAI, OpenRouter, and other platforms):
MCP_TRANSPORT=http \ MCP_AUTH_TOKEN=your-secret-token \ VAULTRUN_BASE_URL=http://localhost:8080 \ VAULTRUN_API_KEY=vr_yourkeyhere \ ./vaultrun-mcp
Environment variables (all transports):
VAULTRUN_BASE_URL Base URL of the VaultRun API (required)
VAULTRUN_API_KEY API key for authentication (required)
VAULTRUN_DEFAULT_IMAGE Default Docker image for sessions (default: python:3.12-slim)
VAULTRUN_LOG_FILE Write server logs to this file instead of stderr
MCP_TRANSPORT Transport to use: "stdio" (default) or "http"
GITHUB_TOKEN GitHub personal access token (optional). Required for
run_github_repo to clone private repos and for
github_post_comment to post to repos.
MCP_FS_ALLOWED_PATHS Comma-separated list of absolute paths the filesystem
tools (fs_read_file, fs_write_file, fs_list_dir,
fs_delete_file) are allowed to access. When unset,
all filesystem tools return an error.
MCP_AWS_ENABLED Set to "true" to enable all AWS tools (S3, SSM,
Secrets Manager, Lambda). Explicit opt-in prevents
accidental activation in environments with ambient
IAM credentials (EC2/ECS instance roles).
AWS_REGION AWS region (default: us-east-1).
AWS_ACCESS_KEY_ID Static access key (optional — falls back to IAM role).
AWS_SECRET_ACCESS_KEY Static secret key (required when access key ID is set).
AWS_ENDPOINT_URL Custom endpoint for MinIO, LocalStack, etc.
MCP_S3_FORCE_PATH_STYLE Set to "true" for path-style S3 addressing (MinIO).
Additional environment variables for MCP_TRANSPORT=http (see http.go):
MCP_AUTH_TOKEN, MCP_PORT, MCP_ALLOWED_ORIGINS, MCP_RATE_LIMIT MCP_TRUSTED_PROXIES (CIDRs/IPs of trusted reverse proxies) MCP_ACME_DOMAIN, MCP_ACME_CACHE_DIR, MCP_ACME_EMAIL (Let's Encrypt auto-TLS) MCP_TLS_CERT, MCP_TLS_KEY (static cert, alternative to ACME)
Database environment variables (optional — any combination can be enabled):
MCP_SQLITE_PATH Absolute path to a SQLite database file. MCP_PG_DSN PostgreSQL connection string (e.g. "postgres://user:pass@host/db"). MCP_MONGO_URI MongoDB connection URI (e.g. "mongodb://localhost:27017"). MCP_MONGO_DB MongoDB database name (default: test). Required with MCP_MONGO_URI.
Flowd environment variables (optional — local workflow automation bridge):
MCP_FLOWD_ENABLED Set to "true" to expose flowd_* tools via local flowctl FLOWCTL_PATH Path to flowctl binary (default: flowctl) FLOWD_CONFIG Optional config file for flowctl (--config)
Agent memory tools — persistent key/value notes in the sandbox workspace under .vaultrun/memory/. Survives within a session and via workspace snapshots.
OAuth / protected-resource auth for the HTTP MCP transport.
Modes (HTTP only):
- Static bearer — MCP_AUTH_TOKEN (required fallback / primary for local use).
- OAuth Protected Resource Metadata — when MCP_OAUTH_ISSUERS is set, publish /.well-known/oauth-protected-resource so clients (including Enterprise Managed Authorization / EMA clients) can discover authorization servers.
- Optional RFC 7662 introspection — MCP_OAUTH_INTROSPECTION_URL (+ client id/secret) validates non-static bearer tokens against the IdP.
EMA is primarily a client flow (extauth.EnterpriseHandler). Server-side EMA support is: advertise PRM, validate tokens from the enterprise auth server.
MCP shared protocol types, server state, and helpers.
Production transports (stdio + HTTP) use the official Go MCP SDK — see bridge.go, main.go, and http.go.
Tasks extension (io.modelcontextprotocol/tasks, SEP-2663) — pollable long-running work.
The official Go SDK (v1.7.0) does not yet ship first-class Tasks support. See tasks_sdk_compat.go for the registration seam and migration checklist. VaultRun implements the extension surface via custom methods so clients that advertise the extension can poll durable task handles.
Persistence: in-memory by default. When REDIS_ADDR or MCP_REDIS_ADDR is set and reachable, task metadata is stored in Redis (survives restarts / shared across MCP instances). Cancel funcs stay process-local; cross-instance cancel uses Redis pub/sub.
Upstream Go SDK Tasks compatibility notes and registration boundary.
As of github.com/modelcontextprotocol/go-sdk v1.7.0 (still latest on proxy.golang.org as of 2026-08), the SDK speaks MCP 2026-07-28 and exposes AddReceivingCustomMethod, but it does NOT ship first-class helpers for the Tasks extension (io.modelcontextprotocol/tasks, SEP-2663): no Task types, no tasks/get|update|cancel registration helpers, and no built-in async tool result wrapping. Re-check on each go-sdk upgrade before migrating.
VaultRun therefore keeps a server-side implementation in tasks.go / tasks_input.go / tasks_redis.go and registers the wire methods through registerTaskMethods. When upstream adds Tasks support, migrate by:
- Prefer SDK-native registration / types if they cover get/update/cancel and CreateTaskResult (resultType:"task").
- Keep VaultRun persistence (memory/Redis), security caps, owner binding, and input_required/confirm behavior behind the same taskStore.
- Delete or narrow this file once the SDK path is the only registration surface and sdk_ext_test.go still passes.
Do not invent a parallel Tasks protocol here — this file is only the documented seam between VaultRun's store and the SDK custom-method API.
MCP tool definitions and dispatch.
MCP verify_checkpoint — evaluate post-run assertions (exit/stdout/file).