Skip to main content

MCP Server API Reference

All endpoints are prefixed with /api/v1/mcp unless otherwise noted. All requests require a JWT bearer token. Results are scoped to your tenant (workspace).

Base URL: https://api.worldflowai.com


Server Management

List MCP Servers

GET /api/v1/mcp/servers

List all registered MCP servers for the authenticated workspace. Supports pagination and filtering.

ParameterInTypeRequiredDescription
statusquerystringnoFilter by status: PENDING, HEALTHY, DEGRADED, DOWN, DISABLED
namequerystringnoSearch by name (partial match)
pagequeryintegernoPage number (default 1)
pageSizequeryintegernoResults per page (default 20)
curl "https://api.worldflowai.com/api/v1/mcp/servers?status=HEALTHY" \
-H "Authorization: Bearer $TOKEN"

Response (200)

{
"servers": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Atlassian MCP",
"description": "JIRA and Confluence integration",
"url": "https://mcp.example.com:9001",
"transport": "HTTP",
"authType": "API_KEY",
"status": "HEALTHY",
"healthLatencyP50Ms": 45,
"healthLatencyP99Ms": 120,
"lastHealthCheck": "2026-03-13T10:30:00Z",
"lastError": null,
"createdAt": "2026-03-12T08:00:00Z",
"updatedAt": "2026-03-13T10:30:00Z"
}
],
"total": 1,
"page": 1,
"pageSize": 20,
"totalPages": 1
}

Register MCP Server

POST /api/v1/mcp/servers

Register a new MCP server. The server is created with PENDING status until its health check succeeds.

URLs pointing to localhost or internal IPs are blocked to prevent SSRF attacks.

FieldTypeRequiredConstraintsDescription
namestringyesmax 128 charsHuman-readable name
descriptionstringnomax 2000 charsOptional description
urlstringyesmax 2048 charsServer URL
transportstringnoHTTP, STDIO, SSE (default HTTP)MCP transport protocol
authTypestringnoNONE, API_KEY, OAUTH, MTLS (default NONE)Authentication method
authConfigobjectnoAuthentication configuration (see below)

authConfig fields (vary by authType):

FieldApplies ToDescription
typeallMust match authType
headerAPI_KEYHTTP header name (e.g., Authorization)
valueEnvAPI_KEYEnvironment variable containing the key value
tokenUrlOAUTHOAuth token endpoint URL
clientIdOAUTHOAuth client ID
clientSecretEnvOAUTHEnvironment variable for client secret
scopesOAUTHArray of OAuth scopes
certPathMTLSPath to client certificate
keyPathMTLSPath to client key
caPathMTLSPath to CA certificate
curl -X POST https://api.worldflowai.com/api/v1/mcp/servers \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "GitHub MCP",
"description": "GitHub integration via MCP",
"url": "https://github-mcp.example.com",
"transport": "HTTP",
"authType": "API_KEY",
"authConfig": {
"type": "API_KEY",
"header": "Authorization",
"valueEnv": "GITHUB_TOKEN"
}
}'

Response (200)

{
"server": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "GitHub MCP",
"description": "GitHub integration via MCP",
"url": "https://github-mcp.example.com",
"transport": "HTTP",
"authType": "API_KEY",
"status": "PENDING",
"createdAt": "2026-03-13T10:00:00Z",
"updatedAt": "2026-03-13T10:00:00Z"
},
"message": "Server registered successfully"
}

Errors

StatusTypeDescription
400validation_errorInvalid request body or blocked URL (SSRF prevention)
401authentication_errorMissing or invalid bearer token
403permission_errorInsufficient permissions

Get MCP Server

GET /api/v1/mcp/servers/{id}
ParameterInTypeRequiredDescription
idpathuuidyesServer ID
curl https://api.worldflowai.com/api/v1/mcp/servers/{id} \
-H "Authorization: Bearer $TOKEN"

Response (200): Same shape as a single item in the servers array from List MCP Servers.

Errors

StatusTypeDescription
404not_foundServer not found

