MCP Integration
Use Thoth as a security gateway for Model Context Protocol (MCP) tool calls — policy enforcement and behavioral monitoring for MCP-connected agents.
What is MCP?
The Model Context Protocol (MCP) is an open standard that enables AI models to connect to external tools and data sources through a unified interface. An MCP server exposes tools; an MCP client (typically an LLM host like Claude Desktop or a custom agent) calls those tools on behalf of the user.
Thoth adds a governance layer between the MCP client and the tools it calls — enforcing policy, requiring human approval for sensitive operations, and emitting tamper-evident behavioral events.
Architecture
Without Thoth, tool calls flow directly from the LLM to the MCP server. With Thoth, every call is intercepted before execution:
The LLM and MCP server are unaware of Thoth — governance is injected at the client execution layer. No changes to your MCP server or LLM prompt are required.
Python: OpenAI + MCP
Python: Anthropic + MCP
Go: WrapToolFunc() with MCP tools
Enforcement scopes for MCP
| Scenario | Recommended approved_scope | Recommended mode |
|---|---|---|
| Read-only file access | ["read_file", "list_directory"] | progressive |
| Read + write | ["read_file", "write_file", "list_directory"] | step_up for write operations |
| Database tools | ["query_db"] (exclude execute_sql, drop_table) | block |
| Web browsing | ["fetch_url", "screenshot"] | progressive |
Behavioral events for MCP
Each governed MCP tool call emits two behavioral events (TOOL_CALL_PRE and TOOL_CALL_POST) with:
sourceType: "agent_tool_call"— identifies the event as coming from an agent via Thoth SDKtoolName— the MCP tool namecontent— JSON-serialized MCP tool arguments (PRE) and result (POST)sessionToolCalls— the list of tools already called in this session
These events are available through Thoth APIs and SIEM exports, filterable by
agentId, sessionId, and toolName.
Native MCP Proxy
The thoth proxy binary intercepts MCP calls at the transport layer — no SDK, no code
changes to your MCP server or agent prompt required. It runs as a stdio sidecar between Claude Desktop
and any MCP server, enforcing policy on every tools/call before the upstream server executes.