Rocky_Mountain_Vending/.pnpm-store/v10/files/68/c95b1c1a8bfd72774baf4ef4140e5d8aa2d1ccd5c707b2bf6432ff44bbf2a67a4f2f554ffc25e6b7405e3e97d974b76523ed2cb5b3fb7c1017ca3ef9c5492f
DMleadgen 46d973904b
Initial commit: Rocky Mountain Vending website
Next.js website for Rocky Mountain Vending company featuring:
- Product catalog with Stripe integration
- Service areas and parts pages
- Admin dashboard with Clerk authentication
- SEO optimized pages with JSON-LD structured data

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 16:22:15 -07:00

72 lines
2.2 KiB
Text

Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const object = require('../../utils/object.js');
const handlers = require('./handlers.js');
const transport = require('./transport.js');
const validation = require('./validation.js');
/**
* Tracks wrapped MCP server instances to prevent double-wrapping
* @internal
*/
const wrappedMcpServerInstances = new WeakSet();
/**
* 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';
*
* const server = Sentry.wrapMcpServerWithSentry(
* new McpServer({ name: "my-server", version: "1.0.0" })
* );
*
* const transport = new StreamableHTTPServerTransport();
* await server.connect(transport);
* ```
*
* @param mcpServerInstance - MCP server instance to instrument
* @returns Instrumented server instance (same reference)
*/
function wrapMcpServerWithSentry(mcpServerInstance) {
if (wrappedMcpServerInstances.has(mcpServerInstance)) {
return mcpServerInstance;
}
if (!validation.validateMcpServerInstance(mcpServerInstance)) {
return mcpServerInstance;
}
const serverInstance = mcpServerInstance ;
object.fill(serverInstance, 'connect', originalConnect => {
return async function ( transport$1, ...restArgs) {
const result = await (originalConnect ).call(
this,
transport$1,
...restArgs,
);
transport.wrapTransportOnMessage(transport$1);
transport.wrapTransportSend(transport$1);
transport.wrapTransportOnClose(transport$1);
transport.wrapTransportError(transport$1);
return result;
};
});
handlers.wrapAllMCPHandlers(serverInstance);
wrappedMcpServerInstances.add(mcpServerInstance);
return mcpServerInstance ;
}
exports.wrapMcpServerWithSentry = wrapMcpServerWithSentry;
//# sourceMappingURL=index.js.map