From df0deba56c2c147bab748095c97b2621cf1ae0b7 Mon Sep 17 00:00:00 2001 From: Ogi <86684834+obostjancic@users.noreply.github.com> Date: Mon, 17 Nov 2025 16:52:09 +0100 Subject: [PATCH] feat(mcp-insights): node manual instrumentation docs --- static/app/gettingStartedDocs/node/utils.tsx | 126 ++++++++++++------ .../views/insights/pages/mcp/onboarding.tsx | 5 +- 2 files changed, 86 insertions(+), 45 deletions(-) diff --git a/static/app/gettingStartedDocs/node/utils.tsx b/static/app/gettingStartedDocs/node/utils.tsx index 2fa9797ee3241b..b9f6306cfbdbb0 100644 --- a/static/app/gettingStartedDocs/node/utils.tsx +++ b/static/app/gettingStartedDocs/node/utils.tsx @@ -795,24 +795,21 @@ export const getNodeMcpOnboarding = ({ ], }, ], - configure: params => [ - { - type: StepType.CONFIGURE, - content: [ - { - type: 'text', - text: tct('Initialize the Sentry SDK with [code:Sentry.init()] call.', { - code: , - }), - }, - { - type: 'code', - tabs: [ - { - label: 'JavaScript', - value: 'javascript', - language: 'javascript', - code: `${getImport(packageName).join('\n')} + configure: params => { + const mcpSdkStep: ContentBlock[] = [ + { + type: 'text', + text: tct('Initialize the Sentry SDK with [code:Sentry.init()] call.', { + code: , + }), + }, + { + type: 'code', + tabs: [ + { + label: 'JavaScript', + language: 'javascript', + code: `${getImport(packageName).join('\n')} Sentry.init({ dsn: "${params.dsn.public}", @@ -820,38 +817,79 @@ Sentry.init({ tracesSampleRate: 1.0, sendDefaultPii: true, });`, - }, - ], - }, - { - type: 'text', - text: tct( - 'Wrap your MCP server in a [code:Sentry.wrapMcpServerWithSentry()] call. This will automatically capture spans for all MCP server interactions.', - { - code: , - } - ), - }, - { - type: 'code', - tabs: [ - { - label: 'JavaScript', - value: 'javascript', - language: 'javascript', - code: ` + }, + ], + }, + { + type: 'text', + text: tct( + 'Wrap your MCP server in a [code:Sentry.wrapMcpServerWithSentry()] call. This will automatically capture spans for all MCP server interactions.', + { + code: , + } + ), + }, + { + type: 'code', + tabs: [ + { + label: 'JavaScript', + language: 'javascript', + code: ` const { McpServer } = require("@modelcontextprotocol/sdk"); const server = Sentry.wrapMcpServerWithSentry(new McpServer({ name: "my-mcp-server", version: "1.0.0", }));`, - }, - ], - }, - ], - }, - ], + }, + ], + }, + ]; + + const manualStep: ContentBlock[] = [ + { + type: 'text', + text: t('Initialize the Sentry SDK in the entry point of your application:'), + }, + { + type: 'code', + tabs: [ + { + label: 'JavaScript', + language: 'javascript', + code: `${getImport(packageName).join('\n')} + +Sentry.init({ + dsn: "${params.dsn.public}", + tracesSampleRate: 1.0, +});`, + }, + ], + }, + { + type: 'text', + text: tct( + 'Then follow the [link:manual instrumentation guide] to instrument your MCP server.', + { + link: ( + + ), + } + ), + }, + ]; + + const selected = (params.platformOptions as any)?.integration ?? 'mcp_sdk'; + const content = selected === 'manual' ? manualStep : mcpSdkStep; + + return [ + { + type: StepType.CONFIGURE, + content, + }, + ]; + }, verify: () => [ { type: StepType.VERIFY, diff --git a/static/app/views/insights/pages/mcp/onboarding.tsx b/static/app/views/insights/pages/mcp/onboarding.tsx index a84ea7b3ad4386..37ce0771b7414a 100644 --- a/static/app/views/insights/pages/mcp/onboarding.tsx +++ b/static/app/views/insights/pages/mcp/onboarding.tsx @@ -220,7 +220,10 @@ export function Onboarding() { {label: 'FastMCP / MCP SDK', value: 'mcp_sdk'}, {label: 'Other', value: 'manual'}, ] - : [{label: 'MCP SDK', value: 'mcp_sdk'}], + : [ + {label: 'MCP SDK', value: 'mcp_sdk'}, + {label: 'Other', value: 'manual'}, + ], }, };