Sentry Connector

Connect PraisonAI agents to Sentry to inspect production errors, stack traces, and releases with OAuth 2.1

Connect your PraisonAI agents to Sentry so they can fetch recent production exceptions, inspect stack traces, correlate regressions with releases, and draft root-cause summaries.

SettingValue
Catalog IDsentry
Endpointhttps://mcp.sentry.dev/mcp
TransportStreamable HTTP (Remote)
AuthenticationOAuth 2.1 (browser or --manual)
python
from praisonaiagents import Agent, MCP

agent = Agent(
    name="Incident Responder",
    instructions="Diagnose Sentry errors using stack traces and release info.",
    tools=MCP(
        "https://mcp.sentry.dev/mcp",
        oauth=True,
        server_name="sentry",
    ),
)

agent.start("Show the top 5 unresolved Sentry issues from the last 24 hours and explain the root cause of the #1 error")

The user asks about recent production failures; PraisonAI pulls live stack traces from Sentry and summarizes probable root causes.

Diagram

👤 User

🤖 PraisonAI Agent

🔐 Sentry OAuth 2.1

🐞 Sentry Remote MCP
mcp.sentry.dev/mcp

✅ Issues & Stack Traces


How It Works

PraisonAI connects to Sentry’s official hosted MCP endpoint (https://mcp.sentry.dev/mcp) over Streamable HTTP using OAuth 2.1 PKCE and caches tokens at 0600 in ~/.praisonai/mcp-auth.json.

Diagram
PraisonAI AgentSentry MCP Servermcp-auth.jsonSentry OAuth 2.1praisonai CLIUserPraisonAI AgentSentry MCP Servermcp-auth.jsonSentry OAuth 2.1praisonai CLIUserpraisonai connectors add sentry –authRun OAuth 2.1 PKCE flowApprove organization access in browserSave OAuth token (0600)Investigate unresolved errorsLoad cached tokenFetch issues and event stack tracesStructured exception detailsRoot-cause report

Step-by-Step Setup

  1. Prerequisites
    • A Sentry account with access to at least one organization and project
  2. Install PraisonAI with MCP support
    bash
    pip install "praisonai[mcp]"
  3. Add and authenticate Sentry

    CLI (Interactive OAuth)

    bash
    praisonai connectors add sentry --auth

    Headless / SSH (–manual)

    bash
    praisonai connectors add sentry --auth --manual

    PraisonAI Dashboard

    Enable catalog connectors in your PraisonAIUI config.yaml:

    yaml
    mcp:
      enabled: true
      allow:
        catalog: true

    Run praisonai dashboard, open Connectors / MCP, and click Connect on Sentry.

  4. Verify and inspect tools
    bash
    praisonai mcp sync sentry
  5. Combine Sentry with GitHub (optional)
    python
    from praisonaiagents import Agent, MCP
    
    agent = Agent(
        name="Bug Fixer",
        instructions="Read Sentry stack traces and check matching GitHub code.",
        tools=[
            MCP("https://mcp.sentry.dev/mcp", oauth=True, server_name="sentry"),
            MCP("https://api.githubcopilot.com/mcp/", oauth=True, server_name="github"),
        ],
    )
    
    agent.start("Inspect our top unresolved Sentry issue and identify the likely commit in GitHub")

Scope Tools for Safety

Keep incident-triage agents read-only so they don’t prematurely resolve or ignore active alerts:

python
from praisonaiagents import Agent, MCP

sentry = MCP(
    "https://mcp.sentry.dev/mcp",
    oauth=True,
    server_name="sentry",
    approval="always",
)

Common Workflows

  • Post-Deploy Regression Check: "List any new Sentry issues introduced after today's release and group by service."
  • Root-Cause Brief: "Fetch full stack trace and breadcrumbs for Sentry issue PROJ-123 and suggest a fix."

Troubleshooting

SymptomCauseFix
401 Unauthorized on praisonai connectors test sentryconnectors test does not attach stored OAuth tokensVerify with praisonai mcp sync sentry
Missing project in resultsAuthorized a different Sentry orgRun praisonai connectors logout sentry --yes then praisonai connectors auth sentry
Headless server hangs waiting for browserLoopback callback unavailable over SSHUse praisonai connectors auth sentry --manual

Best Practices

Specify organization and project slugs in prompts

Mention your Sentry organization and project slug so the agent avoids scanning unrelated projects.

Pair Sentry with GitHub or Linear for end-to-end triage

Pass multiple MCP(...) instances in tools=[...] — PraisonAI automatically namespaced tool names when multiple servers are loaded via load_mcp_tools().

Watch for PII in error payloads

Sentry event breadcrumbs can contain request metadata; avoid forwarding raw event payloads to external channels without redaction.


Related