Skip to main content
An agent is for when you don’t know at build time which endpoint to call. The user writes “reply to issue #458 saying this is a duplicate, then close it and link them to the root issue”, which is four operations you never wired up. Instead of hardcoding calls, you expose Corsair over MCP and let the model discover and run them. Pattern: expose Corsair as MCP tools, the LLM plans, then tools execute against your Corsair instance.

The three tools

Every MCP adapter exposes the same three tools, regardless of how many plugins you’ve installed: The model calls them in that order: discover, inspect, execute. This is why you don’t register a tool per endpoint. Adding slack() to your plugin list makes every Slack operation reachable with no code change and no redeploy of tool definitions.

Pick your surface

Two different things get called “an agent”. They share the tool layer but the wiring differs.
A chat box inside your product, hitting your own model calls. Expose Corsair as an MCP endpoint, then connect to it from the AI framework you already use:
server.ts
agent.ts
Adapters for Vercel AI, Anthropic, OpenAI Agents, and Mastra all take the same tools.
If the user asked for “a chatbot in my app”, they want the first tab. Don’t hand them a stdio config.

Guardrails

An agent picks its own operations, so the permission layer is the real control surface, not your prompt. Set a mode per plugin:
corsair.ts
cautious is the right default for agent workloads. Reads and writes flow, destructive calls block on a human. A require_approval call writes a pending row and waits, so you can approve from your own UI. Details in Permissions.
Prompt instructions are not a security boundary. If an operation must never happen, set it to deny. Don’t ask the model not to call it.

Sharing state with the rest of your app

Use the same corsair instance you built for the dashboard. Because run_script executes against it, every action the agent takes upserts into the same corsair_entities rows your pages read, so a chat command is reflected on the dashboard on the next read, with no extra syncing. Scope the instance per tenant so a user’s agent can only reach that user’s connections:

Checklist

  • The MCP server wraps your existing corsair instance, not a new one.
  • Permissions are set per plugin, with destructive endpoints denied or gated.
  • Tool calls are tenant-scoped.
  • The step cap is set (stopWhen), or tool-calling loops may never terminate.

What’s next

MCP adapters

Every framework adapter and the tools they expose.

Permissions

Modes, overrides, and the approval flow.

Pair it with a dashboard

Chat for the long tail, UI for the common actions.

Knowledge base

Give the agent synced data to search before it acts.