# @kody/sentry-mcp — agent notes Human setup and intent live in [`README.md`](./README.md). This file is for agents: imports, smoke checks, snippets, and edge cases. Never paste tokens. Do not disable live webhooks or jobs. ## Auth | Lane | Credential | Notes | | --- | --- | --- | | Preferred | MCP server `sentry` | `kody.mcpServerAdd` → authorize `authUrl`. Helpers use `kody.mcp["sentry"]`. | | Fallback | `@kody/sentry` token/OAuth | API-token or BYO OAuth. See https://kody.codes/@kody/sentry | Do not register a Sentry OAuth app for the one-click MCP path. After fork, connect **the caller's** Sentry workspace — do not treat live `@kody/sentry-mcp` as yours. MCP *server* name stays `sentry`; `-mcp` is only the Kody package id. ## Import paths | Export | Import | | --- | --- | | package overview / MCP setup | `kody:@kody/sentry-mcp` | | smoke-test | `kody:@kody/sentry-mcp/smoke-test` | | list-organizations | `kody:@kody/sentry-mcp/list-organizations` | Prefer static `kody:@kody/sentry-mcp/...` imports from `execute`. Do not lead with `packages.invoke`. ## Smoke test (read-only) ```ts import smokeTest from 'kody:@kody/sentry-mcp/smoke-test' export default async function main() { return await smokeTest() // MCP connected => { ok: true, live: true, via: 'mcp', ... } // otherwise => { ok: true, live: false, setup: { mcp, oauthApiFallback } } } ``` ## Common snippets List organizations: ```ts import listOrganizations from 'kody:@kody/sentry-mcp/list-organizations' export default async function main() { return await listOrganizations() } ``` Add MCP server (setup, not a package export): ```ts import { kody } from 'kody:runtime' export default async function main() { return await kody.mcpServerAdd({ name: 'sentry', url: 'https://mcp.sentry.dev/mcp', }) // open returned authUrl, then retry smoke-test / list-organizations } ``` ## Edge cases / fork notes - This package is MCP-only; full REST/API-token surface lives in `@kody/sentry`. - Helpers try several MCP tool name variants (`list_organizations`, `listOrganizations`, `whoami`); missing tools surface as setup errors, not silent empty lists. - Never paste Sentry OAuth tokens, auth tokens, or client secrets into chat or logs.