Skip to main content

Your Agent Asks.
Mandaitor Acts.

An agent asks for one business operation. Mandaitor decides on the real record against the mandates a person gave the agent, performs the write with a credential the agent never holds, and signs a receipt of what happened.

MCP serverOpenAPI 3.0TypeScript SDKW3C VC / SD-JWT

One Tool Call, Carried Out

Configure a standard MCP client as your agent, with the key you registered for it, and call a tool. Mandaitor decides on the record, asks a person where the mandate says so, writes, and answers with the outcome and its signed receipt.

MCPnpm install @modelcontextprotocol/sdk
// agent.ts: a standard MCP client, configured as your agent
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { StreamableHTTPClientTransport } from
  "@modelcontextprotocol/sdk/client/streamableHttp.js";
import { PrivateKeyJwtProvider } from
  "@modelcontextprotocol/sdk/client/auth-extensions.js";

const authProvider = new PrivateKeyJwtProvider({
  clientId: agentDid, // did:web:agents.mandaitor.io:agt_โ€ฆ
  privateKey: agentKeyPem, // the key you registered for it
  algorithm: "ES256",
  expectedIssuer: "https://api.mandaitor.io/v1",
});
const client = new Client({
  name: "procurement-agent",
  version: "1.0.0",
});
const url = new URL("https://api.mandaitor.io/v1/mcp");
await client.connect(
  new StreamableHTTPClientTransport(url, { authProvider }),
);

const result = await client.callTool({
  name: "sap_purchase_requisition_release",
  arguments: { purchase_requisition: "10000123" },
});
// result.structuredContent.state: "SUCCEEDED", "DENIED", โ€ฆ
// result.structuredContent.receipt: Mandaitor's signed receipt