Delete MCP Server

DELETE /api/v1/mcp/servers/{id}

Remove an MCP server and all associated tools, entity mappings, and invalidation rules. This action is irreversible.

ParameterInTypeRequiredDescription
idpathuuidyesServer ID
curl -X DELETE https://api.worldflowai.com/api/v1/mcp/servers/{id} \
-H "Authorization: Bearer $TOKEN"

Response (200)

{
"deleted": true,
"message": "Server and associated resources deleted"
}

Errors

StatusTypeDescription
404not_foundServer not found

Check Server Health

GET /api/v1/mcp/servers/{id}/health

Perform a health check. Results are cached for 30 seconds. Includes observability metrics:

  • access_count: total cache hits
  • avg_latency_ms: average operation latency (exponential moving average)
  • error_rate: error occurrence rate (exponential moving average)
ParameterInTypeRequiredDescription
idpathuuidyesServer ID
curl https://api.worldflowai.com/api/v1/mcp/servers/{id}/health \
-H "Authorization: Bearer $TOKEN"

Response (200)

{
"serverId": "550e8400-e29b-41d4-a716-446655440000",
"status": "HEALTHY",
"latencyP50Ms": 42,
"latencyP99Ms": 115,
"error": null,
"checkedAt": "2026-03-13T10:30:00Z"
}

Server status values

StatusMeaning
PENDINGRegistered but not yet verified
HEALTHYResponding normally
DEGRADEDResponding with elevated latency or errors
DOWNNot responding
DISABLEDManually disabled by admin

Tool Discovery

Discover Tools

POST /api/v1/mcp/servers/{id}/discover

Trigger tool discovery by calling the MCP server's tools/list endpoint. Discovered tools are automatically classified by category (READ, WRITE, IDEMPOTENT, UNKNOWN) based on their names and descriptions. New tools are added; existing tools are updated.

ParameterInTypeRequiredDescription
idpathuuidyesServer ID
curl -X POST https://api.worldflowai.com/api/v1/mcp/servers/{id}/discover \
-H "Authorization: Bearer $TOKEN"

Response (200)

{
"serverId": "550e8400-e29b-41d4-a716-446655440000",
"toolsDiscovered": 12,
"toolsAdded": 10,
"toolsUpdated": 2,
"tools": [
{
"id": "660e8400-e29b-41d4-a716-446655440001",
"serverId": "550e8400-e29b-41d4-a716-446655440000",
"name": "get_jira_issue",
"description": "Fetch a JIRA issue by key",
"inputSchema": {
"type": "object",
"properties": {
"issueKey": { "type": "string" }
},
"required": ["issueKey"]
},
"category": "READ",
"categoryConfidence": 0.95,
"categoryManualOverride": false,
"cacheConfig": {
"enabled": true,
"ttlSecs": 3600,
"semanticThreshold": 0.90,
"crossAgent": true,
"coalescingWindowMs": 50
},
"createdAt": "2026-03-13T10:01:00Z",
"updatedAt": "2026-03-13T10:01:00Z"
}
]
}

Errors

StatusTypeDescription
404not_foundServer not found
500discovery_errorDiscovery failed (server unreachable or returned an error)

List MCP Tools

GET /api/v1/mcp/tools

List all tools across all servers, or filter by server, category, cache status, or name.

ParameterInTypeRequiredDescription
serverIdqueryuuidnoFilter by server ID
categoryquerystringnoFilter by category: READ, WRITE, IDEMPOTENT, UNKNOWN
cacheEnabledquerybooleannoFilter by cache enabled/disabled
namequerystringnoSearch by name (partial match)
pagequeryintegernoPage number
pageSizequeryintegernoResults per page
curl "https://api.worldflowai.com/api/v1/mcp/tools?serverId={serverId}&category=READ" \
-H "Authorization: Bearer $TOKEN"

Response (200)

{
"tools": [ ... ],
"total": 8,
"page": 1,
"pageSize": 20,
"totalPages": 1
}

