Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
34 lines
1.4 KiB
Plaintext
34 lines
1.4 KiB
Plaintext
import type { McpServerWrapperOptions } from './types';
|
|
/**
|
|
* Wraps a MCP Server instance from the `@modelcontextprotocol/sdk` package with Sentry instrumentation.
|
|
*
|
|
* Compatible with versions `^1.9.0` of the `@modelcontextprotocol/sdk` package.
|
|
* Automatically instruments transport methods and handler functions for comprehensive monitoring.
|
|
*
|
|
* @example
|
|
* ```typescript
|
|
* import * as Sentry from '@sentry/core';
|
|
* import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
* import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/streamableHttp.js';
|
|
*
|
|
* // Default: inputs/outputs captured based on sendDefaultPii option
|
|
* const server = Sentry.wrapMcpServerWithSentry(
|
|
* new McpServer({ name: "my-server", version: "1.0.0" })
|
|
* );
|
|
*
|
|
* // Explicitly control input/output capture
|
|
* const server = Sentry.wrapMcpServerWithSentry(
|
|
* new McpServer({ name: "my-server", version: "1.0.0" }),
|
|
* { recordInputs: true, recordOutputs: false }
|
|
* );
|
|
*
|
|
* const transport = new StreamableHTTPServerTransport();
|
|
* await server.connect(transport);
|
|
* ```
|
|
*
|
|
* @param mcpServerInstance - MCP server instance to instrument
|
|
* @param options - Optional configuration for recording inputs and outputs
|
|
* @returns Instrumented server instance (same reference)
|
|
*/
|
|
export declare function wrapMcpServerWithSentry<S extends object>(mcpServerInstance: S, options?: McpServerWrapperOptions): S;
|
|
//# sourceMappingURL=index.d.ts.map |