Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.corsair.dev/llms.txt

Use this file to discover all available pages before exploring further.

Use direct execution when your app already knows the operation — scheduled jobs, workflow steps, or UI buttons like “Send calendar invite”. No MCP client required.

Run an operation

import { createClient } from "@corsair-dev/app";

const corsair = createClient({ apiKey: process.env.CORSAIR_DEV_KEY! });
const inst = corsair.instance(process.env.CORSAIR_INSTANCE_ID!);

// List tenants your backend can act on behalf of
const { tenants } = await inst.tenants.list();

// Run an operation for a specific tenant
const t = inst.tenant("alice");
await t.run("slack.api.messages.post", {
  channel: "#general",
  text: "Hello from chat",
});
Paths use the catalog’s dot notation: plugin.section.operation (e.g. github.api.repositories.star).

Handle missing auth

run() returns a result object instead of throwing when the tenant still needs to connect a plugin:
const result = await t.run<{ messages: unknown[] }>("gmail.api.messages.list");

if (!result.success) {
  // Redirect user to connect Gmail
  redirect(result.signInLink);
  return;
}

console.log(result.data);

Permissions

Direct execution respects the same instance policies as MCP. Denied operations return CorsairApiError with status 403.
await inst.plugins.permissions.setOverride(
  "github",
  "api.repositories.delete",
  "deny",
);

MCP vs direct

Use caseUse
Agent picks tools at runtimeCoding agents or Agent SDKs
Backend knows the exact operationtenant.run()