Each item in tools follows the same shape as the objects in the Discover Tools response.


Update Tool Configuration

PATCH /api/v1/mcp/tools/{id}/config

Update caching configuration for a specific tool. All fields are optional; only specified fields are updated. Setting category marks it as a manual override and prevents auto-classification.

ParameterInTypeRequiredDescription
idpathuuidyesTool ID

Request body (all fields optional):

FieldTypeConstraintsDescription
categorystringREAD, WRITE, IDEMPOTENT, UNKNOWNTool classification
cacheEnabledbooleanEnable or disable caching
cacheTtlSecsintegerCache TTL in seconds
semanticThresholdfloat0.0-1.0Minimum similarity for semantic cache hit
crossAgentEnabledbooleanShare cached results across agents
coalescingWindowMsintegerRequest coalescing window in milliseconds
curl -X PATCH https://api.worldflowai.com/api/v1/mcp/tools/{id}/config \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"cacheEnabled": true,
"cacheTtlSecs": 7200,
"semanticThreshold": 0.85,
"crossAgentEnabled": true,
"coalescingWindowMs": 100
}'

Response (200): The updated tool object (same shape as items in Discover Tools).

Errors

StatusTypeDescription
404not_foundTool not found

List Tool Entities

GET /api/v1/mcp/tools/{id}/entities

List entity mappings for a specific tool.

ParameterInTypeRequiredDescription
idpathuuidyesTool ID
curl https://api.worldflowai.com/api/v1/mcp/tools/{id}/entities \
-H "Authorization: Bearer $TOKEN"

Response (200)

[
{
"toolId": "660e8400-e29b-41d4-a716-446655440001",
"entityId": "770e8400-e29b-41d4-a716-446655440002",
"paramName": "issueKey",
"operation": "READ"
}
]

Entity Management

List Entities

GET /api/v1/mcp/entities

List all entity types defined for cache invalidation. Entities represent data types that tools operate on (e.g., jira_issue, github_repo).

ParameterInTypeRequiredDescription
parentIdqueryuuidnoFilter by parent entity ID
namequerystringnoSearch by name (partial match)
pagequeryintegernoPage number
pageSizequeryintegernoResults per page
curl "https://api.worldflowai.com/api/v1/mcp/entities?name=jira" \
-H "Authorization: Bearer $TOKEN"

Response (200)

{
"entities": [
{
"id": "770e8400-e29b-41d4-a716-446655440002",
"name": "jira_issue",
"description": "A JIRA issue entity",
"parentId": "880e8400-e29b-41d4-a716-446655440003",
"createdAt": "2026-03-12T08:00:00Z",
"updatedAt": "2026-03-12T08:00:00Z"
}
],
"total": 1,
"page": 1,
"pageSize": 20,
"totalPages": 1
}

Create Entity

POST /api/v1/mcp/entities

Create a new entity type. Entities can have parent relationships for cascade invalidation. For example, a jira_comment entity with jira_issue as its parent is invalidated whenever the parent issue is invalidated.

FieldTypeRequiredConstraintsDescription
namestringyesmax 128 charsEntity type name
descriptionstringnoHuman-readable description
parentIduuidnoParent entity ID for cascade invalidation
curl -X POST https://api.worldflowai.com/api/v1/mcp/entities \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "jira_comment",
"description": "Comments on a JIRA issue",
"parentId": "770e8400-e29b-41d4-a716-446655440002"
}'

Response (200)

{
"id": "990e8400-e29b-41d4-a716-446655440004",
"name": "jira_comment",
"description": "Comments on a JIRA issue",
"parentId": "770e8400-e29b-41d4-a716-446655440002",
"createdAt": "2026-03-13T10:05:00Z",
"updatedAt": "2026-03-13T10:05:00Z"
}

Errors

StatusTypeDescription
400validation_errorInvalid request body

Get Entity

GET /api/v1/mcp/entities/{id}
ParameterInTypeRequiredDescription
idpathuuidyesEntity ID
curl https://api.worldflowai.com/api/v1/mcp/entities/{id} \
-H "Authorization: Bearer $TOKEN"

