How MCP Works
MCP is an open protocol that standardizes how AI agents communicate with tool servers. Here is how it fits into Comis:- MCP servers are external programs that expose tools over the protocol. The wider ecosystem includes 50+ community and Anthropic-maintained servers for databases, APIs, file systems, GitHub, and more. Comis itself does not bundle any MCP servers — you connect to whichever ones you want via configuration.
- Comis connects to MCP servers using one of three transport methods: stdio (for local servers running on the same machine), SSE (for legacy remote servers using Server-Sent Events), or HTTP (for remote servers using Streamable HTTP).
- Tool namespacing prevents name collisions. Tools from MCP servers appear as
mcp:serverName/toolName— so a tool calledqueryfrom a server calledmy-databasebecomesmcp:my-database/query. - Auto-discovery means you do not have to list every tool manually. When Comis connects to an MCP server, it automatically discovers all available tools using the MCP SDK.
- Auto-reconnect handles transient failures. When an MCP connection drops involuntarily, Comis retries up to 5 times with exponential backoff (starting at 1s, capped at 30s, doubling each attempt) before marking the server as errored. Configurable per server.
Worked Example: Connecting to the GitHub MCP Server
Here is a complete walkthrough using the official GitHub MCP server — one of the most popular community servers and a good template for any stdio-based integration. 1. Add the server to~/.comis/config.yaml:
{{secret:github-token}} placeholder in the YAML is replaced at runtime
with this value — the raw token never lives in the config file.
3. Restart Comis and verify:
mcp:github/list_repos, mcp:github/create_issue,
mcp:github/search_code, …). Your agent can now call them just like any
built-in tool.
Setting Up an MCP Server
Add the server to your config
Open your configuration file and add an entry under Each server needs a unique name (here:
integrations.mcp.servers:my-database). The transport field selects one of three protocols: stdio (local process), sse (legacy remote), or http (Streamable HTTP remote). The command and args fields are used only for stdio transport.Restart Comis
Comis connects to MCP servers at startup, so you need to restart after changing the configuration. Use whichever entry point matches your deployment:Comis will launch the MCP server process and discover its tools automatically. Check the logs for a message confirming the connection.
Verify the connection
Your agent can use the The
mcp_manage tool to check that the server is connected and its tools are available:list action shows all configured MCP servers and their connection status. The status action shows detailed information for a specific server, including the tools it provides.Transport Types
Comis supports three ways to connect to MCP servers:stdio (Local Process)
The stdio transport runs the MCP server as a local subprocess on the same machine as Comis. Comis starts the process and communicates with it through standard input/output. Best for: npm-packaged MCP servers, local tools, development setups.| Field | Required | Description |
|---|---|---|
transport | Yes | Must be stdio |
command | Yes | The command to run (e.g., npx, node, python) |
args | No | Command-line arguments as an array |
env | No | Environment variables passed to the subprocess |
cwd | No | Working directory for the subprocess (overrides default workspace CWD) |
maxConcurrency | No | Maximum concurrent tool calls to this server (default: 1 for stdio) |
enabled | No | Whether to connect on startup (default: true) |
SSE (Legacy Remote Server)
The SSE transport connects to a remote MCP server using Server-Sent Events for server-to-client streaming. This is the legacy remote transport from earlier versions of the MCP specification. The server must already be running and accessible at the given URL. Best for: older MCP servers that only support the SSE protocol.| Field | Required | Description |
|---|---|---|
transport | Yes | Must be sse |
url | Yes | The full URL of the remote MCP SSE endpoint |
headers | No | Custom HTTP headers sent with requests (e.g., authentication) |
maxConcurrency | No | Maximum concurrent tool calls to this server (default: 4 for remote) |
enabled | No | Whether to connect on startup (default: true) |
HTTP (Streamable HTTP Remote Server)
The HTTP transport connects to a remote MCP server using Streamable HTTP, the current standard for remote MCP communication. The server must already be running and accessible at the given URL. Best for: modern MCP servers, shared servers, cloud-hosted tools, servers running on other machines.| Field | Required | Description |
|---|---|---|
transport | Yes | Must be http |
url | Yes | The full URL of the remote MCP server |
headers | No | Custom HTTP headers sent with requests (e.g., authentication) |
maxConcurrency | No | Maximum concurrent tool calls to this server (default: 4 for remote) |
enabled | No | Whether to connect on startup (default: true) |
Using Secrets in MCP Config
If your MCP server needs API keys or other sensitive values, use the{{secret:name}} syntax instead of putting secrets directly in the config file:
{{secret:my-api-key}} placeholder is replaced at runtime with the value stored in the Comis secret manager. See Secrets Management for how to store and manage your secrets.
Managing MCP Connections
Themcp_manage tool lets your agents (and you, through the dashboard) check and control MCP server connections at runtime:
| Action | Description |
|---|---|
list | Show all configured MCP servers and their connection status |
status | Check the connection health and available tools for a specific server |
connect | Manually connect to a server that is configured but not yet connected |
disconnect | Disconnect from a running server (its tools become unavailable) |
reconnect | Disconnect and reconnect to a server (useful after server-side changes) |
The same actions are also exposed through the web dashboard. You do not need to invoke the agent to manage MCP connections — but the
skills_manage tool only handles prompt skills, not MCP servers.Health Monitoring
Comis periodically checks the health of connected MCP servers. If a server becomes unreachable:- Its tools are temporarily removed from the agent’s available tool list
- The agent continues working with all other tools — a single failed MCP server does not affect the rest of the system
- Comis retries the connection automatically at the configured health check interval
- When the server comes back online, its tools are automatically restored
Multiple MCP Servers
You can connect as many MCP servers as you need. Each server gets its own namespace, so tools from different servers never conflict:mcp:sqlite-db/query, mcp:github/list_repos, and mcp:analytics/run_report — each clearly indicating which server provides it.
Telling the agent when to prefer this MCP
Connecting an MCP server makes its tools discoverable, but the agent will still reach forpip install <X> when the model thinks it needs a Python lib that overlaps with what the MCP already provides. To close that gap, declare a capability hint under tooling.mcp.capabilityHints.<server-name> listing the packages this MCP supersedes. The install-detour subsystem then refuses (or warns about) pip install <X> / npm install <X> for any matching package and routes the agent to the connected MCP instead.
Two CLI commands automate this:
Tool-First Capability Layer
sync-tooling + tooling-fill operator workflowSkills Overview
Understanding the three types of skills
Tool Policy
Control which tools your agents can use
Config Reference
Full configuration reference including MCP settings
