Documentation
API Reference

API: MCP Servers

Flapjack REST API endpoints for managing MCP (Model Context Protocol) server connections.

Manage Model Context Protocol (MCP) server connections for your organization.

List MCP Servers

GET /api/mcps

List all MCP servers configured for your organization.

curl https://api.flapjack.dev/api/mcps \
  -H "Authorization: Bearer fj_live_..."

Response 200:

[
  {
    "id": "mcp-001",
    "name": "GitHub",
    "slug": "github",
    "transport": "streamable_http",
    "url": "https://mcp.github.com/sse",
    "status": "active",
    "hasCredentials": true,
    "toolsCache": [
      { "name": "list_repos", "description": "List repositories" }
    ],
    "createdAt": "2026-03-28T12:00:00Z"
  }
]

Note: Response uses camelCase field names. Encrypted credentials are never returned β€” only hasCredentials: boolean indicates whether credentials exist.

πŸ“‹ Copy as prompt

List all MCP servers in my Flapjack organization using curl on /api/mcps.


Create MCP Server

POST /api/mcps

Add a new MCP server connection.

Request body:

FieldTypeRequiredDescription
namestringYesDisplay name
transportstringYesstreamable_http, sse, or stdio
urlstringConditionalServer URL (required for streamable_http and sse)
commandstringConditionalSubprocess command (required for stdio)
argsstring[]NoSubprocess arguments (for stdio)
credentialsobjectNoEncrypted credentials (see below)
credentials.headersobjectNoHTTP headers (encrypted at rest)
credentials.envobjectNoEnvironment variables (encrypted at rest)
allowedToolsstring[]NoRestrict to specific tools

Note: slug is auto-derived from name β€” do not provide it.

curl -X POST https://api.flapjack.dev/api/mcps \
  -H "Authorization: Bearer fj_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "name": "GitHub",
    "transport": "streamable_http",
    "url": "https://mcp.github.com/sse",
    "credentials": {
      "headers": { "Authorization": "Bearer ghp_..." }
    }
  }'

Response 201: The created MCP server object.

πŸ“‹ Copy as prompt

Add a GitHub MCP server to my Flapjack organization using the API. POST to /api/mcps with name, slug, transport type, URL, and authorization header.


Get MCP Server

GET /api/mcps/{mcpId}

Get details of a specific MCP server.


Update MCP Server

PATCH /api/mcps/{mcpId}

Update an MCP server's configuration.


Delete MCP Server

DELETE /api/mcps/{mcpId}

Delete an MCP server and all agent attachments.


Test MCP Connection

POST /api/mcps/{mcpId}/test

Test the connection to an MCP server and discover available tools.

curl -X POST https://api.flapjack.dev/api/mcps/mcp-001/test \
  -H "Authorization: Bearer fj_live_..."

Response 200:

{
  "ok": true,
  "tools": [
    { "name": "list_repos", "description": "List repositories", "inputSchema": {} },
    { "name": "create_issue", "description": "Create a GitHub issue", "inputSchema": {} }
  ]
}

OAuth Flow

For MCP servers that require OAuth authentication:

Start OAuth

POST /api/mcps/{mcpId}/oauth/start

Initiates the OAuth 2.1 authorization flow. Returns a redirect URL.

OAuth Callback

GET /api/mcps/{mcpId}/oauth/callback

Handles the OAuth callback and stores encrypted tokens.


Attach MCP to Agent

POST /api/agents/{agentId}/mcps

Request body:

FieldTypeRequiredDescription
mcpServerIdstringYesMCP server UUID
allowedToolsstring[]NoPer-agent tool filter

Attach MCP to Runner

POST /api/runners/{runnerId}/mcps

Same request body as agent attachment. Runner-level MCPs serve as defaults for all steps. See API: Runners for details.


Search MCP Registry

GET /api/mcp-registry/search?q={query}

Search the official MCP registry for available servers.

curl "https://api.flapjack.dev/api/mcp-registry/search?q=github" \
  -H "Authorization: Bearer fj_live_..."

Next Steps

Docs last updated May 11, 2026