import "./permissions-BBgPgD70.js";
import { ServerContext } from "./types-DjbiyvLT.js";
import { ToolConfig } from "./types-Bu5blaB3.js";
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";

//#region src/server.d.ts

/**
 * Creates and configures a complete MCP server with Sentry instrumentation.
 *
 * The server is built with tools filtered based on the granted scopes in the context.
 * Context is captured in tool handler closures and passed directly to handlers.
 *
 * @example Usage with stdio transport
 * ```typescript
 * import { buildServer } from "@sentry/mcp-server/server";
 * import { startStdio } from "@sentry/mcp-server/transports/stdio";
 *
 * const context = {
 *   accessToken: process.env.SENTRY_TOKEN,
 *   sentryHost: "sentry.io",
 *   userId: "user-123",
 *   clientId: "cursor-ide",
 *   constraints: {}
 * };
 *
 * const server = buildServer({ context });
 * await startStdio(server, context);
 * ```
 *
 * @example Usage with Cloudflare Workers
 * ```typescript
 * import { buildServer } from "@sentry/mcp-server/server";
 * import { experimental_createMcpHandler as createMcpHandler } from "agents/mcp";
 *
 * const serverContext = buildContextFromOAuth();
 * // Context is captured in closures during buildServer()
 * const server = buildServer({ context: serverContext });
 *
 * // Context already available to tool handlers via closures
 * return createMcpHandler(server, { route: "/mcp" })(request, env, ctx);
 * ```
 */
declare function buildServer({
  context,
  onToolComplete,
  tools: customTools
}: {
  context: ServerContext;
  onToolComplete?: () => void;
  tools?: Record<string, ToolConfig<any>>;
}): McpServer;
//# sourceMappingURL=server.d.ts.map
//#endregion
export { buildServer };
//# sourceMappingURL=server.d.ts.map