Skip to content

MCP Integration

The fyrn MCP server lets AI agents manage your integrations through natural conversation. Agents can list flows, create new integrations, deploy, monitor, and troubleshoot — all through the Model Context Protocol.

The Model Context Protocol (MCP) is an open standard for connecting AI models to external tools and data sources. fyrn’s MCP server exposes 49 tools across three permission tiers, giving AI agents structured access to the platform.

  • NPM package: @fyrn/mcp-server
  • Transports: stdio (default, for Claude Desktop) and SSE (for web integrations)

The server is published to the public npm registry. No explicit install step is needed for the standard Claude Desktop setup — npx pulls and runs the latest version on first launch.

For environments where pre-installation is preferred:

Terminal window
npm install -g @fyrn/mcp-server
# then invoke as: fyrn-mcp

Add to your Claude Desktop config file (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):

claude_desktop_config.json
{
"mcpServers": {
"fyrn": {
"command": "npx",
"args": ["@fyrn/mcp-server"],
"env": {
"FYRN_AGENT_KEY": "<your-agent-key>",
"FYRN_API_URL": "https://api.fyrn.ai"
}
}
}
}

Get your agent key from the fyrn dashboard under Settings → Agent Keys. Each key carries its tier, rate limit, daily quota, and approval mode; the server reads these via POST /api/v1/agent-keys/validate on startup.

VariableRequiredDefaultDescription
FYRN_AGENT_KEYYes (stdio)Agent API key. In SSE mode it can come from the Authorization: Bearer header or ?agent_key= query param instead.
FYRN_API_URLNohttps://api.fyrn.aiControl-plane base URL. Also accepts FYRN_CONTROL_PLANE_URL as an alias.
FYRN_ENVIRONMENT_IDNoPin the MCP session to a specific environment. Sent as X-Environment-Id on every request. If omitted, the environment on the agent key is used.
MCP_PORTNo3100Port for SSE transport.

stdio (default) — communicates over stdin/stdout; used by Claude Desktop and most MCP clients:

Terminal window
fyrn-mcp --transport stdio

SSE — HTTP Server-Sent Events for web integrations. The agent key is supplied per request, so one server instance can serve many users:

Terminal window
fyrn-mcp --transport sse

TierLabelWhat agents can do
1UseList flows, search, inspect status, trigger flows, call published APIs, view schedules, test adapters, view lookups
2BuildEverything in tier 1, plus: create/update instances, create flows, deploy, create adapters, create/update published APIs and services, create lookups, start batches
3ManageEverything in tier 2, plus: edit flows, pause/resume, retry messages, manage healing, update schedules, delete published APIs and lookups

Tools that create or modify resources (tier 2–3) require human approval by default:

  1. Agent calls the tool without approval_id.
  2. Server creates a pending action (1-hour expiry) and returns its approval_id. In the same response the server polls for the approval result for up to 5 minutes at 2-second intervals.
  3. If the reviewer approves within that window, the tool’s real handler runs and returns the result to the agent.
  4. If the poll times out, the response includes { status: "approval_timeout", action_id }. The agent can re-call the tool with approval_id set once the action has been approved.
  5. Rejected or expired actions surface as errors.

Agent keys with approvalMode: "autonomous" skip the gate entirely; strict mode gates every tier-2+ tool, regardless of the per-tool flag.


Tier 1 — Use (17 tools, read-only + trigger)

Section titled “Tier 1 — Use (17 tools, read-only + trigger)”
ToolDescription
list_environmentsList account environments (dev/staging/production) — resolves env IDs for clone_flow
list_flowsList integration flows with status, metrics, and env context (envSlug, accountSlug)
search_flowsSearch flows by name or description
get_flow_statusGet a flow’s current status and recent metrics (message counts, success rate, latency)
trigger_flowSend a payload through a flow (supports name resolution)
list_published_apisList published API endpoints — includes internal path and serving-URL publicUrl
list_published_servicesList published services (grouped API actions)
call_published_apiSend data to a published API endpoint at /published/{accountSlug}/{envSlug}/v{version}/{path}
get_api_specRetrieve OpenAPI spec (JSON or YAML) for a published API
list_schedulesList scheduled flows with cron, next run, and status
get_batch_statusGet status/progress of a batch job
list_batch_jobsList recent batch jobs
export_batch_errorsExport failed/retried-failed records for a batch job
list_adaptersList custom code adapters with type and test status
test_adapterTest an adapter in a sandboxed V8 isolate
list_lookupsList lookup tables (account-scoped, shared across environments)
get_lookupGet a lookup table with its entries

Tier 2 — Build (20 tools, create + deploy)