Response (200): Same shape as a single item in the entities array from List Entities.


Update Entity

PATCH /api/v1/mcp/entities/{id}

Update an entity's properties. Setting parentId to null removes the parent relationship.

ParameterInTypeRequiredDescription
idpathuuidyesEntity ID

Request body (all fields optional):

FieldTypeDescription
namestringEntity name
descriptionstringDescription
parentIduuid or nullParent entity ID; set to null to remove parent
curl -X PATCH https://api.worldflowai.com/api/v1/mcp/entities/{id} \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"description": "Updated description",
"parentId": null
}'

Response (200): The updated entity object.


Delete Entity

DELETE /api/v1/mcp/entities/{id}

Delete an entity. Triggers cascade invalidation for related cached data. Associated tool-entity mappings and invalidation rules are also removed.

ParameterInTypeRequiredDescription
idpathuuidyesEntity ID
curl -X DELETE https://api.worldflowai.com/api/v1/mcp/entities/{id} \
-H "Authorization: Bearer $TOKEN"

Response (200)

{
"deleted": true,
"message": "Entity and associated mappings deleted"
}

Create Tool-Entity Mapping

POST /api/v1/mcp/tool-entities

Map a tool parameter to an entity type. This defines which parameter contains an entity ID and whether the tool reads or writes that entity. Used for automatic cache invalidation.

FieldTypeRequiredDescription
toolIduuidyesTool ID
entityIduuidyesEntity ID
paramNamestringyesName of the tool parameter that contains the entity ID
operationstringyesREAD or WRITE
curl -X POST https://api.worldflowai.com/api/v1/mcp/tool-entities \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"toolId": "660e8400-e29b-41d4-a716-446655440001",
"entityId": "770e8400-e29b-41d4-a716-446655440002",
"paramName": "issueKey",
"operation": "READ"
}'

Response (200)

{
"toolId": "660e8400-e29b-41d4-a716-446655440001",
"entityId": "770e8400-e29b-41d4-a716-446655440002",
"paramName": "issueKey",
"operation": "READ"
}

Errors

StatusTypeDescription
404not_foundTool or entity not found

Delete Tool-Entity Mapping

DELETE /api/v1/mcp/tool-entities/{tool_id}/{entity_id}
ParameterInTypeRequiredDescription
tool_idpathuuidyesTool ID
entity_idpathuuidyesEntity ID
curl -X DELETE https://api.worldflowai.com/api/v1/mcp/tool-entities/{tool_id}/{entity_id} \
-H "Authorization: Bearer $TOKEN"

Response (200)

{
"deleted": true,
"message": "Mapping deleted"
}

Invalidation Rules

Rules define which READ tool caches are invalidated when a WRITE tool executes.

List Invalidation Rules

GET /api/v1/mcp/rules
ParameterInTypeRequiredDescription
writeToolIdqueryuuidnoFilter by the write tool that triggers invalidation
invalidateToolIdqueryuuidnoFilter by the read tool whose cache is invalidated
enabledquerybooleannoFilter by enabled/disabled status
pagequeryintegernoPage number
pageSizequeryintegernoResults per page
curl "https://api.worldflowai.com/api/v1/mcp/rules?enabled=true" \
-H "Authorization: Bearer $TOKEN"

Response (200)

{
"rules": [
{
"id": "aa0e8400-e29b-41d4-a716-446655440005",
"writeToolId": "660e8400-e29b-41d4-a716-446655440010",
"invalidateToolId": "660e8400-e29b-41d4-a716-446655440001",
"enabled": true,
"createdAt": "2026-03-13T10:10:00Z"
}
],
"total": 1,
"page": 1,
"pageSize": 20,
"totalPages": 1
}

Create Invalidation Rule

POST /api/v1/mcp/rules

Create a rule that invalidates a read tool's cache when a write tool executes.

