> ## Documentation Index
> Fetch the complete documentation index at: https://docs.servflow.io/llms.txt
> Use this file to discover all available pages before exploring further.

# The Servflow MCP server

> The Servflow MCP server: its address, how a client authenticates, and every tool with its inputs and what it returns

The Servflow MCP server lets an MCP client, such as Claude Code, manage your team's agents, support agents, providers, integrations, secrets, memory, support files, and live chat over the [Model Context Protocol](https://modelcontextprotocol.io). This page lists its address, how a client authenticates, every tool with its inputs and what it returns, and its errors. To connect a client, see [Manage Servflow from an AI agent](https://docs.servflow.io/guides/manage-servflow-from-an-ai-agent.md).

The MCP server runs on Servflow Cloud only. A self-hosted instance has no MCP server; the [`servflowai resource` CLI](https://docs.servflow.io/references/cli) offers the same operations.

## Address and authentication

| | |
| - | - |
| URL | `https://server.servflow.io/api/mcp` |
| Transport | Streamable HTTP, served stateless: each call carries everything it needs. |

| Header | Value |
| - | - |
| `Authorization` | `Bearer <key>`, where `<key>` is your team's API key. The key alone, with no `Bearer`, is accepted too. |

The API key is under **Settings** > **MCP connection** > **Your API key** in the dashboard. The URL is the same for every team: the key decides which team the tools reach.

A tool's result is JSON text. A tool that fails returns a tool error; see [Errors](#errors).

## Behaviour that applies to all tools

* **Saving only stores.** `create_config` and `create_integration` store a disabled row. `update_config` and `update_integration` store the new version, and an enabled agent or integration keeps running its previous version.
* **Enabling builds.** `set_config_enabled` and `set_integration_enabled` check what the row names, build it, and run it. When it cannot be built, the tool returns why and the row stays as it was. Enabling an enabled row runs its saved version.
* **Enabling an integration does not restart agents.** An agent holding the integration, such as one with a `discord_gateway` trigger, keeps the previous instance until the agent is enabled again.
* **Credentials are write-only.** No tool returns a secret's value or a provider's `config`.
* **The catalogs are Servflow Cloud's.** The catalog tools include the Servflow Cloud entry handlers, actions, and integration types.

## Agent tools

An agent is addressed by its `config_id`. The `config` input takes the body described in [The body for create and update](https://docs.servflow.io/references/cli.md#agent), or the bare agent document described in [The shape of an agent](https://docs.servflow.io/references/cli.md#the-shape-of-an-agent). An `enabled` key in it is ignored.

> [!WARNING]
>
> `list_configs` also lists support agents, as kind `support`, and `get_config`, `update_config`, `delete_config`, and `set_config_enabled` accept them. These tools do not keep a support agent's channels, guardrails, and handoffs in step with its stored agent. The [support agent tools](#support-agent-tools) do.

| Tool | Inputs | Returns |
| - | - | - |
| `list_configs` | `kind`, optional: `agent` to list agents only | Each agent's `config_id`, `name`, `description`, `kind`, `enabled`, `entries` (how it is triggered), `agents` (how many sub agents), `actions` (the action types it uses), and `created_at`. |
| `get_config` | `config_id`, required | The stored agent. |
| `validate_config` | `config`, required | `{"valid": true, "stored_form": ...}` when the agent is valid; otherwise a tool error saying what is wrong. Writes nothing. |
| `create_config` | `config`, required | The stored agent, disabled. `config_id` is derived from `name` when the body has none. |
| `update_config` | `config_id`, required; `config`, required, the whole agent | The stored agent. |
| `delete_config` | `config_id`, required | `{"deleted": "<config_id>"}`. |
| `set_config_enabled` | `config_id`, required; `enabled`, required, `true` to run the agent or `false` to stop it | The stored agent, or a tool error saying why it cannot run. |
| `config_schema` | none | The JSON Schema an agent body must satisfy. |
| `config_example` | none | A small valid agent with a `github_webhook` trigger. Its provider and integration ids are placeholders. |

## Provider, integration, secret, and memory tools

### Providers

A provider is addressed by its `providerId`. The built-in provider, `native`, is not stored and is not listed.

| Tool | Inputs | Returns |
| - | - | - |
| `list_providers` | none | Every stored provider, without its `config`. |
| `get_provider` | `providerId`, required | The provider, without its `config`. |
| `create_provider` | `name`, required; `type`, required; `config`, required, the type's fields as plain values | The provider, with its generated `providerId`. The config is checked by building the client it describes. |
| `update_provider` | `providerId`, required; `name`, optional; `config`, optional, the fields to replace | The provider. Fields left out of `config` keep their stored values. The type cannot be changed. |
| `delete_provider` | `providerId`, required | `{"deleted": "<providerId>"}`. Agents that name the provider are not checked, and fail at their next model call. |

A provider change needs no enable: the next run uses it.

### Integrations

An integration is addressed by its `integration_id`.

| Tool | Inputs | Returns |
| - | - | - |
| `list_integrations` | none | Every stored integration, without its `config`. |
| `get_integration` | `integration_id`, required | The integration. |
| `create_integration` | `name`, required; `type`, required; `config`, required, each field as `{"value": ...}` or `{"secret": "<secret name>"}` | The integration, disabled, with its `integrationId` generated from `name`. |
| `update_integration` | `integration_id`, required; `name`, required; `type`, required; `config`, required | The integration. Its id never changes. |
| `delete_integration` | `integration_id`, required | `{"deleted": "<integration_id>"}`. |
| `set_integration_enabled` | `integration_id`, required; `enabled`, required | The integration, or a tool error saying why it cannot be built. An integration still waiting for its OAuth sign-in cannot be enabled. |

### Secrets

A secret is addressed by its `name`. Read it in a template as `{{ secret "name" }}`.

| Tool | Inputs | Returns |
| - | - | - |
| `list_secrets` | none | Each secret's name and metadata, never its value. |
| `create_secret` | `name`, required; `value`, required; `description`, optional | The secret's name and metadata. |
| `update_secret` | `name`, required; `value`, required | The secret's name and metadata. A secret cannot be renamed. |
| `delete_secret` | `name`, required | `{"deleted": "<name>"}`. |

### Memory

A memory is a folder that sub agents read and write with their built-in file tools. The tools use the code's word, `workspace`, and address a memory by its `uid`. A sub agent uses one through its `workspaceID`.

| Tool | Inputs | Returns |
| - | - | - |
| `list_workspaces` | none | Every memory. |
| `get_workspace` | `uid`, required | The memory. |
| `create_workspace` | `workspace`, required: `{"name": ..., "description": ...}`, with `name` required | The memory, with its `uid`. The server names and creates its folder. |
| `update_workspace` | `uid`, required; `workspace`, required: the new `name` and `description` | The memory. |
| `delete_workspace` | `uid`, required | `{"deleted": "<uid>"}`. |

## Catalog tools

What an agent can be built from. These tools write nothing.

| Tool | Inputs | Returns |
| - | - | - |
| `list_actions` | `app`, optional, an app's id | Without `app`: the apps that have actions, each with its name and how many it has. With `app`: that app's action types, each with its description. |
| `describe_action` | `types`, a list of action types; or `all`: `true` | Each action's fields, the integration groups an `integration` field accepts, and what the action returns for a later step. |
| `list_entry_handlers` | none | Each entry handler type with its description. |
| `describe_entry_handler` | `types`, a list of handler types; or `all`: `true` | Each handler's fields, whether each is required and what leaving it out means, the integration type an `integration` field needs, the variables it gives the prompt, and whether it is a listener, which has no path. |
| `list_app_events` | `app`, optional, an app's id | Without `app`: the apps that have events, each with its name and how many it has. With `app`: that app's events, each with its description. An app's id is also the integration group whose integrations can watch its events. |
| `describe_app_event` | `events`, required, a list of event names | Each event's settings, which go in an `app_event` trigger's `settings`, and the variables a run reads as `{{ .event.data.<path> }}`. |
| `list_integration_types` | none | The integration types that can be created. |
| `describe_integration_type` | `types`, a list of integration types; or `all`: `true` | Each type's fields and groups. |
| `list_provider_types` | none | The provider types that can be created. |
| `describe_provider_type` | `types`, a list of provider types; or `all`: `true` | Each type's fields, default model, suggested models, and where to get credentials. The model list is a suggestion, not a limit. |
| `list_template_functions` | `category`, optional: `request`, `trigger`, `tool`, `source`, `output`, `transform`, or `predicate` | The template functions, with their syntax and an example of each. |

## Support agent tools

A support agent is addressed by its `support_agent_id`. The `provider_id` and each `integration_id` a support agent names come from `list_providers` and `list_integrations`; `native` names the built-in provider.

| Tool | Inputs | Returns |
| - | - | - |
| `list_support_agents` | none | `{"support_agents": [...]}`: each support agent with its channels, instructions, handoffs, guardrails, and whether it is enabled. |
| `get_support_agent` | `support_agent_id`, required | The support agent. |
| `create_support_agent` | `support_agent`, required | The support agent, disabled. With no guardrails, it gets `answers_from_business`. |
| `update_support_agent` | `support_agent_id`, required; `support_agent`, required, the whole support agent | The support agent. An enabled one keeps answering with its last enabled version until it is enabled again. |
| `set_support_agent_enabled` | `support_agent_id`, required; `enabled`, required, `true` to start answering customers or `false` to stop | The support agent, or a tool error saying why it cannot start. Enabling checks your plan, checks that no other enabled support agent answers on the same integration, and builds it. |

The `support_agent` object has these keys. `id`, `created_at`, and `updated_at` are ignored.

| Key | Meaning |
| - | - |
| `name` | The support agent's name. |
| `fallback_message` | What the support agent says when it cannot answer. |
| `channels` | Where it answers. Each item has `type`: `email`, `livechat`, or `discord`; `integration_id`; and, for Discord, `discord.allowed_channels`. |
| `agent` | `provider_id` and `system_prompt`, its instructions. |
| `tools` | The tools it can use. |
| `handoffs` | Where it hands a conversation to a person. Each item has `name`, `description`, `integration_id`, `action`, and `config`. |
| `guardrails` | Checks on every reply. Each item has `name` and `instructions`. |

## Support file tools

| Tool | Inputs | Returns |
| - | - | - |
| `add_support_file` | `name`, required, ending in `.txt`, `.md`, `.csv`, or `.html`; `text`, required, the file's contents, at most 25 MB; `policy_labels`, optional, up to 10 labels of 1 to 60 characters | The file. It is saved as `uploaded` and becomes `ready` once Servflow has read it; a file Servflow cannot read is removed. Your plan has to include support files. |
| `list_support_files` | none | `{"support_files": [...]}`: the team's files, newest first, each with its status (`uploaded`, `processing`, or `ready`) and its policy labels. |

A message loads the files whose policy labels it matches. A file with no label loads for every answer.

## Live chat tools

The team's live chat: the support agent it talks to, its title, and its look.

| Tool | Inputs | Returns |
| - | - | - |
| `get_livechat` | none | The live chat. |
| `set_livechat` | `livechat`, required, the whole live chat | The live chat as saved. |

The `livechat` object has these keys.

| Key | Meaning |
| - | - |
| `agent_id` | A support agent with a `livechat` channel. |
| `title` | The name on the chat, up to 40 characters. |
| `color` | The chat's color, as `#RRGGBB`. |
| `greeting` | The first message, up to 300 characters. |
| `websites` | 1 to 10 hosts that load the chat, such as `lumencycles.com`. |
| `logo_url` | Empty, or an `https` link to an image. |
| `hello` | `on`; `style`: `bubble` or `open`; and `delay_seconds`: `0`, `5`, `10`, `30`, or `60`. |
| `page_greeting` | `on`, and `note`, up to 500 characters. |

## Errors

| Error | Cause |
| - | - |
| HTTP `401`, `{"error":"unauthorized"}` | The request has no `Authorization` header, or its key is empty. |
| HTTP `401`, `{"error":"invalid auth token"}` | The key matches no team. |
| A tool result with `"isError": true` | The tool could not do what was asked. The text says why, in words the model can act on, such as `get agent config: agent config not found: nope`. |

## Example

A `tools/call` request for `list_secrets`, sent without an MCP client. The server is stateless, so the call needs no `initialize` first.

```bash theme={null}
curl https://server.servflow.io/api/mcp \
  -H "Authorization: Bearer <key>" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"list_secrets","arguments":{}}}'
```

For a team with no secrets, the server answers:

```json theme={null}
{"jsonrpc":"2.0","id":1,"result":{"content":[{"type":"text","text":"[]"}]}}
```

## Related

> [card] [Manage Servflow from an AI agent](https://docs.servflow.io/guides/manage-servflow-from-an-ai-agent.md)
>
> Connect an MCP client and create an agent with it.

> [card] [CLI reference](https://docs.servflow.io/references/cli.md)
>
> The same operations from the command line, and the shape of an agent.

> [card] [Available entry handlers](https://docs.servflow.io/references/entry-handlers.md)
>
> The triggers the catalog tools describe.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.