TerragonTerragon Docs
Configuration

MCP Setup

Configure Model Context Protocol (MCP) servers to give Terragon access to external tools, databases, and services.

What is MCP?

Model Context Protocol is an open standard that enables AI assistants to interact with external systems through a unified interface. In Terragon, MCP servers provide Terragon with additional capabilities beyond code editing.

Configuring MCP Servers

The Codex agent only supports command-based MCP servers.

Navigate to Environments

Find the "MCP Server Configuration" section
Add your configuration in JSON format
Click Save MCP Config

Configuration Format

MCP configurations use JSON format with the following structure:

mcp-server.json
{
  "mcpServers": {
    "server-name": {
      // Server configuration
    }
  }
}

Server Types

Terragon supports three types of MCP servers:

1. Command-based Servers

Command-based servers run as local processes within your sandbox:

mcp-server.json
{
  "mcpServers": {
    "my-custom-server": {
      "command": "node",
      "args": ["/path/to/server.js"],
      "env": {
        "API_KEY": "your-api-key",
        "OTHER_CONFIG": "value"
      }
    }
  }
}
  • command (required): The executable command to run
  • args (optional): Array of command-line arguments
  • env (optional): Environment variables to pass to the server

2. HTTP-based Servers

HTTP-based servers connect to remote MCP endpoints using standard HTTP requests:

{
  "mcpServers": {
    "context7": {
      "type": "http",
      "url": "https://mcp.context7.com/mcp",
      "headers": {
        "Authorization": "Bearer your-token"
      }
    }
  }
}
  • type (required): Must be "http" for HTTP servers
  • url (required): The full URL of the MCP endpoint
  • headers (optional): HTTP headers to include with requests
  • env (optional): Environment variables for the server

3. SSE-based Servers

SSE (Server-Sent Events) servers connect to MCP endpoints that use server-sent events for real-time communication:

{
  "mcpServers": {
    "sse-server": {
      "type": "sse",
      "url": "https://example.com/mcp-sse",
      "headers": {
        "Authorization": "Bearer your-token"
      }
    }
  }
}
  • type (required): Must be "sse" for SSE servers
  • url (required): The full URL of the SSE endpoint
  • headers (optional): HTTP headers to include with the connection
  • env (optional): Environment variables for the server

Multiple Servers

You can configure multiple MCP servers in a single configuration:

{
  "mcpServers": {
    "custom-tools": {
      "command": "python",
      "args": ["/home/user/mcp-server.py"]
    },
    "context7": {
      "type": "http",
      "url": "https://mcp.context7.com/mcp"
    },
    "sse-server": {
      "type": "sse",
      "url": "https://example.com/mcp-sse"
    },
    "another-server": {
      "command": "mcp-server",
      "env": {
        "CONFIG_PATH": "/etc/mcp/config.yaml"
      }
    }
  }
}

Finding MCP Servers

MCP servers can be found on the a variety of MCP server repositories. Here are some examples:

Sample MCP Servers

Here are some popular MCP servers you can use with Terragon:

  • Ref Tools - Pull in content from various sources
  • Notion MCP - Integrate with Notion workspaces
  • Figma MCP - Access Figma designs and resources