FieldTypeRequiredDefaultDescription
writeToolIduuidyesThe write tool that triggers invalidation
invalidateToolIduuidyesThe read tool whose cache is cleared
enabledbooleannotrueWhether the rule is active
curl -X POST https://api.worldflowai.com/api/v1/mcp/rules \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"writeToolId": "660e8400-e29b-41d4-a716-446655440010",
"invalidateToolId": "660e8400-e29b-41d4-a716-446655440001",
"enabled": true
}'

Response (200)

{
"id": "aa0e8400-e29b-41d4-a716-446655440005",
"writeToolId": "660e8400-e29b-41d4-a716-446655440010",
"invalidateToolId": "660e8400-e29b-41d4-a716-446655440001",
"enabled": true,
"createdAt": "2026-03-13T10:10:00Z"
}

Errors

StatusTypeDescription
404not_foundOne or both tools not found

Update Invalidation Rule

PATCH /api/v1/mcp/rules/{id}

Enable or disable an invalidation rule.

ParameterInTypeRequiredDescription
idpathuuidyesRule ID
FieldTypeDescription
enabledbooleanEnable or disable the rule
curl -X PATCH https://api.worldflowai.com/api/v1/mcp/rules/{id} \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"enabled": false}'

Response (200): The updated rule object.


Delete Invalidation Rule

DELETE /api/v1/mcp/rules/{id}
ParameterInTypeRequiredDescription
idpathuuidyesRule ID
curl -X DELETE https://api.worldflowai.com/api/v1/mcp/rules/{id} \
-H "Authorization: Bearer $TOKEN"

Response (200)

{
"deleted": true,
"message": "Rule deleted"
}

Auto-Generate Invalidation Rules

POST /api/v1/mcp/rules/generate

Automatically generate invalidation rules based on tool-entity mappings. Analyzes all tools with entity relationships and creates rules where a WRITE tool that writes an entity invalidates all READ tools that read the same entity. Existing rules are skipped to prevent duplicates.

No request body is required.

curl -X POST https://api.worldflowai.com/api/v1/mcp/rules/generate \
-H "Authorization: Bearer $TOKEN"

Response (200)

{
"rulesGenerated": 5,
"rulesSkipped": 2,
"generatedRules": [
{
"writeToolId": "660e8400-e29b-41d4-a716-446655440010",
"writeToolName": "update_issue",
"invalidateToolId": "660e8400-e29b-41d4-a716-446655440001",
"invalidateToolName": "get_issue",
"sharedEntities": ["jira_issue"]
}
],
"message": "Generated 5 new invalidation rule(s) based on shared entity mappings"
}

Tool Result Caching

These endpoints operate on the tool result cache directly. They are useful for programmatic cache management and debugging.

Search Tool Cache

POST /api/v1/tool-cache/search

Semantic search for cached tool results. Provide either queryEmbedding (a pre-computed vector) or queryText (text that will be embedded server-side).

FieldTypeRequiredDescription
queryEmbeddingarray of floatone ofPre-computed embedding vector
queryTextstringone ofText to embed and search
curl -X POST https://api.worldflowai.com/api/v1/tool-cache/search \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"queryText": "get_jira_issue issueKey=PROJ-123"
}'

Response (200): Search results with similarity scores and cached tool outputs.


Get Tool Cache Entry

GET /api/v1/tool-cache/{cache_key}

Exact lookup of a cached tool result by cache key.

ParameterInTypeRequiredDescription
cache_keypathint64yesNumeric cache key
curl https://api.worldflowai.com/api/v1/tool-cache/8827364519204 \
-H "Authorization: Bearer $TOKEN"

Response (200): The cached tool result entry.

Errors

StatusTypeDescription
404not_foundCache entry not found or expired

Get Tool Cache Stats

POST /api/v1/tool-cache/stats

Get observability metrics for a specific cache key.

FieldTypeRequiredDescription
(cache key identifier)yesCache key to query stats for
curl -X POST https://api.worldflowai.com/api/v1/tool-cache/stats \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"cacheKey": 8827364519204}'

Response (200): Metrics including access count, hit rate, and latency for the given cache key.


