attesta mcp wrap command starts a stdio proxy between your MCP client (VS Code, Cursor, Claude Desktop, Claude Code, Windsurf, etc.) and any upstream MCP server. Every tools/call request is intercepted, risk-scored, and either approved or denied before reaching the upstream server. No code changes to the MCP server are required.
Architecture
Usage
-- separator is required. Everything after it is the command to start the upstream MCP server.
Options
| Flag | Default | Description |
|---|---|---|
--config, -c | attesta.yaml | Path to the Attesta configuration file. If not found, uses built-in defaults. |
--risk-override TOOL=LEVEL | (none) | Override the risk level for a specific tool. Can be repeated. Levels: low, medium, high, critical. |
--log PATH | .attesta/audit.jsonl | Path to the audit log file. |
--trust-store PATH | .attesta/trust.json | Path to the trust store file. |
--agent-id ID | mcp-proxy | Agent ID recorded in audit entries and used by the trust engine. |
--environment ENV | development | Environment tag. Set to production for stricter risk scoring. |
--verbose | false | Print detailed log messages to stderr for every intercepted request. |
Quick Examples
How It Works
Spawn upstream server
The proxy starts the upstream MCP server as a child process using the provided command. The server’s stdin/stdout are connected via pipes. Its stderr passes through to your terminal for debugging.
Intercept tool calls
The proxy reads JSON-RPC messages from its own stdin (the MCP client). When it sees a
tools/call request, it extracts the tool name and arguments for evaluation. All other messages (tool listings, notifications, pings) pass through unchanged.Evaluate with Attesta
The tool call is evaluated through the full Attesta pipeline: risk scoring, trust adjustment, challenge selection, and operator verification. The challenge is presented in the terminal where
attesta mcp wrap is running.Forward or deny
If approved, the original request is forwarded to the upstream server. If denied, the proxy returns a JSON-RPC error response directly — the request never reaches the upstream server.
Risk Overrides
Use--risk-override to pin specific tools to a risk level, bypassing the automatic risk scorer for those tools:
attesta.yaml:
attesta.yaml
CLI
--risk-override flags take precedence over overrides defined in attesta.yaml. This lets you tighten risk levels for specific invocations without modifying the config file.Editor Configuration
Configure your editor to launch the proxy instead of the upstream MCP server directly. The proxy is transparent — the editor sees the same tool list and responses as it would from the upstream server.Common MCP Server Examples
Filesystem Server
The filesystem MCP server providesread_file, write_file, delete_file, list_directory, and other file operations. Wrapping it with Attesta adds approval gates to destructive operations while auto-approving reads.
PostgreSQL Server
The PostgreSQL MCP server exposes SQL query execution. Gate write and DDL statements at critical risk to prevent unreviewed schema or data changes.GitHub Server
The GitHub MCP server provides repository management, issue creation, and pull request operations. Gate write operations while allowing reads to flow through.Custom MCP Servers
Any MCP server that communicates over stdio can be wrapped, including custom Python or TypeScript servers:Multiple MCP Servers
You can wrap multiple MCP servers independently, each with their own risk policies:claude_desktop_config.json
Domain-Aware Proxying
Combine MCP wrapping with domain profiles for industry-specific risk scoring:attesta.yaml
DROP TABLEandTRUNCATEare always CRITICAL- Production-targeted queries receive a +0.3 risk boost
- Custom domain escalation rules (dual DBA approval, change ticket verification) apply if configured
Runtime Output
The proxy logs decisions to stderr (visible in your terminal but not sent to the MCP client):--verbose for additional detail including the full tool arguments and evaluation timing:
Denial Response
When Attesta denies a tool call, the proxy returns an MCP-compatible error response to the client:Protocol Support
The proxy auto-detects the framing format used by the MCP client and server:| Format | Description | Used By |
|---|---|---|
| Content-Length framing | Content-Length: N\r\n\r\n{...} (official MCP/LSP spec) | Most MCP servers |
| Newline-delimited JSON | One JSON object per line | Some MCP implementations |
Exit Behavior
The proxy exits when:- The upstream MCP server process exits (exit code is forwarded)
- The MCP client disconnects (stdin closes)
- The proxy receives
SIGINTorSIGTERM(the upstream server is terminated gracefully)
Next Steps
MCP Integration
Programmatic MCP integration with MCPProxy and decorators
attesta audit
Verify and inspect the audit trail
attesta trust
Manage agent trust profiles
Domain Profiles
Activate domain-specific risk scoring for MCP tools