--- title: "MCP Introduction" sidebarTitle: "Introduction" description: "Learn how to install and configure the Trigger.dev MCP Server" --- ## What is the Trigger.dev MCP Server? The Trigger.dev MCP (Model Context Protocol) Server enables AI assistants to interact directly with your Trigger.dev projects. It provides a comprehensive set of tools to: - Search Trigger.dev documentation - Initialize new Trigger.dev projects - List and manage your projects and organizations - Get task information and trigger task runs - Deploy projects to different environments - Monitor run details and list runs with filtering options - Query your data with TRQL and run built-in dashboard metrics ## Installation The quickest way to get set up is the interactive installer: ```bash npx trigger.dev@latest install-mcp ``` It will detect your installed clients and configure them automatically. You can also copy-paste the config for your client below. ## Client Configuration Each client has a slightly different config format. Copy the snippet for your client into the appropriate file. Install using the command line: ```bash npx trigger.dev@latest install-mcp --client claude-code ``` Or add this configuration to `~/.claude.json` (user) or `.mcp.json` (project): ```json { "mcpServers": { "trigger": { "command": "npx", "args": ["trigger.dev@latest", "mcp"] } } } ``` [View Claude Code MCP docs ↗](https://code.claude.com/docs/en/mcp) Install using the command line: ```bash npx trigger.dev@latest install-mcp --client cursor ``` Or add this configuration to `~/.cursor/mcp.json` (user) or `.cursor/mcp.json` (project): ```json { "mcpServers": { "trigger": { "command": "npx", "args": ["trigger.dev@latest", "mcp"] } } } ``` [View Cursor MCP docs ↗](https://cursor.com/docs/context/mcp) Install using the command line: ```bash npx trigger.dev@latest install-mcp --client windsurf ``` Or add this configuration to `~/.codeium/windsurf/mcp_config.json`: ```json { "mcpServers": { "trigger": { "command": "npx", "args": ["trigger.dev@latest", "mcp"] } } } ``` [View Windsurf MCP docs ↗](https://docs.windsurf.com/windsurf/cascade/mcp) Install using the command line: ```bash npx trigger.dev@latest install-mcp --client vscode ``` Or add this configuration to `.vscode/mcp.json` (project) or `~/Library/Application Support/Code/User/mcp.json` (user, macOS): ```json { "servers": { "trigger": { "command": "npx", "args": ["trigger.dev@latest", "mcp"] } } } ``` VS Code uses `servers` instead of `mcpServers`. [View VS Code MCP docs ↗](https://code.visualstudio.com/docs/copilot/chat/mcp-servers) Install using the command line: ```bash npx trigger.dev@latest install-mcp --client zed ``` Or add this configuration to `~/.config/zed/settings.json`: ```json { "context_servers": { "trigger": { "source": "custom", "command": "npx", "args": ["trigger.dev@latest", "mcp"] } } } ``` [View Zed context servers docs ↗](https://zed.dev/docs/ai/mcp) Install using the command line: ```bash npx trigger.dev@latest install-mcp --client cline ``` Or add this configuration to `~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json`: ```json { "mcpServers": { "trigger": { "command": "npx", "args": ["trigger.dev@latest", "mcp"] } } } ``` [View Cline MCP docs ↗](https://docs.cline.bot/mcp/configuring-mcp-servers) Install using the command line: ```bash npx trigger.dev@latest install-mcp --client gemini-cli ``` Or add this configuration to `~/.gemini/settings.json` (user) or `.gemini/settings.json` (project): ```json { "mcpServers": { "trigger": { "command": "npx", "args": ["trigger.dev@latest", "mcp"] } } } ``` Install using the command line: ```bash npx trigger.dev@latest install-mcp --client amp ``` Or add this configuration to `~/.config/amp/settings.json`: ```json { "amp.mcpServers": { "trigger": { "command": "npx", "args": ["trigger.dev@latest", "mcp"] } } } ``` [View Sourcegraph AMP MCP docs ↗](https://ampcode.com/manual#mcp) Install using the command line: ```bash npx trigger.dev@latest install-mcp --client openai-codex ``` Or add this configuration to `~/.codex/config.toml`: ```toml [mcp_servers.trigger] command = "npx" args = ["trigger.dev@latest", "mcp"] startup_timeout_sec = 30 ``` The `startup_timeout_sec = 30` is recommended. Codex defaults to 10 seconds, which may not be enough for `npx` to download the package on first run. Install using the command line: ```bash npx trigger.dev@latest install-mcp --client crush ``` Or add this configuration to `.crush.json` (project), `crush.json`, or `~/.config/crush/crush.json` (user). Files are loaded in priority order: `.crush.json` → `crush.json` → `$HOME/.config/crush/crush.json`. ```json { "mcp": { "trigger": { "type": "stdio", "command": "npx", "args": ["trigger.dev@latest", "mcp"] } } } ``` [View Charm MCP docs ↗](https://github.com/charmbracelet/crush) Install using the command line: ```bash npx trigger.dev@latest install-mcp --client opencode ``` Or add this configuration to `~/.config/opencode/opencode.json` (user) or `./opencode.json` (project): ```json { "mcp": { "trigger": { "type": "local", "command": ["npx", "trigger.dev@latest", "mcp"], "enabled": true } } } ``` [View opencode MCP docs ↗](https://opencode.ai/docs/mcp-servers/) Install using the command line: ```bash npx trigger.dev@latest install-mcp --client ruler ``` Or add this configuration to `.ruler/mcp.json`: ```json { "mcpServers": { "trigger": { "type": "stdio", "command": "npx", "args": ["trigger.dev@latest", "mcp"] } } } ``` After adding the config, restart your client. You should see a server named **trigger** connect automatically. ## Authentication The `search_docs` tool works without authentication. All other tools require you to be logged in via the [Trigger.dev CLI](/cli-login-commands). The first time you use an authenticated tool, your MCP client will prompt you to log in. The `install-mcp` command supports these options: **Core Options** - `-p, --project-ref ` — Scope the MCP server to a specific project - `-t, --tag ` — CLI package version to use (default: latest) - `--dev-only` — Restrict to the dev environment only - `--readonly` — Read-only mode. Hides write tools (`deploy`, `trigger_task`, `cancel_run`) so the AI cannot make changes to your account - `--yolo` — Install into all supported clients automatically - `--scope ` — `user`, `project`, or `local` - `--client ` — Install into specific client(s) **Configuration Options** - `--log-file ` — Write logs to a file - `-a, --api-url ` — Custom Trigger.dev API URL - `-l, --log-level ` — Log level (debug, info, log, warn, error, none) **Examples** Install for all supported clients: ```bash npx trigger.dev@latest install-mcp --yolo ``` Install for specific clients: ```bash npx trigger.dev@latest install-mcp --client claude-code cursor --scope user ``` Restrict to dev environment for a specific project: ```bash npx trigger.dev@latest install-mcp --dev-only --project-ref proj_abc123 ``` Read-only mode (prevents AI from deploying or triggering tasks): ```bash npx trigger.dev@latest install-mcp --readonly ``` To add these options to a manual config, append them to the `args` array: ```json { "args": ["trigger.dev@latest", "mcp", "--dev-only", "--project-ref", "proj_abc123"] } ``` ## Getting Started Once installed, you can start using the MCP server by asking your AI assistant questions like: - `"Search the trigger docs for a ffmpeg example"` - `"Initialize trigger.dev in my project"` - `"Get all tasks in my project"` - `"Trigger my foobar task with a sample payload"` - `"Get the details of the latest run for my foobar task"` - `"List all runs for my foobar task"` - `"Deploy my project to staging"` - `"Deploy my project to production"` - `"How many runs failed in the last 7 days?"` - `"Show me the overview dashboard metrics"` - `"What tables can I query?"` ## Next Steps Explore all available MCP tools for managing your projects. Portable instruction sets that teach AI assistants Trigger.dev patterns.