Files
comet-ml--opik/.agents/docs/SENTRY_MCP_SETUP.md
T
wehub-resource-sync 5a558eb09e
TypeScript SDK Compatibility V1.x E2E Tests / Select Node version matrix (push) Has been cancelled
TypeScript SDK Compatibility V1.x E2E Tests / TypeScript SDK Compatibility V1.x E2E Tests Node ${{matrix.node_version}} (push) Has been cancelled
TypeScript SDK E2E Tests / TypeScript SDK E2E Tests Node ${{matrix.node_version}} (push) Has been cancelled
Opik Optimizer - E2E Tests / build-opik (push) Has been cancelled
TypeScript SDK Compatibility V1.x E2E Tests / build-opik (push) Has been cancelled
Python SDK E2E Tests / Select Python version matrix (push) Has been cancelled
Python SDK E2E Tests / Python SDK E2E Tests ${{matrix.python_version}} (push) Has been cancelled
Python SDK E2E Tests / build-opik (push) Has been cancelled
Python SDK Compatibility V1.x E2E Tests / Select Python version matrix (push) Has been cancelled
Python SDK Compatibility V1.x E2E Tests / Python SDK Compatibility V1.x E2E Tests ${{matrix.python_version}} (push) Has been cancelled
Python SDK Compatibility V1.x E2E Tests / build-opik (push) Has been cancelled
TypeScript SDK E2E Tests / Select Node version matrix (push) Has been cancelled
TypeScript SDK E2E Tests / build-opik (push) Has been cancelled
Opik Optimizer - E2E Tests / Opik Optimizer E2E Tests Python ${{matrix.python_version}} (push) Has been cancelled
Opik Optimizer - E2E Tests / Opik Optimizer Integration Smoke Tests (push) Has been cancelled
🐙 Code Quality / detect (push) Has been cancelled
🐙 Code Quality / lint (${{ matrix.leg.name }}) (push) Has been cancelled
🐙 Code Quality / summary (push) Has been cancelled
TypeScript SDK Library Integration Tests / Check Secrets (push) Has been cancelled
TypeScript SDK Library Integration Tests / opik-vercel (Vercel AI SDK / eve) (push) Has been cancelled
SDK Library Integration Tests Runner / Check Secrets (push) Has been cancelled
SDK Library Integration Tests Runner / Missed OpenAI API Key Warning (push) Has been cancelled
SDK Library Integration Tests Runner / Build (push) Has been cancelled
SDK Library Integration Tests Runner / openai_tests (push) Has been cancelled
SDK Library Integration Tests Runner / langchain_tests (push) Has been cancelled
SDK Library Integration Tests Runner / langchain_legacy_tests (push) Has been cancelled
SDK Library Integration Tests Runner / llama_index_tests (push) Has been cancelled
SDK Library Integration Tests Runner / anthropic_tests (push) Has been cancelled
SDK Library Integration Tests Runner / mistral_tests (push) Has been cancelled
SDK Library Integration Tests Runner / groq_tests (push) Has been cancelled
SDK Library Integration Tests Runner / aisuite_tests (push) Has been cancelled
SDK Library Integration Tests Runner / haystack_tests (push) Has been cancelled
SDK Library Integration Tests Runner / dspy_tests (push) Has been cancelled
SDK Library Integration Tests Runner / crewai_v0_tests (push) Has been cancelled
SDK Library Integration Tests Runner / crewai_v1_tests (push) Has been cancelled
SDK Library Integration Tests Runner / genai_tests (push) Has been cancelled
SDK Library Integration Tests Runner / adk_tests (push) Has been cancelled
SDK Library Integration Tests Runner / adk_legacy_1_3_0_tests (push) Has been cancelled
SDK Library Integration Tests Runner / evaluation_metrics_tests (push) Has been cancelled
SDK Library Integration Tests Runner / bedrock_tests (push) Has been cancelled
SDK Library Integration Tests Runner / litellm_tests (push) Has been cancelled
SDK Library Integration Tests Runner / harbor_tests (push) Has been cancelled
SDK Library Integration Tests Runner / Slack Notification (push) Has been cancelled
Lint Opik Helm Chart / render-equality (push) Has been cancelled
Opik Optimizer - Unit Tests / Opik Optimizer Unit Tests Python ${{matrix.python_version}} (push) Has been cancelled
Python BE E2E Tests / Python BE E2E (push) Has been cancelled
Python Backend Tests / run-python-backend-tests (push) Has been cancelled
Python SDK Unit Tests / Python SDK Unit Tests ${{matrix.python_version}} (push) Has been cancelled
Release Drafter / update_release_draft (push) Has been cancelled
SDK E2E Libraries Integration Tests / Check Secrets (push) Has been cancelled
SDK E2E Libraries Integration Tests / Missed OpenAI API Key Warning (push) Has been cancelled
SDK E2E Libraries Integration Tests / build-opik (push) Has been cancelled
SDK E2E Libraries Integration Tests / E2E Lib Integration Python ${{matrix.python_version}} (push) Has been cancelled
TypeScript SDK Integration Build & Publish / build-and-publish (opik-gemini) (push) Has been cancelled
TypeScript SDK Integration Build & Publish / build-and-publish (opik-langchain) (push) Has been cancelled
TypeScript SDK Integration Build & Publish / build-and-publish (opik-openai) (push) Has been cancelled
TypeScript SDK Integration Build & Publish / build-and-publish (opik-otel) (push) Has been cancelled
TypeScript SDK Integration Build & Publish / build-and-publish (opik-vercel) (push) Has been cancelled
TypeScript SDK Build & Publish / build-and-publish (push) Has been cancelled
TypeScript SDK Unit Tests / Test on Node ${{ matrix.node-version }} (push) Has been cancelled
Backend Tests / discover-tests (push) Has been cancelled
Backend Tests / ${{ matrix.name }} (push) Has been cancelled
Build and Publish SDK / build-and-publish (push) Has been cancelled
Build Opik Docker Images / set-version (push) Has been cancelled
Build Opik Docker Images / build-backend (push) Has been cancelled
Build Opik Docker Images / build-sandbox-executor-python (push) Has been cancelled
Build Opik Docker Images / build-python-backend (push) Has been cancelled
Build Opik Docker Images / build-frontend (push) Has been cancelled
Build Opik Docker Images / create-git-tag (push) Has been cancelled
ClickHouse Migration Cluster Check / validate-clickhouse-migrations (push) Has been cancelled
Docs - Publish / run (push) Has been cancelled
E2E Tests - Post Merge (v2) / 🧪 E2E v2 Tests (${{ github.event.inputs.tier || 't1' }}) (push) Has been cancelled
E2E Tests - Post Merge (v2) / 📢 Slack Notification (push) Has been cancelled
Frontend Unit Tests / Test on Node 20 (push) Has been cancelled
Guardrails E2E Tests / Select Python version matrix (push) Has been cancelled
Guardrails E2E Tests / Guardrails E2E Tests ${{matrix.python_version}} (push) Has been cancelled
Guardrails E2E Tests / 📢 Slack Notification (push) Has been cancelled
Guardrails Backend Unit Tests / Guardrails Backend Unit Tests (push) Has been cancelled
Guardrails Backend Unit Tests / 📢 Slack Notification (push) Has been cancelled
Lint Opik Helm Chart / lint-helm-chart (Helm v3.21.0) (push) Has been cancelled
Lint Opik Helm Chart / lint-helm-chart (Helm v4.2.0) (push) Has been cancelled
Lint Opik Helm Chart / unittest-helm-chart (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:25:44 +08:00

5.8 KiB

Sentry MCP Configuration Guide

This guide explains how to enable the Sentry MCP server for Claude Code, Cursor, and other MCP-compatible clients so you can query Sentry issues, events, and stack traces from your agent without leaving the IDE.

Setup

The Sentry server is wired into .agents/mcp.json and uses a User Auth Token loaded from .env.local — same pattern as the GitHub, Jira, and Slack MCPs in this repo.

"Sentry": {
  "command": "npx",
  "args": ["-y", "@sentry/mcp-server@latest"],
  "envFile": "${workspaceFolder}/.env.local"
}

Step 1: Create a Sentry User Auth Token

  1. Go to https://sentry.io/settings/account/api/auth-tokens/.
  2. Click Create New Token, name it something recognizable (e.g., opik-mcp-local).
  3. Select these least-privilege scopes:
    • org:read
    • project:read
    • team:read
    • event:write (required by some MCP calls; does not allow event deletion)
  4. Add project:write and team:write only if you want write actions (resolve issues, comment, assign). Read-only is recommended.
  5. Create Token and copy the value.

Step 2: Add the token to .env.local

If you don't have .env.local yet, copy .env.template:

cp .env.template .env.local

Then set the value:

SENTRY_ACCESS_TOKEN=your-user-auth-token-here

.env.local is gitignored — do not commit it.

Step 3: Generate the Claude config

make claude

This regenerates .claude/ and .mcp.json. The convert script reads .env.local and inlines values into the Sentry block of .mcp.json (same as the Jira MCP). Verify:

jq '.mcpServers.Sentry.env | has("SENTRY_ACCESS_TOKEN")' .mcp.json
# → true

If you rotate the token later, update .env.local and re-run make claude.

Step 4: Restart your MCP client

Restart Claude Code (or Cursor, etc.) so it loads the new MCP server.

Step 5: Verify

Ask the agent something like:

List recent Sentry issues for opik-python-sdk in the comet-or org.

You should see it call a Sentry tool and return results.

Tools Exposed

The official Sentry MCP exposes (non-exhaustive):

  • Read: find_organizations, find_projects, find_releases, find_teams, get_sentry_resource, get_issue_tag_values, get_replay_details, whoami
  • Write (only with *:write scopes): update_issue (resolve / assign / ignore)

Avoid the NL-Backed Search Tools

The Sentry MCP exposes three "search" tools — search_issues, search_events, search_issue_events — and one analysis tool, analyze_issue_with_seer. All of them route through Sentry's own OpenAI account for natural-language → Sentry query translation, and that account is frequently rate-limited (You exceeded your current quota). Treat them as best-effort; do not build workflows around them.

Direct, non-LLM tools that always work: get_sentry_resource, get_issue_tag_values, find_organizations, find_projects, find_releases, find_teams, whoami, update_issue.

When you need to enumerate events inside an issue (the direct tools fetch a single resource but cannot paginate events), call Sentry's REST API directly using the same SENTRY_ACCESS_TOKEN. The /analyze-sentry-issue slash command (defined in ../commands/comet/analyze-sentry-issue.md) drives this — paginates /api/0/issues/<id>/events/ and aggregates by exception message, tags, and users.

Self-Hosted Sentry

If you point at a self-hosted Sentry, add SENTRY_HOST=sentry.example.com (no scheme) to .env.local. For plain-HTTP self-hosted deployments, append --insecure-http to the args array in .agents/mcp.json.

Alternative: OAuth / Remote Server (no token)

If you don't want to manage a personal token, you can run the official remote MCP via OAuth instead. Replace the Sentry block in .agents/mcp.json with:

"Sentry": {
  "command": "npx",
  "args": ["-y", "mcp-remote", "https://mcp.sentry.dev/mcp"],
  "env": {}
}

Then make claude + restart your MCP client. The first Sentry tool call opens a browser for OAuth. Tokens are cached at ~/.mcp-auth/. Note: this path won't help the /analyze-sentry-issue slash command, which still needs SENTRY_ACCESS_TOKEN in .env.local.

Security Notes

  • .agents/mcp.json is committed. Never put a token in it directly — always go through .env.local via envFile.
  • .mcp.json is gitignored (generated by make claude), but treat it as if it weren't — re-running make claude after editing .env.local is the only supported way to update it.
  • The token inherits your existing Sentry permissions; the MCP cannot escalate access.

Troubleshooting

SENTRY_ACCESS_TOKEN missing from .mcp.json after make claude

jq '.mcpServers.Sentry.env | has("SENTRY_ACCESS_TOKEN")' .mcp.json

If false: confirm .env.local has the line SENTRY_ACCESS_TOKEN=... (no surrounding quotes, no leading whitespace) and re-run make claude.

"Server not found" after make claude

Confirm both files are in sync:

jq '.mcpServers | keys' .agents/mcp.json
jq '.mcpServers | keys' .mcp.json

Restart Claude Code after make claude — it only loads MCP servers at startup.

401 / authentication errors

  • Verify the token is current and has the scopes from Step 1.
  • Make sure no whitespace was copied with the value.
  • Re-run make claude after editing .env.local.

Token cached for the wrong org (OAuth alternative only)

rm -rf ~/.mcp-auth

Then trigger a Sentry tool call again to start a fresh OAuth flow.

Additional Resources