@exhibita/mcp
v0.0.1
Published
MCP middleware so AI agents auto-capture their tool calls as ExhibitA evidence
Maintainers
Readme
@exhibita/mcp
Turn an MCP server's tool calls into ExhibitA agent events with near-zero integration. Wrap your toolset once and every call an agent makes becomes signed, schema-valid evidence — no per-tool plumbing.
import { createSensor, instrumentServer } from "@exhibita/mcp";
const sensor = createSensor({
apiKey: process.env.EXHIBITA_API_KEY!,
signingKey: process.env.EXHIBITA_SIGNING_KEY!,
signingKeyId: process.env.EXHIBITA_SIGNING_KEY_ID!,
});
// Wrap your whole toolset. The returned handlers are drop-in replacements:
// same signatures, same return values, same thrown errors — now recorded.
const tools = instrumentServer(
sensor,
{
search_catalog: async (q: string) => db.search(q),
checkout: async (cart: Cart) => payments.charge(cart),
},
// Optional: you own the clock. Called once per invocation.
{ now: () => new Date().toISOString() },
);
// Register `tools` with your MCP server exactly as before.Event type is inferred from each call:
agent.api_call— normal toolagent.checkout_completed/agent.checkout_failed— tool name implies checkout/payment, on success / failureagent.blocked— upstream returned status403or429
Need lower-level control? wrapTool(sensor, name, handler, opts?) wraps a single
handler, and recordToolCall(sensor, info) emits an event directly.
