Skip to main content

Module sdk_ipc

Module sdk_ipc 

Source
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:

  1. Detects PII patterns in request arguments
  2. Tokenizes sensitive data before tool execution
  3. De-tokenizes responses before returning to code
  4. Maintains token mapping for the session

Structs§

ToolIpcHandler
IPC handler for tool invocation between code and executor.

Type Aliases§

ToolRequest
IPC request from executing code to executor.
ToolResponse
IPC response from executor to executing code.