Invalidate Tool Cache

POST /api/v1/tool-cache/invalidate

Invalidate cached tool results by entity, with optional cascade to child entities.

FieldTypeRequiredDescription
entityTypestringyesEntity type name to invalidate
entityIdstringnoSpecific entity instance ID
cascadebooleannoWhether to cascade to child entities (default false)
curl -X POST https://api.worldflowai.com/api/v1/tool-cache/invalidate \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"entityType": "jira_issue",
"entityId": "PROJ-123",
"cascade": true
}'

Response (200): Count of invalidated cache entries.


Get Tool Cache Metrics

GET /api/v1/tool-cache/metrics

Get overall tool cache statistics and configuration.

curl https://api.worldflowai.com/api/v1/tool-cache/metrics \
-H "Authorization: Bearer $TOKEN"

Response (200): Aggregate cache metrics including total entries, memory usage, hit rate, and configuration parameters.


Analytics

MCP Analytics

GET /api/v1/mcp/analytics

Aggregated analytics for MCP servers and tools, including cache hit rates, latency, time series trends, and estimated cost savings.

ParameterInTypeRequiredDefaultDescription
granularityquerystringnodayTime bucket size: hour, day, week, month
startDatequerydate-timenoFilter from this date (ISO 8601)
endDatequerydate-timenoFilter until this date (ISO 8601)
serverIdqueryuuidnoFilter by server ID
toolNamequerystringnoFilter by tool name (partial match)
curl "https://api.worldflowai.com/api/v1/mcp/analytics?granularity=hour&startDate=2026-03-12T00:00:00Z" \
-H "Authorization: Bearer $TOKEN"

Response (200)

{
"summary": {
"totalCalls": 15234,
"cacheHits": 8421,
"cacheMisses": 6813,
"hitRate": 0.5528,
"avgLatencyCacheMs": 3.2,
"avgLatencyMissMs": 245.7,
"estimatedTimeSavedMs": 2069043,
"estimatedCostSaved": 42.15
},
"byServer": [
{
"serverId": "550e8400-e29b-41d4-a716-446655440000",
"serverName": "Atlassian MCP",
"totalCalls": 8500,
"cacheHits": 5100,
"hitRate": 0.60,
"toolCount": 12
}
],
"byTool": [
{
"toolId": "660e8400-e29b-41d4-a716-446655440001",
"toolName": "get_jira_issue",
"serverId": "550e8400-e29b-41d4-a716-446655440000",
"category": "READ",
"totalCalls": 3200,
"cacheHits": 2560,
"hitRate": 0.80,
"avgLatencyMs": 2.8
}
],
"trend": [
{
"period": "2026-03-12T10:00:00Z",
"totalCalls": 534,
"cacheHits": 321,
"cacheMisses": 213,
"hitRate": 0.6011
}
],
"executionTimeMs": 45
}

Export MCP Configuration

GET /api/v1/mcp/config/export

Export the complete MCP configuration as YAML. Includes all servers, tools, entities, mappings, and invalidation rules. Suitable for backup or GitOps workflows.

curl https://api.worldflowai.com/api/v1/mcp/config/export \
-H "Authorization: Bearer $TOKEN" \
-H "Accept: application/yaml"

Response (200): Content-Type: application/yaml

servers:
- name: "Atlassian MCP"
url: "https://mcp.example.com:9001"
transport: "HTTP"
auth:
type: "API_KEY"
header: "Authorization"
valueEnv: "ATLASSIAN_API_KEY"

tools:
get_jira_issue:
category: read
cache:
enabled: true
ttlSecs: 3600
semanticThreshold: 0.90
crossAgent: true
entities:
- param: issueKey
type: jira_issue

entities:
jira_issue:
parent: jira_project
jira_project: {}

MCP Activity Stream (WebSocket)

GET /api/v1/mcp/stream

Real-time WebSocket stream of MCP activity events. Connect via WebSocket upgrade.

