MCP Servers

Copair supports the Model Context Protocol (MCP) for connecting to external tool servers. MCP lets you extend Copair with tools hosted outside the process — databases, APIs, specialized services, and more.

What is MCP?

MCP is an open protocol for connecting AI agents to external tools and data sources. Instead of building tools directly into the agent, MCP servers expose tools over a standardized interface that any MCP-compatible client (like Copair) can consume.

Configuring MCP Servers

Add MCP servers to your config:

# ~/.copair/config.yaml or .copair/config.yaml
mcp_servers:
  - name: database
    command: npx
    args: ["@copair/mcp-postgres", "--connection-string", "postgresql://localhost/mydb"]

  - name: github
    command: npx
    args: ["@modelcontextprotocol/server-github"]
    env:
      GITHUB_TOKEN: "${GITHUB_TOKEN}"
    timeout_ms: 10000  # override default 30s timeout for this server

  - name: filesystem
    command: npx
    args: ["-y", "@modelcontextprotocol/server-filesystem", "/path"]

Server Types

TypeConfigDescription
Stdiocommand + argsCopair spawns the server process and communicates via stdin/stdout
HTTPurlConnect to an already-running server over HTTP

Environment Variables

MCP server configs support environment variable references:

env:
  API_KEY: "${MY_SECRET_KEY}"

Variables are resolved at server startup time, not at config load time.

Using MCP Tools

Once configured, MCP tools appear alongside built-in tools. The agent can discover and use them automatically:

> Query the database for all users who signed up this week Using tool: database.query SELECT * FROM users WHERE created_at > NOW() - INTERVAL '7 days' Found 23 users...

MCP tools go through the same approval gate as built-in tools. You can add them to your allow-list:

# .copair/allow.yaml
mcp:
  - "database.query"
  - "github.list_issues"

Available MCP Servers

The MCP ecosystem includes servers for:

  • Databases — PostgreSQL, MySQL, SQLite
  • Version control — GitHub, GitLab
  • Cloud services — AWS, GCP, Azure
  • Search — Brave Search, Google Search
  • File systems — Local and remote file access
  • Custom APIs — Build your own MCP server for internal tools

See the MCP Server Registry for a full list.

Next Steps

Last updated May 12, 2026