Skip to main content

tollgate init

Creates a tollgate.yaml configuration file with example settings or using an interactive wizard.

Usage

dotset tollgate init [options]

Options

OptionDescriptionDefault
-o, --output <path>Output path for config file./tollgate.yaml
-i, --interactiveUse interactive wizard to configure-
-f, --forceOverwrite existing file-

Examples

Basic Usage

# Create default config in current directory
dotset tollgate init

# Create config at custom path
dotset tollgate init -o ~/configs/tollgate.yaml

# Overwrite existing config
dotset tollgate init -f

Interactive Wizard

# Launch interactive configuration wizard
dotset tollgate init -i
The interactive wizard guides you through:
  1. Selecting MCP servers (PostgreSQL, Filesystem, GitHub, etc.)
  2. Choosing policy presets (strict, balanced, permissive)
  3. Configuring environment variables
  4. Setting default actions

Generated Configuration

The default configuration includes examples for common MCP servers:
# Tollgate Configuration
# https://github.com/dotsetlabs/tollgate

version: "1"

# Default action when no policy matches
defaults:
  action: prompt  # allow | deny | prompt
  timeout: 60000  # Approval timeout in ms

# MCP Server configurations
servers:
  # PostgreSQL database server
  postgres:
    command: "npx"
    args: ["-y", "@modelcontextprotocol/server-postgres"]
    env:
      DATABASE_URL: "${DATABASE_URL}"
    tools:
      # Allow read-only queries
      "query":
        action: allow
      # Prompt for write operations
      "execute":
        action: prompt
        message: "Agent wants to execute SQL"
      # Block everything else
      "*":
        action: deny

  # Filesystem server
  filesystem:
    command: "npx"
    args: ["-y", "@anthropic/mcp-server-filesystem", "./"]
    tools:
      # Allow all read operations
      "read_*":
        action: allow
      "list_*":
        action: allow
      # Prompt for writes
      "write_*":
        action: prompt
      "create_*":
        action: prompt
      # Block deletes
      "delete_*":
        action: deny
        reason: "File deletion is disabled for safety"

Next Steps

After creating your config:
  1. Validate it:
    dotset tollgate validate
    
  2. Start the proxy:
    dotset tollgate start -s postgres
    
  3. Configure your MCP client to use Tollgate instead of the direct server connection.