/** * MCP Mutual Authentication Adapter * * Layers APS mutual-auth on top of Anthropic's Model Context Protocol. * MCP deals in tool calls between a client (agent) and a server (IS). * This adapter binds both sides into a signed mutual-auth session so * that a tool call receipt can later reference which authenticated * session produced it. * * Composition boundary: * MCP server/client handshake — capability discovery * APS mutual-auth — identity proof + session binding * APS action receipts — per-tool-call proof inside session * * This adapter works with any MCP server and any MCP client. It does * NOT depend on the MCP SDK. It is a pure mapping layer. */ import type { MutualAuthCertificate, MutualAuthPolicy, TrustAnchor, MutualAuthHello, MutualAuthAttest, MutualAuthResult, MutualAuthSession } from '../v2/mutual-auth/index.js'; /** MCP-specific binding helper: convert an MCP server URL into the * `binding` value for an IS certificate. */ export declare function mcpServerBinding(server_url: string): string; /** Agent-side: start the handshake against an MCP server. */ export declare function mcpBeginHandshake(agent_cert: MutualAuthCertificate, now_ms: number, nonce_b64?: string): { hello: MutualAuthHello; agent_nonce: string; }; /** Server-side: respond to an agent hello with the IS attest. */ export declare function mcpRespondHandshake(agent_hello: MutualAuthHello, is_cert: MutualAuthCertificate, is_sk_hex: string, accepted_versions: string[], now_ms: number, is_nonce_b64?: string): { attest: MutualAuthAttest; is_nonce: string; } | { error: 'version_unsupported'; }; /** Agent-side: verify the IS attest, produce the agent attest back. */ export declare function mcpCounterAttest(is_attest: MutualAuthAttest, agent_cert: MutualAuthCertificate, agent_sk_hex: string, agent_nonce_b64: string, policy: MutualAuthPolicy, trust_anchors: TrustAnchor[], now_ms: number, revoked_anchor_ids?: string[]): { attest: MutualAuthAttest; } | { error: string; detail?: string; }; /** Server-side: verify the agent attest, derive the shared session. */ export declare function mcpFinalizeSession(agent_attest: MutualAuthAttest, is_attest: MutualAuthAttest, policy: MutualAuthPolicy, trust_anchors: TrustAnchor[], now_ms: number, revoked_anchor_ids?: string[]): MutualAuthResult; /** Helper: check whether an MCP tool call is permitted under the * established session. Verifies (a) session is still active and * (b) the session's IS cert binding matches the MCP server URL. */ export interface MCPToolCallAuthCheck { session: MutualAuthSession; server_url: string; now_ms: number; } export declare function mcpIsToolCallPermitted(input: MCPToolCallAuthCheck): { ok: boolean; reason?: string; }; //# sourceMappingURL=mutual-auth-mcp.d.ts.map