Skip to main content
Glama

Sentry MCP

Official
by getsentry
sentry.config.ts1.5 kB
import type { Env } from "./types"; import { LIB_VERSION } from "@sentry/mcp-server/version"; import * as Sentry from "@sentry/cloudflare"; import { sentryBeforeSend } from "@sentry/mcp-server/telem/sentry"; type SentryConfig = ReturnType<Parameters<typeof Sentry.withSentry>[0]>; export default function getSentryConfig(env: Env): SentryConfig { const { id: versionId } = env.CF_VERSION_METADATA; return { dsn: env.SENTRY_DSN, tracesSampleRate: 1, sendDefaultPii: true, beforeSend: sentryBeforeSend, initialScope: { tags: { "mcp.server_version": LIB_VERSION, "sentry.host": env.SENTRY_HOST, }, }, release: versionId, environment: env.SENTRY_ENVIRONMENT ?? (process.env.NODE_ENV !== "production" ? "development" : "production"), _experiments: { enableLogs: true, }, integrations: [ Sentry.consoleLoggingIntegration(), Sentry.zodErrorsIntegration(), Sentry.vercelAIIntegration(), ], }; } getSentryConfig.partial = (config: Partial<SentryConfig>) => { return (env: Env) => { const defaultConfig = getSentryConfig(env); return { ...defaultConfig, ...config, initialScope: { ...defaultConfig.initialScope, ...config.initialScope, tags: { // idk I can't typescript ...((defaultConfig.initialScope ?? {}) as any).tags, ...((config.initialScope ?? {}) as any).tags, }, }, }; }; };

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/getsentry/sentry-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server