Skip to main content
Connic
Build

MCP Servers

Connect your agents to external MCP servers to extend their capabilities with additional tools.

Last updated
Looking for Connic MCP?
Need to manage a Connic project from an AI client? Use AI agent setup.
MCP protocol support

External MCP tool connections support protocol revision 2026-07-28. Tool annotations, structured results, and UI resource metadata attached to tools are preserved.

Compatible MCP clients can connect through the MCP Server connector using protocol negotiation.

What is MCP?

Extend your agents with external tools via the Model Context Protocol

MCP servers expose tools that your agents can use alongside local tools. Configure them in your agent YAML. All MCP tool calls are traced and visible in run details. Compare the MCP server, connector, and client roles before choosing which side to configure.

MCP tools in an agent

Add mcp_servers to your agent YAML. Each server contributes all tools or the subset named in its tools field. The agent calls them like local tools.

Basic Usage

agents/docs-assistant.yaml
version: "1.0"

name: docs-assistant
type: llm
model: connic/kimi-k2.7-code-fast
description: "An assistant with access to library documentation via MCP"
system_prompt: |
  You are a helpful coding assistant with access to up-to-date
  library documentation through MCP tools.

# Connect to an MCP server
mcp_servers:
  - name: context7
    url: https://mcp.context7.com/mcp

Configuration Reference

FieldTypeStatusDescription
namestringRequiredIdentifier for the MCP server. Used in logs and traces.
urlstringRequiredThe URL of the MCP server endpoint. Supports ${VAR} syntax for environment variables.
toolsstring[]OptionalList of specific tools to use from this server. If omitted, all tools are available.
headersobjectOptionalHTTP headers to send with requests. Use for authentication. Supports ${VAR} environment values and ${context.*} per-run context values.
discoverablebooleanOptionalWhen true, tools from this server are indexed for on-demand discovery instead of being loaded into the LLM context upfront. See Discoverable MCP Servers below.Default: false
bridgestringOptionalConnic Bridge ID for routing to a private or on-premises MCP server. Supports ${VAR} substitution. See Private MCP Servers via Bridge below.

Authentication

agents/agent.yaml
mcp_servers:
  - name: github
    url: https://mcp.example.com/github
    headers:
      Authorization: "Bearer ${GITHUB_TOKEN}"
      X-User-Id: "${context.user_id}"

Use ${VAR_NAME} syntax for secrets. Configure variables in Settings → Variables. Connic forwards these static headers to the server; automatic MCP OAuth discovery and interactive authorization are not supported.

Tool Filtering

agents/agent.yaml
mcp_servers:
  - name: filesystem
    url: https://mcp.example.com/filesystem
    # Only allow specific tools
    tools:
      - read_file
      - list_directory

Restrict which tools are available. Useful for limiting agents to read-only operations or preventing use of dangerous tools.

Multiple Servers

agents/agent.yaml
mcp_servers:
  - name: docs
    url: https://mcp.context7.com/mcp

  - name: search
    url: https://mcp.example.com/search
    headers:
      X-API-Key: "${SEARCH_API_KEY}"

  - name: database
    url: https://mcp.internal.company.com/db
    headers:
      Authorization: "Bearer ${DB_TOKEN}"
    tools:
      - query
      - list_tables

Connect to multiple MCP servers at once. Each server's tools become available to the agent.

Private MCP Servers via Bridge

When your MCP server runs inside a private network (VPC, on-prem, behind a corporate firewall) and is not reachable from the public internet, set the bridge field to a Connic Bridge ID. Connic routes the MCP connection through that bridge.

agents/agent.yaml
mcp_servers:
  - name: internal-mcp
    url: http://mcp.internal:8080/mcp
    bridge: ${INTERNAL_BRIDGE_ID}

The url is the address the bridge sees from inside your network. Typically a hostname that only resolves there (for example mcp.internal:8080). The bridge ID is copied from Project Settings > Bridge. Both the URL and the bridge ID support ${VAR} substitution, so you can keep them out of YAML and store them as variables.

If the bridge agent has ALLOWED_HOSTS configured, it must include the MCP server's host:port. Unset or empty allows every target reachable from the bridge's network.

Discoverable MCP Servers

Some MCP servers expose a large number of tools. Loading all of them into the LLM context increases token usage and can reduce accuracy. Setting discoverable: true keeps the server's tools out of the LLM context and instead indexes them for on-demand search.

When an MCP server is marked as discoverable, Connic indexes its tools and lets the agent find and call them on demand with a natural-language query. Only the tools that match the query are loaded, keeping the LLM context lean.

agents/research-agent.yaml
version: "1.0"

name: research-agent
type: llm
model: connic/gpt-5.6-sol
description: "Agent with a large MCP toolset available on demand"
system_prompt: |
  You have access to many research tools. When you need one,
  search for it by describing what you need.

mcp_servers:
  - name: research-hub
    url: https://mcp.example.com/research
    discoverable: true   # all tools indexed for search, not loaded upfront
    headers:
      Authorization: "Bearer ${RESEARCH_TOKEN}"
Combining with regular tools

You can use discoverable: true on some MCP servers while keeping others loaded normally. You can also combine discoverable MCP servers with discoverable local tools on the same agent. A single discovery query searches both local and MCP tools.

Error Handling

Connection Failures: If an MCP server is unavailable at startup, the agent continues running without that server's tools.

Tool Failures: Errors are captured in traces and returned to the LLM for handling.

Recovery: MCP tool errors are returned to the LLM inside the run so it can adjust arguments or choose another tool.

Security

Store API keys and tokens as environment variables and reference them with${VAR_NAME} syntax.

Limitations
  • Remote Streamable HTTP transport is supported; stdio is not.
  • Only MCP tools are consumed as agent capabilities. Standalone resources, prompts, subscriptions, and Tasks are not loaded.
  • MCP servers must be reachable from Connic or routed through a Connic Bridge. See Private MCP Servers via Bridge.
  • Only LLM agents support MCP (not Tool or Sequential agents)