|
| 1 | +--- |
| 2 | +title: "MCP Introduction" |
| 3 | +sidebarTitle: "Introduction" |
| 4 | +description: "Learn how to install and configure the Trigger.dev MCP Server" |
| 5 | +tag: "new" |
| 6 | +--- |
| 7 | + |
| 8 | +## What is the Trigger.dev MCP Server? |
| 9 | + |
| 10 | +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: |
| 11 | + |
| 12 | +- Search Trigger.dev documentation |
| 13 | +- Initialize new Trigger.dev projects |
| 14 | +- List and manage your projects and organizations |
| 15 | +- Get task information and trigger task runs |
| 16 | +- Deploy projects to different environments |
| 17 | +- Monitor run details and list runs with filtering options |
| 18 | + |
| 19 | +## Installation |
| 20 | + |
| 21 | +### Automatic Installation (Recommended) |
| 22 | + |
| 23 | +The easiest way to install the Trigger.dev MCP Server is using the interactive installation wizard: |
| 24 | + |
| 25 | +```bash |
| 26 | +npx trigger.dev@latest install-mcp |
| 27 | +``` |
| 28 | + |
| 29 | +This command will guide you through: |
| 30 | + |
| 31 | +1. Selecting which MCP clients to configure |
| 32 | +2. Choosing installation scope (user, project, or local) |
| 33 | +3. Automatically configuring the selected clients |
| 34 | + |
| 35 | +## Command Line Options |
| 36 | + |
| 37 | +The `install-mcp` command supports the following options: |
| 38 | + |
| 39 | +### Core Options |
| 40 | + |
| 41 | +- `-p, --project-ref <project ref>` - Scope the MCP server to a specific Trigger.dev project by providing its project ref |
| 42 | +- `-t, --tag <package tag>` - The version of the trigger.dev CLI package to use for the MCP server (default: latest or v4-beta) |
| 43 | +- `--dev-only` - Restrict the MCP server to the dev environment only |
| 44 | +- `--yolo` - Install the MCP server into all supported clients automatically |
| 45 | +- `--scope <scope>` - Choose the scope of the MCP server: `user`, `project`, or `local` |
| 46 | +- `--client <clients...>` - Choose specific client(s) to install into |
| 47 | + |
| 48 | +### Configuration Options |
| 49 | + |
| 50 | +- `--log-file <log file>` - Configure the MCP server to write logs to a file |
| 51 | +- `-a, --api-url <value>` - Configure a custom Trigger.dev API URL |
| 52 | +- `-l, --log-level <level>` - Set CLI log level (debug, info, log, warn, error, none) |
| 53 | + |
| 54 | +## Authentication |
| 55 | + |
| 56 | +You can use the MCP server without authentication with the `search_docs` tool, but for any other tool call you will need to authenticate the MCP server via the same method as the [Trigger.dev CLI](/cli-login-commands).The first time you attempt to use a tool that requires authentication, you will be prompted to authenticate the MCP server via the MCP client. |
| 57 | + |
| 58 | +### Examples |
| 59 | + |
| 60 | +Install for all supported clients: |
| 61 | + |
| 62 | +```bash |
| 63 | +npx trigger.dev@latest install-mcp --yolo |
| 64 | +``` |
| 65 | + |
| 66 | +Install for specific clients: |
| 67 | + |
| 68 | +```bash |
| 69 | +npx trigger.dev@latest install-mcp --client claude-code cursor --scope user |
| 70 | +``` |
| 71 | + |
| 72 | +Install with development environment restriction: |
| 73 | + |
| 74 | +```bash |
| 75 | +npx trigger.dev@latest install-mcp --dev-only --project-ref proj_abc123 |
| 76 | +``` |
| 77 | + |
| 78 | +## Supported MCP Clients |
| 79 | + |
| 80 | +The Trigger.dev MCP Server supports the following clients: |
| 81 | + |
| 82 | +| Client | Scope Options | Configuration File | Documentation | |
| 83 | +| -------------------- | -------------------- | --------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | |
| 84 | +| **Claude Code** | user, project, local | `~/.claude.json` or `./.mcp.json` (project/local scope) | [Claude Code MCP Docs](https://docs.anthropic.com/en/docs/claude-code/mcp) | |
| 85 | +| **Cursor** | user, project | `~/.cursor/mcp.json` (user) or `./.cursor/mcp.json` (project) | [Cursor MCP Docs](https://docs.cursor.com/features/mcp) | |
| 86 | +| **VSCode** | user, project | `~/Library/Application Support/Code/User/mcp.json` (user) or `./.vscode/mcp.json` (project) | [VSCode MCP Docs](https://code.visualstudio.com/docs/copilot/chat/mcp-servers) | |
| 87 | +| **Zed** | user | `~/.config/zed/settings.json` | [Zed Context Servers Docs](https://zed.dev/docs/context-servers) | |
| 88 | +| **Windsurf** | user | `~/.codeium/windsurf/mcp_config.json` | [Windsurf MCP Docs](https://docs.codeium.com/windsurf/mcp) | |
| 89 | +| **Gemini CLI** | user, project | `~/.gemini/settings.json` (user) or `./.gemini/settings.json` (project) | [Gemini CLI MCP Tutorial](https://medium.com/@joe.njenga/gemini-cli-mcp-tutorial-setup-commands-practical-use-step-by-step-example-b57f55db5f4a) | |
| 90 | +| **Charm Crush** | user, project, local | `~/.config/crush/crush.json` (user), `./crush.json` (project), or `./.crush.json` (local) | [Charm MCP Docs](https://github.com/charmbracelet/mcp) | |
| 91 | +| **Cline** | user | `~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json` | [Cline MCP Docs](https://github.com/saoudrizwan/claude-dev#mcp) | |
| 92 | +| **OpenAI Codex CLI** | user | `~/.codex/config.toml` | See OpenAI Codex CLI documentation for MCP configuration | |
| 93 | +| **Sourcegraph AMP** | user | `~/.config/amp/settings.json` | [Sourcegraph AMP MCP Docs](https://docs.sourcegraph.com/amp/mcp) | |
| 94 | +| **opencode** | user, project | `~/.config/opencode/opencode.json` (user) or `./opencode.json` (project) | [opencode MCP Docs](https://opencode.ai/docs/mcp-servers/) | |
| 95 | + |
| 96 | +## Manual Configuration |
| 97 | + |
| 98 | +If your client isn't directly supported by the installer, you can configure it manually. The MCP server uses the following configuration: |
| 99 | + |
| 100 | +**Server Name:** `trigger` |
| 101 | + |
| 102 | +**Command:** `npx` |
| 103 | + |
| 104 | +**Arguments:** `["trigger.dev@latest", "mcp"]` |
| 105 | + |
| 106 | +### Example JSON Configuration |
| 107 | + |
| 108 | +```json |
| 109 | +{ |
| 110 | + "mcpServers": { |
| 111 | + "trigger": { |
| 112 | + "command": "npx", |
| 113 | + "args": ["trigger.dev@latest", "mcp"] |
| 114 | + } |
| 115 | + } |
| 116 | +} |
| 117 | +``` |
| 118 | + |
| 119 | +### Example TOML Configuration (for Codex CLI) |
| 120 | + |
| 121 | +```toml |
| 122 | +[mcp_servers.trigger] |
| 123 | +command = "npx" |
| 124 | +args = ["trigger.dev@latest", "mcp"] |
| 125 | +``` |
| 126 | + |
| 127 | +### Additional Options |
| 128 | + |
| 129 | +You can add these optional arguments to customize the server behavior: |
| 130 | + |
| 131 | +- `--log-file <path>` - Log to a specific file |
| 132 | +- `--api-url <url>` - Use a custom Trigger.dev API URL |
| 133 | +- `--dev-only` - Restrict to dev environment only |
| 134 | +- `--project-ref <ref>` - Scope to a specific project |
| 135 | + |
| 136 | +## Environment-Specific Configuration |
| 137 | + |
| 138 | +### Development Only |
| 139 | + |
| 140 | +To restrict the MCP server to only work with the development environment: |
| 141 | + |
| 142 | +```json |
| 143 | +{ |
| 144 | + "mcpServers": { |
| 145 | + "trigger": { |
| 146 | + "command": "npx", |
| 147 | + "args": ["trigger.dev@latest", "mcp", "--dev-only"] |
| 148 | + } |
| 149 | + } |
| 150 | +} |
| 151 | +``` |
| 152 | + |
| 153 | +### Project-Scoped |
| 154 | + |
| 155 | +To scope the server to a specific project: |
| 156 | + |
| 157 | +```json |
| 158 | +{ |
| 159 | + "mcpServers": { |
| 160 | + "trigger": { |
| 161 | + "command": "npx", |
| 162 | + "args": ["trigger.dev@latest", "mcp", "--project-ref", "proj_your_project_ref"] |
| 163 | + } |
| 164 | + } |
| 165 | +} |
| 166 | +``` |
| 167 | + |
| 168 | +## Verification |
| 169 | + |
| 170 | +After installation, restart your MCP client and look for a server named "trigger". The server should connect automatically and provide access to all Trigger.dev tools. |
| 171 | + |
| 172 | +## Getting Started |
| 173 | + |
| 174 | +Once installed, you can start using the MCP server by asking your AI assistant questions like: |
| 175 | + |
| 176 | +- `"Search the trigger docs for a ffmpeg example"` |
| 177 | +- `"Initialize trigger.dev in my project"` |
| 178 | +- `"Get all tasks in my project"` |
| 179 | +- `"Trigger my foobar task with a sample payload"` |
| 180 | +- `"Get the details of the latest run for my foobar task"` |
| 181 | +- `"List all runs for my foobar task"` |
| 182 | +- `"Deploy my project to staging"` |
| 183 | +- `"Deploy my project to production"` |
| 184 | + |
| 185 | +## Next Steps |
| 186 | + |
| 187 | +- [Explore available MCP tools](/mcp-tools) |
0 commit comments