const require_chunk = require('./chunk-DoeelZqw.cjs');
const __modelcontextprotocol_sdk_server_stdio_js = require_chunk.__toESM(require("@modelcontextprotocol/sdk/server/stdio.js"));
const __sentry_node = require_chunk.__toESM(require("@sentry/node"));

//#region ../mcp-core/dist/version-CNqt4XlN.js
const LIB_VERSION = typeof process !== "undefined" && "0.26.0" || "0.0.0";
const USER_AGENT = `sentry-mcp/${LIB_VERSION} (https://mcp.sentry.dev)`;

//#endregion
//#region src/transports/stdio.ts
/**
* Starts the MCP server with stdio transport and telemetry.
*
* Connects the server using stdio transport for process-based communication.
* Context is already captured in tool handler closures during buildServer().
* All operations are wrapped in Sentry tracing for observability.
*
* @param server - Configured and instrumented MCP server instance (with context in closures)
* @param context - Server context with authentication and configuration (for telemetry attributes)
*
* @example CLI Integration
* ```typescript
* import { buildServer } from "./server.js";
* import { startStdio } from "./transports/stdio.js";
*
* const context = {
*   accessToken: userToken,
*   sentryHost: "sentry.io",
*   userId: "user-123",
*   clientId: "cursor-ide",
*   constraints: {}
* };
*
* const server = buildServer({ context }); // Context captured in closures
* await startStdio(server, context);
* ```
*/
async function startStdio(server, context) {
	await __sentry_node.startNewTrace(async () => {
		return await __sentry_node.startSpan({
			name: "mcp.server/stdio",
			attributes: {
				"mcp.transport": "stdio",
				"network.transport": "pipe",
				"service.version": LIB_VERSION
			}
		}, async () => {
			const transport = new __modelcontextprotocol_sdk_server_stdio_js.StdioServerTransport();
			await server.connect(transport);
		});
	});
}

//#endregion
Object.defineProperty(exports, 'LIB_VERSION', {
  enumerable: true,
  get: function () {
    return LIB_VERSION;
  }
});
Object.defineProperty(exports, 'USER_AGENT', {
  enumerable: true,
  get: function () {
    return USER_AGENT;
  }
});
Object.defineProperty(exports, 'startStdio', {
  enumerable: true,
  get: function () {
    return startStdio;
  }
});
//# sourceMappingURL=stdio-DFfz0_Ua.cjs.map