-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
dev-docs (MCP server): Add tracing and errors documentation #14374
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice, this is what I think we want. Once we convert the errors spec to stop using tags we can merge!
develop-docs/sdk/expected-features/mcp-instrumentation/index.mdx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Code Example Mismatches Documentation Goals
The captureError
code example (lines 19-34) uses TypeScript syntax and JavaScript-specific relative imports (../../currentScopes
, ../../exports
). This contradicts the stated goal of language-agnostic documentation for all SDK implementations and exposes internal implementation details. Additionally, a "[WIP] will be removed as tags are intended for users" comment (line 38) is present, which is a temporary development note and should not be in the final documentation.
develop-docs/sdk/expected-features/mcp-instrumentation/errors.mdx#L17-L38
sentry-docs/develop-docs/sdk/expected-features/mcp-instrumentation/errors.mdx
Lines 17 to 38 in 6d2da97
```ts | |
import { getClient } from '../../currentScopes'; | |
import { captureException } from '../../exports'; | |
export function captureError(error: Error, errorType?: string): void { | |
try { | |
const client = getClient(); | |
if (!client) return; | |
captureException(error, { | |
tags: { | |
mcp_error_type: errorType || 'handler_execution', | |
}, | |
}); | |
} catch { | |
// Silently ignore capture errors so it never affects MCP operation | |
} | |
} | |
``` | |
- **Never throws an exception:** All error capture is wrapped in a try/catch and will never throw an exception. | |
- **Tags errors:** [WIP] will be removed as tags are intended for users. |
Was this report helpful? Give feedback by reacting with 👍 or 👎
@@ -0,0 +1,76 @@ | |||
--- | |||
title: Errors |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
title: Errors | |
title: MCP Server Errors | |
sidebar_title: Errors |
|
||
### Error Categorization | ||
|
||
Errors are categorized and tagged based on the handler and error type: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Errors are categorized and tagged based on the handler and error type: | |
Errors are categorized and tagged according to the handler and type of error: |
title: Tracing | ||
--- | ||
|
||
The MCP Server module is the instrumentation for the anthropic MCP SDKs. At the moment it only supports the [MCP Typescript SDK](https://github.com/modelcontextprotocol/typescript-sdk/). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The MCP Server module is the instrumentation for the anthropic MCP SDKs. At the moment it only supports the [MCP Typescript SDK](https://github.com/modelcontextprotocol/typescript-sdk/). | |
The MCP Server module is the instrumentation for the [anthropic MCP](https://www.anthropic.com/news/model-context-protocol) SDKs. At the moment it only supports the [MCP Typescript SDK](https://github.com/modelcontextprotocol/typescript-sdk/). |
@@ -0,0 +1,137 @@ | |||
--- | |||
title: Tracing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
title: Tracing | |
title: MCP Tracing | |
sidebar_title: Tracing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Thanks for adding 🫡
DESCRIBE YOUR PR
Closes #14106
Adds developer docs for our MCP Server instrumentation.
Route for the documentation
sdk/expected-features/mcp-instrumentation
that includes:Followed this file structure as a start to (in the future) have this structure for all the other features, having something like this below, where we have :
The structure idea is from @abhi, who helped me settle this <3.
NOTE: Error docs are going to change, addressing feedback from sentry-javascript/pull/16817
IS YOUR CHANGE URGENT?
PRE-MERGE CHECKLIST
Make sure you've checked the following before merging your changes: