SDKs

Official SDKs

Typed client libraries for TypeScript and Python. The REST API and the MCP server are the substrate; the SDKs are thin, ergonomic wrappers around them.

TypeScript SDK

Pure ESM, zero runtime dependencies, requires Node ≥ 20. Three entry points so edge runtimes can pull only what they need:

  • @advisors-crypto/sdkAcClient (whoami, mandate, holdings, audit, validate, validateBatch, propose, usage, policy events, signing keys, disclosure, health) plus full typed payload and response shapes.
  • @advisors-crypto/sdk/webhooks verifyWebhook and parseEnvelope. HMAC-SHA256 with a 5-minute replay window.
  • @advisors-crypto/sdk/verifier verifyPolicyChain. Pure Web Crypto walker for the signed policy_events log. Works in Node, modern browsers, and edge runtimes.
Install
npm install @advisors-crypto/sdk
# pnpm add @advisors-crypto/sdk
# yarn add @advisors-crypto/sdk
# bun add @advisors-crypto/sdk
Quick start
import { AcClient } from '@advisors-crypto/sdk';

const ac = new AcClient({ apiKey: process.env.AC_AGENT_KEY! });

const me = await ac.whoami();

const decision = await ac.validate({
  action: 'buy', assetSymbol: 'BTC', assetType: 'crypto', amountUsd: 5000,
});
if (!decision.allowed) return decision;

await ac.propose({
  action: 'buy', assetSymbol: 'BTC', assetType: 'crypto', amountUsd: 5000,
  rationale: 'Drawdown headroom present; mandate cryptoTarget at 25%.',
});

See the TypeScript guide for the full surface and an Express webhook-handler example.

Python SDK

Source ships in the monorepo under apps/sdk-py. Both sync (requests) and async (httpx) clients with type hints generated from the OpenAPI spec. Same surface as the TypeScript SDK.

PyPI publish under advisors-crypto is pending — install from source meanwhile:

Install from source (interim)
pip install "git+https://github.com/AdvisorsCrypto/ac-monorepo.git#subdirectory=apps/sdk-py"

The Python guide walks the full surface — sync and async.

MCP server package

The MCP server publishes as @advisors-crypto/mcp. MCP-aware clients (Claude Desktop, Cursor, custom orchestrators) install it as a tool via npx — no separate global install needed:

Claude Desktop / Cursor config
{
  "mcpServers": {
    "advisors-crypto": {
      "command": "npx",
      "args": ["-y", "@advisors-crypto/mcp"],
      "env": { "AC_AGENT_KEY": "ac_live_…" }
    }
  }
}

The MCP overview covers tool inventory, prompts, and resources.

Versioning

Both packages follow semver. Breaking changes only on major bumps. The OpenAPI spec at /api/agent/v1/openapi.json is the source of truth for payload shapes — SDK types are kept in sync hand-by-hand for now, generated for v1.0.

Last updated 2026-06-15