Skip to main content

Custom MCP Integration

Connect your own MCP (Model Context Protocol) servers to extend agents with custom tools.

What is MCP?​

MCP (Model Context Protocol) is a standard protocol for connecting AI agents to external tools and data sources. Autoheal uses MCP to communicate with all integrations.

Use Cases​

  • Connect internal APIs and services
  • Add custom data sources
  • Integrate proprietary tools
  • Extend agent capabilities with custom logic

Setup​

  1. Deploy Your MCP Server

    Deploy an MCP server that implements the tools you want to expose.

  2. Add Integration in Autoheal
    1. Go to Integrations → Custom MCP
    2. Enter a name for your integration
    3. Enter the MCP server URL
    4. Add the HTTP headers your server needs, such as an Authorization token. Select Secret for each header that carries a secret.
  3. Test and Save

    Click Test Connection to check the connection, then click Save.

How Agents See the Tools​

Autoheal asks your server for its tools (tools/list) and lists each one under the integration in Settings → Tools → Integration. A tool is named custommcp_<integration name>_<tool name>, in lowercase with underscores. For example, runQuery on an integration named "Sigma Prod" becomes custommcp_sigma_prod_run_query. Model providers accept tool names of up to 64 characters, so a longer name is cut to fit and ends in a short code, such as custommcp_acme_production_data_warehouse_eu_west_replic_1a2b3c4d.

  • The list is refreshed every five minutes. When your server adds or removes a tool, agents see the change within five minutes. Editing the integration refreshes its list right away.
  • A call to the tool always goes to the server of its own integration.
  • Every Custom MCP tool counts as a write tool. Agent policies that ask for approval on write tools apply to it.
  • The Autoheal Assistant can call them in any project where you can run tools. Each call runs as you, and needs the integration:run permission in the project it names. The Assistant names that project in an extra argument, autoheal_project_id, which your server never receives. A project_id argument of your tool's own reaches your server unchanged. If two projects have integrations with the same name, the Assistant is shown one copy of each tool name and the call goes to the server in the project it names. A tool that has its own autoheal_project_id argument is available to agents but not to the Assistant.
  • An agent with no integration_tools filter gets them. To narrow an agent to them, write integration_tools: integration_type == "custommcp".
  • A filter cannot name an integration. To give an agent one integration's tools, list them by name, for example integration_tools: name in ["custommcp_sigma_prod_run_query", "custommcp_sigma_prod_list_workbooks"]. A prefix such as name startsWith "custommcp_sigma_prod_" also matches the tools of an integration named "Sigma Prod EU".
  • When your server can't be reached, its tools are left out of the list. They come back within a minute of your server answering again.
  • Renaming the integration renames its tools. An agent that names them stops getting them until you change the filter, and nothing warns you. The agent's Agent's tools tab shows them as removed. A filter on integration_type == "custommcp" is not affected.
  • If two of your server's tools have the same name in lowercase with underscores, such as runQuery and run_query, only the first one in the server's list is available.
  • If two integrations' names read the same in lowercase with underscores, such as "Sigma Prod" and "sigma-prod", the older integration keeps the tool names and the newer one's tools are not listed. Give them different names.
  • Up to 20 pages of tools are read from a server that splits its list into pages.

MCP Server Requirements​

Your MCP server should:

  • Implement the MCP protocol specification
  • Use the Streamable HTTP transport. Servers that keep sessions (for example, FastMCP with its default settings) and stateless servers both work. Autoheal opens a session for each tool list or tool call and ends it after.
  • Be accessible from Autoheal (check network/firewall rules). The requests come from the Autoheal API server, not from your computer. In a BYOC installation, that is a pod in your cluster.
  • Return tool definitions and handle tool calls
  • Support appropriate authentication

Headers​

Autoheal sends the headers you add with each request to your server. Use them to authenticate, for example Authorization: Bearer <token> or X-API-Key: <key>, and to send other values your server needs.

  • A header with Secret selected is kept in the secret store. Its value is masked when anyone opens the integration, and nobody can see it again. To change it, type a new value.
  • Any other header is stored as plain text, and its value shows when you open the integration. Do not put tokens, keys or passwords in a header that is not secret.
  • If you clear Secret on a saved secret header, its value is removed. Type the value again.

In the API, plain headers are in the headers param and secret headers are in the secret_headers param. Both are maps of header name to value. If one header name is in both, the value in secret_headers is sent.

Example​

A custom MCP server might expose tools like:

JSON
{
"tools": [
{
"name": "query_internal_metrics",
"description": "Query internal metrics database",
"parameters": {
"metric_name": "string",
"time_range": "string"
}
},
{
"name": "check_feature_flags",
"description": "Check feature flag status",
"parameters": {
"flag_name": "string"
}
}
]
}
note

Contact your Autoheal representative for guidance on building custom MCP integrations.