Expand description
Inter-process communication for calling MCP tools from executing code.
This module provides a file-based IPC mechanism that allows code running in a separate process to call MCP tools. The code writes tool requests to a file, and the executor reads and processes them, writing back results.
Optionally supports PII (Personally Identifiable Information) protection by tokenizing sensitive data in requests before tool execution and de-tokenizing responses before returning to the code.
§Protocol
Requests (code → executor):
{
"id": "uuid",
"tool_name": "search_tools",
"args": {"keyword": "file"}
}Responses (executor → code):
{
"id": "uuid",
"success": true,
"result": {...}
}or
{
"id": "uuid",
"success": false,
"error": "Tool not found"
}§PII Protection
When enabled, the handler automatically:
- Detects PII patterns in request arguments
- Tokenizes sensitive data before tool execution
- De-tokenizes responses before returning to code
- Maintains token mapping for the session
Structs§
- Tool
IpcHandler - IPC handler for tool invocation between code and executor.
Type Aliases§
- Tool
Request - IPC request from executing code to executor.
- Tool
Response - IPC response from executor to executing code.