Events include:

  • Tool invocations
  • Cache hits and misses
  • Invalidation triggers
  • Health check results
# Using websocat
websocat "wss://api.worldflowai.com/api/v1/mcp/stream" \
-H "Authorization: Bearer $TOKEN"

Response: 101 Switching Protocols on successful upgrade, then a stream of JSON event objects.


Connections

Manage MCP client connections (the links between WorldFlow AI and remote MCP servers at the transport level).

List MCP Connections

GET /api/v1/mcp/connections
ParameterInTypeRequiredDescription
serverIdqueryuuidnoFilter by server ID
clientIdquerystringnoFilter by client ID
statequerystringnoFilter by state: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED, ERROR
pagequeryintegernoPage number
pageSizequeryintegernoResults per page
curl "https://api.worldflowai.com/api/v1/mcp/connections?state=CONNECTED" \
-H "Authorization: Bearer $TOKEN"

Response (200): Paginated list of connection objects with IDs, server references, client IDs, states, and timestamps.


Create MCP Connection

POST /api/v1/mcp/connections

Create a new MCP client connection. Requires ManageConfig permission.

curl -X POST https://api.worldflowai.com/api/v1/mcp/connections \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"serverId": "550e8400-e29b-41d4-a716-446655440000",
"clientId": "agent-pool-1"
}'

Response (200): The created connection object with its assigned ID and initial state.


Get MCP Connection

GET /api/v1/mcp/connections/{id}
ParameterInTypeRequiredDescription
idpathuuidyesConnection ID
curl https://api.worldflowai.com/api/v1/mcp/connections/{id} \
-H "Authorization: Bearer $TOKEN"

Response (200): Connection details including state, server reference, and tracking metadata.


Update Connection State

PATCH /api/v1/mcp/connections/{id}/state

Update the state of an MCP connection. Requires ManageConfig permission.

ParameterInTypeRequiredDescription
idpathuuidyesConnection ID
FieldTypeRequiredDescription
statestringyesNew state: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED, ERROR
curl -X PATCH https://api.worldflowai.com/api/v1/mcp/connections/{id}/state \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"state": "DISCONNECTING"}'

Response (200): The updated connection state.


Record Connection Heartbeat

POST /api/v1/mcp/connections/{id}/heartbeat

Record a heartbeat for an MCP connection to signal it is still alive.

ParameterInTypeRequiredDescription
idpathuuidyesConnection ID
curl -X POST https://api.worldflowai.com/api/v1/mcp/connections/{id}/heartbeat \
-H "Authorization: Bearer $TOKEN"

Response (200): Heartbeat acknowledgment with the recorded timestamp.


Connection Events (WebSocket)

GET /api/v1/mcp/connections/events

Real-time WebSocket stream of MCP connection events. Maximum 100 concurrent WebSocket connections.

ParameterInTypeRequiredDescription
tokenquerystringnoJWT token for WebSocket authentication (alternative to header)
websocat "wss://api.worldflowai.com/api/v1/mcp/connections/events?token=$TOKEN"

Response: 101 Switching Protocols on successful upgrade, then a stream of connection state change events.


Get Server Connection Stats

GET /api/v1/mcp/servers/{server_id}/connection-stats

Get connection statistics for a specific MCP server.

ParameterInTypeRequiredDescription
server_idpathuuidyesServer ID
curl https://api.worldflowai.com/api/v1/mcp/servers/{server_id}/connection-stats \
-H "Authorization: Bearer $TOKEN"

Response (200): Connection statistics including active count, total historical connections, and error rates.


Error Format

All error responses use the following format:

{
"type": "not_found",
"message": "Server with ID 550e8400-... not found"
}
FieldTypeDescription
typestringMachine-readable error category
messagestringHuman-readable description

Common error types:

TypeHTTP StatusDescription
validation_error400Invalid request body or parameters
authentication_error401Missing or invalid bearer token
permission_error403Insufficient permissions for the operation
not_found404Requested resource does not exist
discovery_error500MCP tool discovery failed
internal_error500Unexpected server error