MCP Introduction
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
This page covers the CLI MCP server, which runs locally and can deploy and run your dev server.
Installation
The quickest way to get set up is the interactive installer:
npx trigger.dev@latest install-mcppnpm dlx trigger.dev@latest install-mcpyarn dlx trigger.dev@latest install-mcpbunx trigger.dev@latest install-mcpIt 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:
npx trigger.dev@latest install-mcp --client claude-codepnpm dlx trigger.dev@latest install-mcp --client claude-codeyarn dlx trigger.dev@latest install-mcp --client claude-codebunx trigger.dev@latest install-mcp --client claude-codeOr add this configuration to ~/.claude.json (user) or .mcp.json (project):
{
"mcpServers": {
"trigger": {
"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, and so do the local-only tools list_profiles, dev_server_status and stop_dev_server. All other tools require you to be logged in via the Trigger.dev CLI. The first time you use an authenticated tool, your MCP client prompts you to log in.
A login stops working after 7 days without use. The next authenticated tool call starts the login flow again. If your client supports confirmation prompts, it asks first. Then the browser opens, and the call continues once you approve. See CLI login expiry.
The install-mcp command supports these options:
Core Options
-p, --project-ref <project ref>— Scope the MCP server to a specific project-t, --tag <package tag>— CLI package version to use (default: latest)--dev-only— Restrict to the dev environment only--yolo— Install into all supported clients automatically--scope <scope>—user,project, orlocal--client <clients...>— Install into specific client(s)
Configuration Options
--log-file <log file>— Write logs to a file-a, --api-url <value>— Custom Trigger.dev API URL-l, --log-level <level>— Log level (debug, info, log, warn, error, none)
Examples
Install for all supported clients:
npx trigger.dev@latest install-mcp --yolopnpm dlx trigger.dev@latest install-mcp --yoloyarn dlx trigger.dev@latest install-mcp --yolobunx trigger.dev@latest install-mcp --yoloInstall for specific clients:
npx trigger.dev@latest install-mcp --client claude-code cursor --scope userpnpm dlx trigger.dev@latest install-mcp --client claude-code cursor --scope useryarn dlx trigger.dev@latest install-mcp --client claude-code cursor --scope userbunx trigger.dev@latest install-mcp --client claude-code cursor --scope userRestrict to dev environment for a specific project:
npx trigger.dev@latest install-mcp --dev-only --project-ref proj_abc123pnpm dlx trigger.dev@latest install-mcp --dev-only --project-ref proj_abc123yarn dlx trigger.dev@latest install-mcp --dev-only --project-ref proj_abc123bunx trigger.dev@latest install-mcp --dev-only --project-ref proj_abc123To add these options to a manual config, append them to the args array:
{
"args": ["trigger.dev@latest", "mcp", "--dev-only", "--project-ref", "proj_abc123"]
}The mcp command also accepts --readonly, which hides the tools that write to your account (for example deploy, trigger_task and cancel_run) so the AI cannot make changes to it. It is only available as a manual config arg:
{
"args": ["trigger.dev@latest", "mcp", "--readonly"]
}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
Was this page helpful?
Last updated
Edit on GitHub