MCP
MCP servers attached to an agent, their live state, and the daemon-wide registrations.
On this page
The agent's MCP servers: configured and live state
/agents/{id}/mcpPath parameters
| Name | Type | Description |
|---|---|---|
idrequired | string | Loaded agent: its id, handle or name. |
Responses
| Status | Description | Body | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 200 | Servers | AgentMcpDiagnostics | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
statesrequiredarray<McpServerState> | 7 fields of | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
namerequired | string | ||||||||||
statusrequired | string | ||||||||||
error | string | ||||||||||
connectedAt | integer | ||||||||||
restartCountrequired | integer | ||||||||||
toolCountrequired | integer | ||||||||||
logsrequired | array<object> | ||||||||||
3 fields of | |||||||||||
timestamprequired | integer | |
streamrequired | string | |
messagerequired | string |
Errors 401 · 403 · 404
| 401 | Missing or wrong bearer token (unauthorized) | |
| 403 | The request guard refused it: Host header not allowed (host_not_allowed, DNS-rebinding protection) or a browser cross-site request (cross_origin)host_not_allowedcross_origin | |
| 404 | Unknown agent (or the named resource: loop, task, file, …) |
Error bodies use the error format.
Example
curl "http://127.0.0.1:7385/agents/agent-1/mcp" \
-H "Authorization: Bearer $ADF_DAEMON_TOKEN"The agent's MCP servers (same as GET …/mcp)
/agents/{id}/runtime/mcpPath parameters
| Name | Type | Description |
|---|---|---|
idrequired | string | Loaded agent: its id, handle or name. |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Servers | AgentMcpDiagnostics |
Fields as in AgentMcpDiagnostics above. | ||
Errors 401 · 403 · 404
| 401 | Missing or wrong bearer token (unauthorized) | |
| 403 | The request guard refused it: Host header not allowed (host_not_allowed, DNS-rebinding protection) or a browser cross-site request (cross_origin)host_not_allowedcross_origin | |
| 404 | Unknown agent (or the named resource: loop, task, file, …) |
Error bodies use the error format.
Example
curl "http://127.0.0.1:7385/agents/agent-1/runtime/mcp" \
-H "Authorization: Bearer $ADF_DAEMON_TOKEN"Attach or update an MCP server config
/agents/{id}/mcp/serversSaved to the agent config; the server connects at the next start, or now with POST …/mcp/servers/{serverName}/restart.
Path parameters
| Name | Type | Description |
|---|---|---|
idrequired | string | Loaded agent: its id, handle or name. |
Request bodyapplication/json · McpAttachBody · required
server (alias serverConfig) with name and transport.
| Field | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
serverrequired | object | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
20 fields of | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
namerequired | string | ||||||||||
transportrequired | string | ||||||||||
command | string | ||||||||||
args | array<string> | ||||||||||
url | string | ||||||||||
oauth | boolean | ||||||||||
headers | map<string, string> | ||||||||||
header_env | array<object> | ||||||||||
bearer_token_env_var | string | ||||||||||
env | map<string, string> | ||||||||||
env_keys | array<string> | ||||||||||
env_schema | array<object> | ||||||||||
npm_package | string | ||||||||||
pypi_package | string | ||||||||||
source | string | ||||||||||
available_tools | array<object> | ||||||||||
tool_call_timeout_ms | integer | ||||||||||
restricted | boolean | ||||||||||
run_location | string | ||||||||||
credential_files | array<object> | ||||||||||
3 fields of | |||||||||||
pathrequired | string | |
required | boolean | |
write_back | boolean |
serverConfigResponses
| Status | Description | Body | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 200 | Attached | McpAttachResponse | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
paramsarray<object> | 2 fields of | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
keyrequired | string | |
valuerequired | string |
provider_paramsinstructionsrequiredcontextrequiredcompact_threshold, audit, dynamic_instructions
toolsrequiredTool declarations
5 fields of tools
namerequired | string | |
enabledrequired | boolean | |
visible | boolean | |
restricted | boolean | |
locked | boolean |
triggersrequiredon_startup, on_inbox, on_outbox, on_file_change, on_chat, on_timer, on_tool_call, on_task_create, on_task_complete, on_logs, on_llm_call
3 fields of triggers
enabledrequired | boolean | ||||||||||||||||||||||||||||||||||
targetsrequired | array<TriggerTarget> | ||||||||||||||||||||||||||||||||||
11 fields of | |||||||||||||||||||||||||||||||||||
scoperequired | string | |
lambda | string | System scope: |
command | string | System scope: shell command (alternative to lambda) |
warm | boolean | |
filter | object | |
debounce_ms | integer | |
interval_ms | integer | |
batch_ms | integer | |
batch_count | integer | |
locked | boolean | |
loop | string | Cognition loop this target wakes; absent = main |
lockedsecurityrequiredlimitsrequiredmessagingrequiredmode (proactive | respond_only | listen_only), receive, network, …
mcp2 fields of mcp
serversrequired | array<McpServerConfig> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
20 fields of | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
namerequired | string | ||||||||||
transportrequired | string | ||||||||||
command | string | ||||||||||
args | array<string> | ||||||||||
url | string | ||||||||||
oauth | boolean | ||||||||||
headers | map<string, string> | ||||||||||
header_env | array<object> | ||||||||||
bearer_token_env_var | string | ||||||||||
env | map<string, string> | ||||||||||
env_keys | array<string> | ||||||||||
env_schema | array<object> | ||||||||||
npm_package | string | ||||||||||
pypi_package | string | ||||||||||
source | string | ||||||||||
available_tools | array<object> | ||||||||||
tool_call_timeout_ms | integer | ||||||||||
restricted | boolean | ||||||||||
run_location | string | ||||||||||
credential_files | array<object> | ||||||||||
3 fields of | |||||||||||
pathrequired | string | |
required | boolean | |
write_back | boolean |
new_tools_restrictedadaptersChannel adapters by type
4 fields of adapters
enabledrequired | boolean | ||||
config | object | Adapter-specific settings (no secrets: tokens are credentials) | |||
policy | object | ||||
limits | object | ||||
1 field of | |||||
max_attachment_size | integer | Bytes |
providers8 fields of providers
idrequired | string |
| ||||||
typerequired | string | |||||||
namerequired | string | |||||||
baseUrlrequired | string | |||||||
preset | string | |||||||
defaultModel | string | |||||||
params | array<object> | |||||||
2 fields of | ||||||||
keyrequired | string | |
valuerequired | string |
requestDelayMsloopsInner (side) loops; main is implicit
8 fields of loops
namerequired | string | |
goalrequired | string | Becomes the loop's instructions |
enabledrequired | boolean | |
autostart | boolean | |
autonomous | boolean | |
model | object | |
compact_threshold | integer | null | |
tools | array<string> | Absolute allow-list, intersected with the host's enabled tools |
ws_connectionsservinglocked_fieldsmetadatarequiredcreated_at, updated_at, author, tags, version
Errors 400 · 401 · 403 · 404 · 500
| 400 | Invalid request: missing or malformed field, query parameter or body. A body Fastify cannot parse gets Fastify's own shape (statusCode, code, error, message).bad_requestFST_ERR_CTP_EMPTY_JSON_BODY | |
| 401 | Missing or wrong bearer token (unauthorized) | |
| 403 | The request guard refused it: Host header not allowed (host_not_allowed, DNS-rebinding protection) or a browser cross-site request (cross_origin)host_not_allowedcross_origin | |
| 404 | Unknown agent (or the named resource: loop, task, file, …) | |
| 500 | Unexpected runtime failure |
Error bodies use the error format.
Example
curl -X POST "http://127.0.0.1:7385/agents/agent-1/mcp/servers" \
-H "Authorization: Bearer $ADF_DAEMON_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"server": {
"name": "filesystem",
"transport": "stdio",
"npm_package": "@modelcontextprotocol/server-filesystem"
}
}'Detach an MCP server and delete its credentials
/agents/{id}/mcp/servers/{serverName}Removes the server config and the matching mcp:* identity rows.
Path parameters
| Name | Type | Description |
|---|---|---|
idrequired | string | Loaded agent: its id, handle or name. |
serverNamerequired | string | MCP server name in the agent config |
Query parameters
| Name | Type | Description |
|---|---|---|
credentialNamespace | string | Credential namespace to delete (default: the server's package or name) |
Responses
| Status | Description | Body | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 200 | Detached | McpDetachResponse | |||||||||||||||
| |||||||||||||||||
Errors 401 · 403 · 404 · 500
| 401 | Missing or wrong bearer token (unauthorized) | |
| 403 | The request guard refused it: Host header not allowed (host_not_allowed, DNS-rebinding protection) or a browser cross-site request (cross_origin)host_not_allowedcross_origin | |
| 404 | Unknown agent (or the named resource: loop, task, file, …) | |
| 500 | Unexpected runtime failure |
Error bodies use the error format.
Example
curl -X DELETE "http://127.0.0.1:7385/agents/agent-1/mcp/servers/filesystem" \
-H "Authorization: Bearer $ADF_DAEMON_TOKEN"Connect one configured MCP server now
/agents/{id}/mcp/servers/{serverName}/restartThe same connect the agent's own mcp_restart tool does (host or container routing, the agent's sealed credentials, tool discovery). Use it after POST …/mcp/servers (attached servers connect at the next start otherwise) or to retry a failed server. 404 for an unknown server; 409 when the agent is not running here. No body.
Path parameters
| Name | Type | Description |
|---|---|---|
idrequired | string | Loaded agent: its id, handle or name. |
serverNamerequired | string | MCP server name in the agent config |
Responses
| Status | Description | Body | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 200 | Connect outcome | McpRestartResponse | ||||||||||||||||||||||||
| ||||||||||||||||||||||||||
Errors 401 · 403 · 404 · 409 · 500
| 401 | Missing or wrong bearer token (unauthorized) | |
| 403 | The request guard refused it: Host header not allowed (host_not_allowed, DNS-rebinding protection) or a browser cross-site request (cross_origin)host_not_allowedcross_origin | |
| 404 | Unknown agent (or the named resource: loop, task, file, …) | |
| 409 | The resource is in a state that does not allow this now | |
| 500 | Unexpected runtime failure |
Error bodies use the error format.
Example
curl -X POST "http://127.0.0.1:7385/agents/agent-1/mcp/servers/filesystem/restart" \
-H "Authorization: Bearer $ADF_DAEMON_TOKEN"Daemon-wide MCP registrations (values redacted)
/runtime/mcpResponses
| Status | Description | Body | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 200 | Registrations | McpRegistrationsDiagnostics | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
headersrequiredarray<object> | 2 fields of | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
keyrequired | string | |
hasValuerequired | boolean |
headerEnvrequired2 fields of headerEnv
headerrequired | string | |
envrequired | string |
bearerTokenEnvVarrequiredtoolCallTimeoutrequiredErrors 401 · 403
| 401 | Missing or wrong bearer token (unauthorized) | |
| 403 | The request guard refused it: Host header not allowed (host_not_allowed, DNS-rebinding protection) or a browser cross-site request (cross_origin)host_not_allowedcross_origin |
Error bodies use the error format.
Example
curl "http://127.0.0.1:7385/runtime/mcp" \
-H "Authorization: Bearer $ADF_DAEMON_TOKEN"