TailraceTailrace
Reference

MCP

Reference for @tailrace/mcp - wrapTransport, withMcp, and McpWrapOptions.

@tailrace/mcp wraps an MCP client Transport so outbound tools/call arguments and inbound tool / resources/read results pass through Tailrace.

Install

pnpm add @tailrace/core @tailrace/mcp @modelcontextprotocol/sdk

Peer dependency: @modelcontextprotocol/sdk >=1 (bound against 1.29.0 Transport).

Exports

ExportDescription
wrapTransportStandalone transport wrapper
withMcpAttach fluent transport(...) to a Tailrace instance
McpWrapOptionsOptions type
TailraceWithMcpFluent instance type

Options

OptionRequiredNotes
serveryesPolicy key prefix mcp:{server}/{tool}
agentnoDefault "default"
workflowIdnoDefault "default"
onDecisionnoAudit callback

Block shape

JSON-RPC 2.0 error on the pending request id: code: -32001, message names entity + rule, data: { type: "policy_violation", entity, rule }. Transport stays open.

Guides

On this page