# Trigger.dev MCP for AI Agents AI Agent Connect

> Trigger.dev MCP gives your AI agent direct access to your background job infrastructure. You can check job statuses, inspect failed runs, and manage environments without leaving your editor. It turns your AI into a production-ready DevOps assistant for monitoring and debugging task queues.

## Overview
- **Category:** ship-it
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_E3D1PSFbED6190OhQ3gSMc4dXdMknoYFUrVm1Mgk/ai-agent-connect
- **Tags:** background-jobs, workflow-automation, event-driven, task-scheduling, observability, typescript

## Description

Trigger.dev MCP lets you manage your background job infrastructure conversationally. Managing background jobs usually means constant tab-switching between your code and a dashboard. When a job fails in production, you're hunting through logs and retry histories to find the culprit. This connection changes that by letting your AI agent do the heavy lifting for you. You can ask your agent to find every failed task from the last hour, see the exact payload that caused a crash, or check if a specific cron schedule is active. It's about moving from searching for information to getting answers. By connecting Trigger.dev to Vinkius, you're giving your agent a way to navigate your project's environments and execution history conversationally. Instead of digging through a UI, you just tell your agent what's wrong, and it pulls the logs, shows you the error, and lets you replay the run to see if you fixed it.

## Tools

### list_projects
Get a list of all projects associated with your account.

### list_runs
See a list of all task runs including their current status and execution time.

### get_run
Pull the full details of a specific run, including logs and retry history.

### trigger_task
Start a new background task manually to test a specific workflow.

### cancel_run
Stop a running task immediately if it's stuck or needs to be interrupted.

### replay_run
Replay a completed task to test your fixes with the original data.

### list_schedules
View all cron schedules to see how your tasks are currently timed.

### list_environments
See all deployment environments like dev, staging, and production.

## Prompt Examples

**Prompt:** 
```
Any failed jobs in production today?
```

**Response:** 
```
I found 3 failed runs in the last 24 hours:

| Task Name | Error Type | Retries |
| :--- | :--- | :--- |
| **sync-data** | Timeout | 3/3 |
| **send-email** | Auth Error | 1/3 |
| **image-resize** | Memory Limit | 0/3 |

Would you like to see the logs for any of these?
```

**Prompt:** 
```
Show me why the last 'process-order' run failed.
```

**Response:** 
```
**Run ID:** run_9921
**Status:** FAILED
**Error:** `Database connection refused` at step 3.
**Payload:** `{'order_id': 'abc', 'amount': 50.00}`
**Retries:** 3/3 exhausted.
```

**Prompt:** 
```
List all my active cron schedules.
```

**Response:** 
```
You have 4 active schedules:

- `daily-cleanup`: Every day at 02:00
- `hourly-sync`: Every hour
- `weekly-report`: Every Monday at 08:00
- `realtime-webhook`: Every 30 seconds
```

## Capabilities

### View failed job history
Get a quick list of every task that didn't finish with status details.

### Inspect run payloads
See the exact data that went into a specific task execution to find bugs.

### Switch project environments
Query data across dev, staging, and production environments in one place.

### Replay completed tasks
Run a finished job again with the original input to test your latest code fixes.

### Stop active runs
Cancel a running task immediately if it's stuck or behaving badly.

## Use Cases

### Debugging a failed production webhook
A production webhook failed. I asked my agent to find all failed runs in the last hour and show the error logs for the 'process-webhook' task.

### Testing a fix for a data sync
I need to test a fix for a data sync. I asked my agent to replay the last successful 'sync-inventory' run to see if the new logic works.

### Checking environment status
Checking environment status. I asked my agent to list all projects and show the status of the 'cleanup' job in the staging environment.

### Manual task triggering
Manual trigger. I asked my agent to trigger a 'generate-report' task for a specific user ID to see if the email goes out.

## Benefits

- Stop dashboard hopping by using list_runs and get_run to see task history directly in your chat.
- Debug faster by using get_run to see the exact payload and error logs that caused a failure.
- Test your fixes instantly with replay_run to see if a change actually works with old data.
- Manage multiple environments easily using list_environments to check staging vs production.
- Control your queue with cancel_run and trigger_task to manage live task execution.
- Keep track of your automation with list_schedules to ensure all cron jobs are running as expected.

## How It Works

The bottom line is you get a conversational way to manage and debug your background infrastructure without ever opening a dashboard.

1. Subscribe to the Trigger.dev integration on Vinkius.
2. Get a secret API key starting with tr_dev_ or tr_prod_ from your Trigger.dev dashboard.
3. Provide the key to your AI client and start asking about your job runs.

## Frequently Asked Questions

**Can I use Trigger.dev MCP to see why my background tasks are failing?**
Yes. The Connector lets your agent pull specific error logs and retry histories for any failed run, making it easy to spot bugs in your background logic.

**Does the Trigger.dev MCP work for production environments?**
It does. You can use it to monitor production job health, check success rates, and inspect live runs across your entire deployment pipeline.

**How does the Trigger.dev MCP help with debugging?**
It allows your agent to retrieve the exact input payload and output logs for specific runs. You can see exactly what data caused a crash without manual searching.

**Can I use Trigger.dev MCP to restart a job?**
You can use it to replay a completed task. This is great for testing a code fix against the exact same data that caused the original failure.

**Does Trigger.dev MCP let me see my different projects?**
Yes, your agent can list all projects and environments associated with your Trigger.dev account, giving you a bird's-eye view of your infrastructure.

**Can I stop a running job using the Trigger.dev MCP?**
Yes, your agent can cancel a running task immediately if you notice it's stuck or behaving unexpectedly in your production queue.

**How do I get my Trigger.dev API key?**
Log in to your Trigger.dev dashboard at **cloud.trigger.dev**. Open your project, then find the **API Keys** section in the project settings. Copy your **Secret API Key** (it starts with `tr_dev_` for development or `tr_prod_` for production). Paste it into the configuration field below. For Personal Access Tokens (used for admin operations), go to **Profile → Personal Access Tokens** tab instead.

**Can my AI agent tell me why a background job failed in production?**
Yes. Ask your agent to list failed runs and it returns the task name, error message, stack trace, execution duration, and retry count for each failure. You can then drill into a specific run to see the exact input payload and which step failed — cutting your debugging time from minutes to seconds.

**What if I'm on-call and need to check job health at 2 AM?**
Just ask your AI agent 'Are there any failed jobs in production?' and get an instant triage report — number of failures, which tasks are affected, when they started failing, and whether retries resolved them. No need to open a browser, log in, or navigate dashboards in the middle of the night.

**Does it support multiple environments like dev, staging, and production?**
Yes. Each API key is scoped to a specific environment (dev or prod), just like in Trigger.dev itself. You can configure separate integrations for each environment, or switch between them by updating the API key — giving you full control over which environment your AI agent queries.