Install
This page is for standalone MCP tool handlers you own directly. If MCP is being surfaced through OpenAI Agents or another higher-level SDK, use that native adapter page instead.
Net-new VerifiedX code
This is the actual VerifiedX delta in an existing MCP server.That is the important part. The rest of your MCP server stays the same: your
listTools() output, transport, server wiring, and request routing do not need to be redesigned.wrap_tool_handler(...) is a thin adapter over VerifiedX core boundary wrappers. It uses the same preflight, decision-receipt, execution-report, and runtime-loopback path as the rest of the product.Your MCP tool surface is the config here. VerifiedX uses your existing tool names, descriptions, schemas, and params shape as the source of truth for what to preflight.
Optional: wrap tool definitions too
If your server returns tool definitions directly, you can also wrap them before returning them fromlistTools():
Boundary protection lives in
wrap_tool_handler(...). wrap_tool_definition(...) just enriches the tool definitions you expose from your MCP server.Full example
Do not use raw
install_runtime(...) for this path. The Python MCP surface is wrap_tool_handler(...), with optional wrap_tool_definition(...) for listTools() metadata.Composed systems
If this MCP tool call is part of a larger multi-agent or agent+human workflow, pass upstream context into VerifiedX so the current tool invocation has better system and situational awareness before it takes a high-impact action. This is useful when a supervisor agent, parent workflow, or human reviewer already has context that the current MCP tool should use before taking action. VerifiedX does not require a fixed schema for this. Pass the upstream context you already have in any JSON-serializable shape.Upstream context is supporting workflow context from outside the current tool invocation. It is not proof that this tool already executed any local action.
Async handlers
If your MCP handler is async,wrap_tool_handler(...) preserves that shape:
What the wrapper already does
Once wrapped, VerifiedX handles the MCP tool boundary directly. That includes:- Injecting
_meta.verifiedxinto request params and result payloads - Recording retrieval-like tools into run history as support inputs
- Preflighting high-impact tools before the handler runs
- Observing tool-result ingress with
sourceUri: "mcp://<tool_name>" - Emitting MCP tool-result events with
sourceLineage: ["mcp_tool"]
What gets preflighted
VerifiedX infers the protected boundary from the MCP tool name and params. That includes:memory_writeexternal_message_sendrecord_mutationsystem_change
search_memoriesrecords retrieval historyadd_memorywithnamespace,key, andvaluepreflights asmemory_writesend_emailinfersexternal_message_sendupdate_customer_recordinfersrecord_mutationset_workflow_statusinferssystem_change
The explicit override today is mainly
policy_scope="memory_write" for durable memory writes. Other action classes are inferred from the MCP tool name and params shape.What to expect at runtime
Protected MCP boundaries can return:allowallow_with_warningreplan_requiredgoal_fail_terminal
ok: falseblocked: trueboundary_outcomesafe_next_stepsdecision_receipt
Validation coverage
The standalone Python MCP wrapper is directly covered in this repo. That includes:- Retrieval history carrying into a later memory-write preflight
- Durable memory writes preflighting as
memory_write - Internal workflow updates preflighting as
system_change - Blocked external sends returning the normal loopback result and suppressing the side effect
Pricing note
One protected action check equals one real boundary preflight. Taint, event ingest, execution reports, and decision reads are all included at that price. The Free Sandbox includes every language, provider, framework, and adapter. VerifiedX does not replace your MCP server or orchestration. It returns receipts your system can keep local, route downstream, or pass upstream.For the full raw runtime reference, see the Python SDK. If your MCP tools are being used through OpenAI Agents, see the OpenAI Agents SDK page.