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 claudeMcpServerConfig() from @corsair-dev/app when the Claude Agent SDK should connect to Corsair App’s hosted HTTP MCP server. This is different from the local ClaudeProvider in @corsair-dev/mcp. ClaudeProvider builds an in-process server from a local Corsair instance. claudeMcpServerConfig() points Claude at an already-hosted HTTP MCP server.

Install

npm install @corsair-dev/app @anthropic-ai/claude-agent-sdk

Example

import { query } from "@anthropic-ai/claude-agent-sdk";
import { claudeMcpServerConfig, createClient } from "@corsair-dev/app";

const corsair = createClient({
  apiKey: process.env.CORSAIR_API_KEY!,
});

const tenant = corsair
  .instance(process.env.CORSAIR_INSTANCE_ID!)
  .tenant("dev");

const conn = await tenant.mcpKeys.connection();

const stream = query({
  prompt: "Star the corsairdev/corsair repo on GitHub",
  options: {
    model: "claude-opus-4-6",
    mcpServers: {
      corsair: claudeMcpServerConfig({
        url: conn.mcpHttpUrl,
        apiKey: process.env.CORSAIR_MCP_API_KEY!,
      }),
    },
  },
});

for await (const event of stream) {
  if ("result" in event) process.stdout.write(event.result);
}
The helper returns a plain HTTP MCP config:
{
  type: "http",
  url: "https://...",
  headers: {
    Authorization: "Bearer ..."
  }
}

Key usage

ValueUse
CORSAIR_API_KEYDeveloper API key for createClient()
CORSAIR_MCP_API_KEYTenant MCP secret for Claude’s MCP server config
Create the tenant MCP secret once:
const key = await tenant.mcpKeys.create("claude-agent");

console.log(key.mcpHttpUrl);
console.log(key.secret);