Skip to content

SDK and MCP

The protocol is schemas, messages, signatures, and gate rules. MCP is one transport. HTTP/SDK is the other. MCP authorization authenticates a client to a server. It does not approve a payment.

PackageJob
@sai/vapCanonicalization, hashes, role policy, bundle verify, reference runtime
@sai/vap-mcpTools with separate scopes
docsThis site

Python and Go ports are planned. Flutter needs a confirmation surface; local bundle verify is optional.

Tools

ToolCaller
vap.get_capabilitiesAuthenticated client
vap.prepare_actionAgent, prepare scope
vap.submit_proposalProposer; no execute
vap.get_status / vap.get_receiptTenant client
vap.submit_attestationVerifier workload
vap.execute_approvedExecutor. Gate still runs.

Default agent view: prepare, submit, read. VAP_SCOPE=agent|verifier|executor|all.

MCP session IDs are not authorization. No token passthrough. Audience-bound tokens, minimal scopes. See MCP security best practices.

import { VapRuntime } from "@sai/vap";
const vap = new VapRuntime();
vap.registerMandate(mandate);
vap.authorizeIntent(intent, mandate.mandateId);
const prepared = await paymentAdapter.prepare({ intentRef: intent.intentId });
vap.submitProposal({ intentId: intent.intentId, prepared, executorId, expiresAt });
// semantic + safety services attach attestations
const status = vap.getStatus(intent.intentId);

The agent client does not mint intents and does not hold execution credentials.

An adapter declares: prepare, exact payload binding, native approval, idempotency, simulation, finality, cancel. A missing mandatory capability is UNSUPPORTED_CAPABILITY. Wrapping a random MCP server does not undo a side effect.

HTTP: https://vap-api.saiwallet.ai (GET /health, GET /v1/capabilities). MCP remains a separate process (VAP_SCOPE).