Repository navigation
Minor Changes
-
939fa1d: Write one OpenTelemetry
SERVERspan per MCP request or notification, following the OpenTelemetry MCP semantic conventions and thevercel.rpc.*attributes Vercel's MCP observability reads. Spans are written only when the app registers a tracer provider;mcp-handlerhas no runtime dependency on@opentelemetry/api. Set the endpoint label withtelemetry.route, or turn spans off withtelemetry: false.Add
registerMcpOTel()inmcp-handler/otel, which registers@vercel/otel2.x with the Vercel project as the service name and removes the rawUser-AgentandRefererattributes@vercel/oteladds to spans.@vercel/otelis now an optional peer dependency at^2.0.0. With npm, upgrade@vercel/otelto 2.x before you upgrademcp-handler, or the install fails withERESOLVE.With MCP Events, write
mcp.event.subscription {action}andmcp.event.verify_callbackspans around the calls to the application's subscription store andverifyEndpoint.Spans are on by default whenever the app registers a tracer provider. If your app already writes its own MCP
SERVERspans withmcp.method.name, ormcp.event.*spans around its MCP Events store orverifyEndpoint, settelemetry: falseor remove your spans when upgrading, or each message and subscription step is recorded twice. -
755e2db: Add
experimental_setToolOutcome(ctx, { outcome, errorType }), which a tool handler calls to say why it failed. Its MCP span then recordsapi_error,tool_error,execution_failureorrequest_errorwith a shorterror.typesuch asforbiddenortimeout, instead of the defaultexecution_failure/internal_error. It applies only to calls answered with anisErrorresult.