Section titled “Tier 2 — Build (20 tools, create + deploy)”
ToolApprovalDescription
list_catalogNoList connector catalog — summary view (no actions/openApiSpec) to stay under 1 MB
get_catalog_entryNoFetch a single catalog entry with full details (including actions and oauthConfig)
test_instanceNoTest a connector instance connection
preview_flowNoPreview payload transformation without delivery
create_instanceYesCreate a connector instance with encrypted credentials
update_instanceYesUpdate an existing connector instance
create_flowYesAI-generated — generate a flow from natural language
clone_flowYesClone a flow to another environment (use list_environments to find target IDs)
deploy_flowYesValidate, compile, and activate a flow
create_published_apiYesAI-generated — generate a published API endpoint
update_published_apiYesUpdate a published API endpoint
create_published_serviceYesCreate a published service grouping
create_service_actionYesAdd an action to a published service
trigger_scheduleYesManually trigger a scheduled flow
start_batchYesStart a batch processing job
retry_batch_failed_recordsYesRetry failed records in a batch job
create_adapterYesAI-generated — create a custom code adapter
create_lookupYesCreate a lookup table
set_lookup_entryNoSet a key/value in a lookup table
import_lookup_csvNoImport CSV into a lookup table

Tier 3 — Manage (12 tools, operations + full access)

Section titled “Tier 3 — Manage (12 tools, operations + full access)”
ToolApprovalDescription
get_messagesNoView message logs for a flow (with PII filtering)
pause_flowNoPause an active flow
resume_flowNoResume a paused flow
retry_messageNoRetry delivery of a failed message
list_healing_eventsNoList self-healing events
edit_flowYesEdit an existing flow’s configuration
approve_healingYesApprove a pending self-healing fix
update_scheduleYesUpdate cron, timezone, or enable/disable a schedule
update_adapterYesUpdate an existing custom code adapter
delete_published_apiYesDelete a published API endpoint
delete_lookupYesDelete a lookup table
delete_lookup_entryYesDelete an entry from a lookup table

Three tools invoke Claude to generate configuration from natural language:

  • create_flow — natural language to integration flow
  • create_published_api — description to published API endpoint
  • create_adapter — description to custom code adapter (V8 sandboxed)

See MCP Tools Reference for complete parameter details and JSON examples.


  • Account-scoped resources (shared across environments): lookup tables, connector catalog, adapters. A lookup referenced by a flow in staging is the same data in production after clone_flow — no rewiring needed.
  • Environment-scoped resources: flows, connector instances, published APIs, schedules, batch jobs, message logs. Each carries an environmentId; list/read responses also expose envSlug (and accountSlug for the containing account).

List and read endpoints return stable IDs and human-readable identifiers so agents don’t have to cross-reference UUIDs:

EndpointExtra fields
list_flows, get_flow_statusenvSlug, envName, accountSlug, webhookUrl (if trigger is webhook)
list_published_apis, GET /published-apis/:idaccountSlug, envSlug, publicUrl, docsUrl
list_lookupsaccountSlug (lookups are account-scoped; no envSlug)

publicUrl vs path: Published APIs store path as the internal /inbound/... prefix used by the DB lookup. publicUrl is the fully qualified serving URL — /published/{accountSlug}/{envSlug}/v{version}/{path} — that consumers actually POST to. Always prefer publicUrl when telling a human or external system where to send requests.

list_catalog vs get_catalog_entry: The list endpoint returns a summary projection to stay under the 1 MB MCP response limit. To inspect a catalog entry’s actions array or oauthConfig, call get_catalog_entry with the entry ID.


Here’s how an agent might build and deploy a flow:

User: Create a flow that syncs new Shopify orders to our NetSuite ERP

Agent: I’ll create that integration. Let me generate the flow… calls create_flow with description

Agent: I’ve generated a flow that maps Shopify order fields to NetSuite sales orders. Here’s the YAML — would you like me to deploy it?

User: Yes, deploy it

Agent: calls deploy_flow — requires approval

Agent: The deployment needs your approval. Please review and approve in the fyrn dashboard.

(Human approves)

Agent: calls deploy_flow with approval_id — deployed!

Agent: Your flow is live. Webhook URL: https://api.fyrn.dev/webhooks/receive/abc123. New Shopify orders will automatically sync to NetSuite.


  • 3-tier permission system — Use / Build / Manage with optional per-key tool whitelisting
  • Approval gates — mutating tools require human approval via the pending-action flow above
  • Rate limiting — per-minute and daily quota enforcement per agent key
  • Loop detection — blocks agents calling the same tool with identical inputs 5+ times in 60s
  • PII filtering — auto-masks emails, phones, SSNs, and sensitive fields unless explicitly granted access
  • Credential masking — API keys, tokens, passwords never returned unmasked
  • Audit logging — structured JSON logs for every tool call with status, duration, and agent identity

get_flow_status and related responses include piiFields. This is auto-compiled at deploy time from the flow config’s policies block (pii-mask, pii-encrypt, pii-strip). piiFields: null means the flow has no PII policies declared — it is not an “unknown” state.


The server surfaces errors as MCP tool responses with isError: true and a single text content block. Common categories:

  • Permission denied — agent tier doesn’t cover the requested tool.
  • Unknown tool: <name> — the tool name isn’t registered. If you see this for a tool the docs list, it indicates a permission-matrix drift bug and should be reported.
  • Rate limit exceeded — per-minute or daily quota hit.
  • Loop detected — same tool + identical args called 5+ times in 60s.
  • Action was rejected by a reviewer — approval flow denied.
  • Pending action <id> is not approved (current status: …) — agent re-called with an approval_id that isn’t yet approved.

Some MCP clients (including Claude’s tool_search) load tool schemas on demand and may show tools as “not loaded” mid-session. This is a client-side affordance, not a server issue — the server registers all 49 tools at startup.