Set up Trigger.dev with your AI agent

Copy a project-aware prompt that connects your coding agent to Trigger.dev's MCP server, with a CLI fallback and live setup progress.

Eric Allam

Eric Allam

CTO, Trigger.dev

New projects now lead with a Copy AI agent prompt button. It gives Claude Code, Cursor, or any coding agent the project context and Trigger.dev conventions needed to go from an empty codebase to a registered task.

Setup with MCP

The prompt is generated for the current project, including its project reference and, for self-hosted installations, the API URL. With the Trigger.dev MCP server available, the agent calls initialize_project. The tool detects an existing trigger.config.ts, creates a project only when needed, and returns instructions for the correct development environment.

From there, the agent can keep the whole feedback loop in one conversation:

  • Start trigger dev in the background and read its status and logs.
  • Inspect registered tasks and their payload schemas.
  • Trigger a test run, then examine its trace and individual spans. AI spans include model, token, cost, and response data.
  • Search the Trigger.dev docs while it edits your code.

The result is a working task verified in the dashboard, not just a few generated files.

Works without MCP too

Coding agents without MCP get a complete CLI and manual setup path. The prompt tells them to:

  • Run npx trigger.dev@latest init.
  • Install @trigger.dev/sdk and @trigger.dev/build, write trigger.config.ts, and scaffold an exported task under src/trigger/.
  • Update tsconfig.json and .gitignore, then start the dev server and confirm the task appears.

It also includes the rules that keep generated tasks correct: import from @trigger.dev/sdk, export every task, use the built-in fetch, and never wrap wait.* or triggerAndWait in Promise.all.

Browser login and the development secret key still require you. The prompt tells the agent to stop at those points, ask for what it needs, and then continue.

Beyond setup

The MCP server stays useful after the first task is running. Ask your agent to filter runs, explain a failure from its trace, deploy, inspect preview branches, or query runs, infrastructure metrics, and LLM usage with TRQL. Built-in dashboards and health reports answer questions like "Are runs healthy?" or "Which tasks cost the most this week?" from your editor.

For tighter guardrails, --dev-only blocks access outside development, while --readonly hides write tools such as deploy, trigger, and cancel.

Live progress

The checklist tracks real setup state. Running trigger init completes the first step, then the page updates automatically when your dev server connects and its first task registers.

Open a project's dev environment and click Copy AI agent prompt. For the full workflow, install the MCP server with:


npx trigger.dev@latest install-mcp

Or follow the manual setup guide yourself.

Ready to start building?

Build and deploy your first task in 3 minutes.

Get started now