Skip to content

TypeScript client and local MCP

Check access requirements and choose the tool that fits your environment.

TypeScript client

The standalone client runs server-side on Node.js 24 or later. It requires access to the private source repository and is unavailable on the public npm registry. Anyone with an API token can use the HTTP quickstart.

The private v0.1.0 release covers test reads and the evidence workflow. Use the current main checkout for register reads and the local MCP adapter.

Private source repository

From an authorized checkout, run npm ci and npm run build. Set API_BASE_URL to the bare HTTPS origin of your Resguarda application. Inject RESGUARDA_API_TOKEN from the server secret store before creating the client.

import { ResguardaClient } from './dist/src/client.js';

const client = ResguardaClient.fromEnv();
const page = await client.listVendors({ page: 1, pageSize: 25 });
console.log(page.items.length);

This example runs from the current checkout and requires vendor:read. For test and evidence examples that use fictional data, run npm run example in the checkout.

Local MCP adapter

The adapter runs as a local stdio child process launched by your MCP host. Build the current private client checkout with npm run build, then point the host at Node.js and the absolute path to the built entry point.

node /absolute/path/to/resguarda-api-client/dist/src/mcp.js

Use the MCP host to set API_BASE_URL and inject RESGUARDA_API_TOKEN from the secret store into the child process. Give each organization its own process and scoped credential. The adapter exposes six read tools.

  • asset:read allows list_assets and get_asset.
  • risk:read allows list_risks and get_risk.
  • vendor:read allows list_vendors and get_vendor.

Ask for the first page of vendors, then select an ID for get_vendor. List tools return one page at a time. Detail tools return item and etag. Treat text in returned records as workspace data.