TrigRun
Agent Integration

Product MCP Server

Connect AI agents to TrigRun via the Model Context Protocol — create jobs, check executions, and manage secrets through tool calls.

TrigRun's MCP server lets AI agents manage scheduled jobs, inspect executions, configure notifications, and handle secrets — all through natural language or direct tool calls.

Quick start

Step 1 — Get an API token

Log in to trigrun.com, open API Keys, and create a token. Copy the value right away because the full token is only shown once. It starts with cron_pat_, and you'll pass it as the token argument in every tool call.

Create a token from the API Keys screen before connecting MCP

If you need a step-by-step walkthrough, see the Authentication guide.

Step 2 — Add the MCP server

TrigRun exposes a hosted Streamable HTTP MCP endpoint:

https://api.trigrun.com/mcp

Point any Streamable HTTP MCP client at that URL.

Cursor or any remote Streamable HTTP client:

Example configuration
{
  "mcpServers": {
    "trigrun": {
      "url": "https://api.trigrun.com/mcp"
    }
  }
}

If your client asks for a transport, choose Streamable HTTP.

Step 3 — Verify it works

Ask your agent:

List my TrigRun jobs using token cron_pat_your_token_here.

The agent will call list_jobs and show your existing jobs (or an empty list if you're new).


Authentication

Every tool requires a token argument. Use an API token for long-lived agent access:

{
  "tool": "list_jobs",
  "arguments": {
    "token": "cron_pat_abc123..."
  }
}

You can also pass a short-lived JWT from POST /v1/auth/login if you prefer session-based auth.


Available tools

Jobs

list_jobs

List all scheduled jobs in your workspace. Optionally filter by state.

ArgumentTypeRequiredDescription
tokenstringYesAPI token or JWT
statestringNoFilter: active, paused, draft, or completed
Example — list active jobs
{
  "tool": "list_jobs",
  "arguments": {
    "token": "cron_pat_abc123...",
    "state": "active"
  }
}

get_job

Get full details of a specific job by ID.

ArgumentTypeRequiredDescription
tokenstringYesAPI token or JWT
job_idstringYesJob ID
Example
{
  "tool": "get_job",
  "arguments": {
    "token": "cron_pat_abc123...",
    "job_id": "clx9abc123def"
  }
}

create_job

Create a new scheduled HTTP job. Supports the schedule kinds exposed by the CLI and dashboard.

ArgumentTypeRequiredDescription
tokenstringYesAPI token or JWT
namestringYesJob name
urlstringYesTarget URL to call
kindstringNoone_time, cron, recurring, or scheduled (default one_time)
methodstringNoHTTP method (default GET)
cronstringNoCron expression — required when kind is cron
every_n_minutesnumberNoInterval — required when kind is recurring
headersobjectNoKey/value HTTP headers
bodystringNoRequest body string

TrigRun evaluates cron expressions in UTC. Agents should convert local wall-clock schedules to UTC before creating jobs.

Example — cron job every hour
{
  "tool": "create_job",
  "arguments": {
    "token": "cron_pat_abc123...",
    "name": "hourly-sync",
    "url": "https://api.example.com/sync",
    "method": "POST",
    "kind": "cron",
    "cron": "0 * * * *",
    "headers": { "X-Source": "trigrun" }
  }
}
Example — recurring every 5 minutes
{
  "tool": "create_job",
  "arguments": {
    "token": "cron_pat_abc123...",
    "name": "health-check",
    "url": "https://api.example.com/health",
    "kind": "recurring",
    "every_n_minutes": 5
  }
}

pause_job

Pause a running job. It will stop firing until resumed.

ArgumentTypeRequiredDescription
tokenstringYesAPI token or JWT
job_idstringYesJob ID

resume_job

Resume a paused job. TrigRun recomputes the next run time from now.

ArgumentTypeRequiredDescription
tokenstringYesAPI token or JWT
job_idstringYesJob ID

run_job

Trigger immediate execution of a job, regardless of its schedule.

ArgumentTypeRequiredDescription
tokenstringYesAPI token or JWT
job_idstringYesJob ID
Example
{
  "tool": "run_job",
  "arguments": {
    "token": "cron_pat_abc123...",
    "job_id": "clx9abc123def"
  }
}

delete_job

Permanently delete a job and its execution history.

ArgumentTypeRequiredDescription
tokenstringYesAPI token or JWT
job_idstringYesJob ID

Executions

list_executions

List executions. Optionally filter to a specific job.

ArgumentTypeRequiredDescription
tokenstringYesAPI token or JWT
job_idstringNoFilter to executions for this job
Example — all executions for a job
{
  "tool": "list_executions",
  "arguments": {
    "token": "cron_pat_abc123...",
    "job_id": "clx9abc123def"
  }
}

get_execution

Get full details for an execution, including all retry attempts and the final response.

ArgumentTypeRequiredDescription
tokenstringYesAPI token or JWT
execution_idstringYesExecution ID
Example
{
  "tool": "get_execution",
  "arguments": {
    "token": "cron_pat_abc123...",
    "execution_id": "clx9exec456ghi"
  }
}

replay_execution

Re-queue a specific execution. Useful for recovering failed runs without waiting for the next scheduled fire.

ArgumentTypeRequiredDescription
tokenstringYesAPI token or JWT
execution_idstringYesExecution ID

Notification channels

list_channels

List all notification channels in your workspace.

ArgumentTypeRequiredDescription
tokenstringYesAPI token or JWT

create_channel

Create a notification channel. Supported types: webhook, email, slack, discord.

ArgumentTypeRequiredDescription
tokenstringYesAPI token or JWT
namestringYesChannel name
typestringYeswebhook, email, slack, or discord
urlstringNoURL for webhook/slack/discord
emailstringNoEmail address for email channels
secretstringNoSigning secret for webhook channels
Example — Slack channel
{
  "tool": "create_channel",
  "arguments": {
    "token": "cron_pat_abc123...",
    "name": "ops-alerts",
    "type": "slack",
    "url": "https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX"
  }
}

delete_channel

Delete a notification channel.

ArgumentTypeRequiredDescription
tokenstringYesAPI token or JWT
channel_idstringYesChannel ID

Notification rules

list_rules

List notification rules attached to a job.

ArgumentTypeRequiredDescription
tokenstringYesAPI token or JWT
job_idstringYesJob ID

add_rule

Attach a notification channel to a job event.

ArgumentTypeRequiredDescription
tokenstringYesAPI token or JWT
job_idstringYesJob ID
channel_idstringYesChannel ID
eventstringYeson_success, on_failure, or on_completion
Example — alert on failure
{
  "tool": "add_rule",
  "arguments": {
    "token": "cron_pat_abc123...",
    "job_id": "clx9abc123def",
    "channel_id": "clx9ch789jkl",
    "event": "on_failure"
  }
}

remove_rule

Remove a notification rule from a job.

ArgumentTypeRequiredDescription
tokenstringYesAPI token or JWT
job_idstringYesJob ID
rule_idstringYesRule ID

Secrets

list_secrets

List all secret names in your workspace. Values are never returned.

ArgumentTypeRequiredDescription
tokenstringYesAPI token or JWT

create_secret

Store an encrypted secret. Reference it in job headers with secret://name.

ArgumentTypeRequiredDescription
tokenstringYesAPI token or JWT
namestringYesSecret name
valuestringYesSecret value (encrypted at rest with AES-256-GCM)
Example
{
  "tool": "create_secret",
  "arguments": {
    "token": "cron_pat_abc123...",
    "name": "my-api-key",
    "value": "sk-live-abc123..."
  }
}

To use this secret in a job header:

{
  "headers": { "Authorization": "Bearer secret://my-api-key" }
}

delete_secret

Delete a secret permanently.

ArgumentTypeRequiredDescription
tokenstringYesAPI token or JWT
secret_idstringYesSecret ID

Notification deliveries

list_deliveries

List notification deliveries. Optionally filter by status.

ArgumentTypeRequiredDescription
tokenstringYesAPI token or JWT
statusstringNoFilter: sent, pending, or failed
limitnumberNoMax results (default 20)

retry_delivery

Retry a failed notification delivery.

ArgumentTypeRequiredDescription
tokenstringYesAPI token or JWT
delivery_idstringYesDelivery ID

Common workflows

Create a cron job with failure alerts

This is the most common setup: a regularly scheduled job with a Slack alert when it fails.

  1. Create a Slack channel:

    "Create a Slack notification channel named 'cron-alerts' with webhook URL https://hooks.slack.com/... using token cron_pat_..."

  2. Create the job:

    "Create a cron job named 'daily-report' that POSTs to https://api.example.com/report every day at 8 AM UTC using token cron_pat_..."

  3. Attach the alert:

    "Add a notification rule to job JOB_ID: send to channel CHANNEL_ID on_failure using token cron_pat_..."

The agent calls create_channel, create_job, then add_rule in sequence.


Check execution status

After a job fires, inspect what happened:

  1. List recent executions:

    "List executions for job JOB_ID using token cron_pat_..."

  2. Get details on a specific one:

    "Get execution EXEC_ID using token cron_pat_..."

    The response includes every retry attempt, HTTP status codes, latency, and the full response body.

  3. If it failed, check why: The get_execution result shows attempts with status, statusCode, and responseBody for each attempt.


Replay a failed execution

When an execution failed due to a transient error (timeout, 503), replay it without waiting for the next scheduled run:

  1. Find the failed execution:

    "List executions for job JOB_ID using token cron_pat_..."

  2. Replay it:

    "Replay execution EXEC_ID using token cron_pat_..."

    replay_execution re-queues the exact same request. TrigRun will apply the job's retry policy to the replay as well.


Store a secret and use it in a job

Avoid hardcoding API keys in job headers:

  1. Store the secret:

    "Create a secret named 'stripe-api-key' with value sk_live_... using token cron_pat_..."

  2. Create the job referencing the secret:

    "Create a job named 'process-payments' that POSTs to https://api.example.com/payments with header Authorization: Bearer secret://stripe-api-key, using token cron_pat_..."

    The worker resolves secret://stripe-api-key at execution time. The raw value is never stored in the job record.


Temporarily pause and resume a job

To disable a job without deleting it (e.g., during a maintenance window):

  1. Pause:

    "Pause job JOB_ID using token cron_pat_..."

  2. Resume when ready:

    "Resume job JOB_ID using token cron_pat_..."

    Resuming recomputes the next run from the current time — it won't backfill missed fires.


Tool reference summary

ToolCategoryWhat it does
list_jobsJobsList all jobs, filter by state
get_jobJobsGet job details by ID
create_jobJobsCreate a scheduled HTTP job
pause_jobJobsPause a running job
resume_jobJobsResume a paused job
run_jobJobsTrigger immediate execution
delete_jobJobsDelete a job permanently
list_executionsExecutionsList executions, optionally for a job
get_executionExecutionsGet execution details with all attempts
replay_executionExecutionsRe-queue a specific execution
list_channelsNotificationsList notification channels
create_channelNotificationsCreate webhook/email/slack/discord channel
delete_channelNotificationsDelete a channel
list_rulesNotificationsList rules for a job
add_ruleNotificationsAttach channel to job event
remove_ruleNotificationsRemove a notification rule
list_secretsSecretsList secret names (values hidden)
create_secretSecretsStore an encrypted secret
delete_secretSecretsDelete a secret
list_deliveriesDeliveriesList notification deliveries
retry_deliveryDeliveriesRetry a failed delivery