MCP SDKs
Official TypeScript and Python SDKs for Pact's consent-native MCP server — consume Pact from your app, or build and publish your own MCP tools.
Pact exposes your consent-native CRM over the Model Context Protocol (MCP) at
https://api.pact.place/mcp. The official SDKs let you do two things:
- Consume Pact — call Pact's tools (
query_accounts,ask_workspace,fire_agent, …) from your own app or AI agent, with typed wrappers. - Extend Pact — build your own MCP server and publish it into Pact's federation marketplace, governed per-tool.
Every SDK ships the Pact differentiators as defaults: consent filtering, BYOK decryption, an audit trail, and cost-attribution — guardrails most MCP SDKs leave to you.
@pact/mcp-client — Pact in a Next.js app in under 10 lines.
pact-mcp-client — async, with LangChain / AutoGen / LlamaIndex shims.
pact-mcp-server + the pact CLI — scaffold, dev, and publish an MCP server.
Every tool Pact's MCP server exposes, with parameters and scopes.
MCP showcaseWhat Pact-over-MCP looks like end to end.
Pick a package
| Package | Language | Use it to |
|---|---|---|
@pact/mcp-client | TypeScript | Call Pact's tools from Node / edge / a Next.js app |
pact-mcp-client | Python | Call Pact's tools from async Python or an AI agent |
pact-mcp-server | Python | Build an MCP server + the pact CLI (scaffold/publish) |
@pact/mcp-server | TypeScript | Build an MCP server in TypeScript |
Authentication, in one line
Both clients take either a scoped API key (pact_live_* / pact_test_*,
created at Settings → API keys) or OAuth client credentials. Tools are
scoped — a key needs read:accounts, read:deals, etc. for the tools it calls.
See Auth & scopes on each
client page.
Note
The Pact MCP server returns complete (unary) JSON responses today — it does not
stream tokens. The clients expose an honest streaming surface (askWorkspaceStream)
for rendering a thinking state; its shape won't change if streaming lands later.
The four guardrails, surfaced
- Consent — every read result reports
consent_filtered(records hidden because the subject withdrew consent). Agent runs come backblockedwhen an agent reads PII about a withdrawn subject — that's data, not an error. - BYOK — contact PII is decrypted per-tenant server-side before it reaches you.
- Audit — every call is recorded and tenant-scoped.
- Cost — AI tools report
cost_cents; the clients sum it and expose anonCosthook so you can budget per request.