Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
126 changes: 82 additions & 44 deletions static/app/gettingStartedDocs/node/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -795,63 +795,101 @@ export const getNodeMcpOnboarding = ({
],
},
],
configure: params => [
{
type: StepType.CONFIGURE,
content: [
{
type: 'text',
text: tct('Initialize the Sentry SDK with [code:Sentry.init()] call.', {
code: <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: <code />,
}),
},
{
type: 'code',
tabs: [
{
label: 'JavaScript',
language: 'javascript',
code: `${getImport(packageName).join('\n')}

Sentry.init({
dsn: "${params.dsn.public}",
// Tracing must be enabled for MCP monitoring to work
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: <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: <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: (
<ExternalLink href="https://docs.sentry.io/platforms/node/tracing/instrumentation/custom-instrumentation/mcp-module/#manual-instrumentation" />
),
}
),
},
];

const selected = (params.platformOptions as any)?.integration ?? 'mcp_sdk';
const content = selected === 'manual' ? manualStep : mcpSdkStep;

return [
{
type: StepType.CONFIGURE,
content,
},
];
},
verify: () => [
{
type: StepType.VERIFY,
Expand Down
5 changes: 4 additions & 1 deletion static/app/views/insights/pages/mcp/onboarding.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'},
],
},
};

Expand Down
Loading