Install
corsair is the core SDK. @corsair-dev/mcp adds MCP adapters for AI agent frameworks. better-sqlite3 is the database driver — you can swap this for PostgreSQL later.
Environment Variables
.env
CORSAIR_KEK is the Key Encryption Key used to protect credentials stored in your database. Generate one with:
Migrate the Database
Corsair requires four tables. Run this migration once before starting:migration.sql
packages/corsair/db/index.ts.
Create the Corsair Instance
Create acorsair.ts file that configures your plugins and exports the instance.
corsair.ts
Connect MCP
@corsair-dev/mcp provides adapters for every major agent framework. Here’s a quick example using the Anthropic SDK:
agent.ts
corsair_setup— check auth status and get credential instructionslist_operations— discover every available API endpointget_schema— inspect the parameters for a specific endpointrun_script— execute a JavaScript snippet withcorsairin scope
Your First Prompt
Start with setup:corsair_setup, which checks if your database tables exist, creates the required rows, and tells you exactly which credentials are missing and how to store them. Once credentials are in place, run it again and it will confirm everything is ready.
From there, try a real task:
Next Steps
- MCP Adapters — Connect Claude, OpenAI, Vercel AI, and more
- Authentication — OAuth, API keys, and envelope encryption
- Database — The four tables and how data flows through them
- Plugins — Available integrations and their endpoints