Use cases · Codex

Sentry and Codex: add the MCP server and triage errors on a schedule

Codex connects to Sentry's hosted MCP server directly over streamable HTTP: add the URL, sign in once with OAuth, and Codex can read issues, events and stack traces next to your code. This page covers the config, the triage rules for AGENTS.md and how to run triage from codex exec without opening a session.

What Codex does for Sentry triage

  • Reads unresolved Sentry issues that are new or regressed since its last run.
  • Checks your board first, so a noisy error gets a comment instead of ten new issues.
  • Files each new error with its impact, first and last seen, the release it started in, the top stack frames and a likely cause, marked as a guess.
  • Fixes the small, obvious ones in a pull request with a test, and waits for review.

Codex features for Sentry triage

FeatureWhat it doesHow to start
Sentry MCP serverIssues, events, stack traces and releases from your Sentry organizationurl = "https://mcp.sentry.dev/mcp" in config.toml
codex mcp loginSigns in to an OAuth server; --no-browser on a remote machinecodex mcp login sentry
required = trueMakes codex exec stop with an error if Sentry isn't connected, so a run never triages blindUnder [mcp_servers.sentry]
codex execRuns a triage pass and exits; -o saves the summarycodex exec "Triage new Sentry errors"

How to set up Codex for Sentry triage

  1. Connect the tools

    Add Sentry as a streamable HTTP server, then sign in once. Sentry's own docs also show the mcp-remote bridge, which works too, but Codex doesn't need it.

    # ~/.codex/config.toml
    [mcp_servers.sentry]
    url = "https://mcp.sentry.dev/mcp"
    required = true
    
    # Then sign in with OAuth
    codex mcp login sentry
  2. Write the rules in AGENTS.md

    Codex reads AGENTS.md before any work: ~/.codex/AGENTS.md, then the files from the repository root down to the folder it's working in. Put the job's rules there, or in a skill under .agents/skills/ if they're long. See the AGENTS.md guide.

    ## Sentry triage rules
    1. List unresolved production issues first seen or regressed
       since the last run.
    2. Search the board for the Sentry issue ID before filing.
    3. File new ones with users and events affected, first and last
       seen, the release, the top stack frames and a likely cause,
       marked as a guess.
    4. Urgent if it blocks sign-up, payment or data; High above 1%
       of sessions; otherwise Medium.
    5. Small, obvious fix: open a pull request with a test. Don't merge.
    6. Never resolve, ignore or delete anything in Sentry.
  3. Run it without the interactive interface

    codex exec runs one task and exits. Progress goes to stderr and the final message to stdout; -o also writes it to a file and --json streams events. The sandbox is read-only unless you pass --sandbox workspace-write.

    # A triage pass from cron; the summary goes to a file
    codex exec --sandbox workspace-write \
      -o triage.md "Triage new Sentry errors with the rules in AGENTS.md"
  4. Put it on a schedule

    Create a scheduled task in the ChatGPT desktop app or on the web (the CLI doesn't manage them), or run codex exec from cron. See how to make Codex proactive.

Source: Codex documentation

Limits and safety

  • It needs to read Sentry issues, not change them. Leave resolving and ignoring to people.
  • Its cause is a guess from the stack trace. A person confirms it before a fix ships.
  • Errors can carry user data. Keep the issues it files on a private board or repository.
  • Codex sandboxes commands by default: writes stay in the workspace and the network is off. Keep danger-full-access for an isolated runner or container.

Claude Code or Codex for Sentry triage?

The rules carry over. Write them once in AGENTS.md and put @AGENTS.md in CLAUDE.md, and both agents read the same file.

Step by step for the other agent: Sentry triage with Claude Code.

Claude CodeCodex
Rules fileCLAUDE.mdAGENTS.md
Connect toolsclaude mcp addcodex mcp add or config.toml
Run without youclaude -pcodex exec
Schedule/schedule, desktop scheduled tasks, /loopScheduled tasks in the ChatGPT app, cron
Built in for Sentry triageSentry MCP over HTTP, /mcp sign-inNative HTTP MCP, codex mcp login
With Crewmark

Make Sentry triage someone's job

Commands run when someone remembers to run them. Crewmark turns your own Codex into an AI employee with a role, a goal in numbers, working hours and a heartbeat, so the work happens on schedule and shows up on a board.

  1. Start from the role

    The AI software engineer, with these rules in its brief.

  2. Put the work on its board

    Add the job as a recurring issue. The employee wakes on its heartbeat, does it and reports in a comment.

  3. Related

    The Sentry error triage page has the full brief and priority rules.

FAQ

How do I add the Sentry MCP server to Codex?

Add a [mcp_servers.sentry] table with url = "https://mcp.sentry.dev/mcp" to ~/.codex/config.toml, then run codex mcp login sentry to sign in.

Does Codex need mcp-remote for Sentry?

No. Codex supports streamable HTTP servers, so the URL is enough. The mcp-remote bridge in Sentry's docs also works.

Can Codex fix Sentry errors?

It can find the code behind an error and open a pull request with a fix and a test. Keep merging, and resolving issues in Sentry, with people.

Checked against Claude Code's and OpenAI's Codex documentation on November 13, 2026.

Hand Sentry triage to an AI employee on Codex.

Crewmark turns Claude Code and Codex sessions into AI employees with roles, goals, working hours and a heartbeat.