Skip to main content

What is MCP?

Model Context Protocol (MCP) is an open standard that lets AI agents connect to external tools and data sources. MCPs give agents capabilities like browsing the web, querying databases, or interacting with third-party APIs.

Built-in MCPs

Twill automatically configures these MCP servers for all tasks: For GitHub access, Twill uses the GitHub CLI (gh) inside the sandbox environment (authenticated via GH_TOKEN).
MCP ServerCapabilities
Context7Up-to-date documentation for libraries
LinearRead and update Linear issues (when connected)
NotionRead and update Notion pages (when connected)
Browser automation and screenshot capture is provided via the agent-browser CLI (not as an MCP server).

Adding Custom MCPs

You can add custom MCP servers by creating a .mcp.json file in your repository root. Twill will detect this file and make those servers available to the agent.

Configuration Format

Create a .mcp.json file with this structure:
{
  "mcpServers": {
    "my-server": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "my-mcp-server@latest"]
    }
  }
}

Server Types

MCP supports two connection types:
TypeDescriptionExample
stdioRuns a local commandnpx, uvx, or any CLI tool
httpConnects to a remote HTTP endpointhttps://mcp.example.com

Example: Adding a Database MCP

{
  "mcpServers": {
    "postgres": {
      "type": "stdio",
      "command": "uvx",
      "args": ["postgres-mcp", "--access-mode=readonly"],
      "env": {
        "DATABASE_URI": "${DATABASE_URL}"
      }
    }
  }
}
Use environment variable syntax (${VAR_NAME}) to reference secrets. Configure these in your repository environment settings.

Example: Adding an HTTP MCP

{
  "mcpServers": {
    "my-api": {
      "type": "http",
      "url": "https://mcp.myservice.com",
      "headers": {
        "Authorization": "Bearer ${MY_API_TOKEN}"
      }
    }
  }
}