/**
 * server.ts — MCP server configuration for QuantRisk.
 *
 * Creates and configures the McpServer instance with all 10 tools.
 * Each tool registration wraps the handler in the shared middleware pipeline:
 *
 *   auth → tier-gate → rate-limit → handler
 *
 * The `Request` object is threaded into `createServer` because the MCP SDK's
 * `RequestHandlerExtra` (passed as the second argument to tool callbacks) does
 * not expose the raw HTTP request. Auth middleware needs the Authorization
 * header and CF-Connecting-IP, so the Request is captured in a closure at
 * server-creation time. Since `createServer` is called once per incoming HTTP
 * request (stateless Workers pattern), this is safe and correct.
 *
 * Usage (from src/index.ts):
 *   const server = createServer(env, request);
 */
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
/**
 * All Cloudflare Worker environment bindings used by the QuantRisk server.
 * Must match the bindings declared in wrangler.toml.
 */
export interface Env {
    /** Stripe secret key (sk_live_... or sk_test_...). Set as a Worker secret. */
    STRIPE_SECRET_KEY: string;
    /** Stripe webhook signing secret (whsec_...). Set as a Worker secret. */
    STRIPE_WEBHOOK_SECRET: string;
    /** Stripe Price ID for the $29/mo Pro plan. Set in wrangler.toml [vars]. */
    STRIPE_PRO_PRICE_ID: string;
    /** Public base URL for this worker (used to build success/cancel URLs). */
    PUBLIC_BASE_URL: string;
    /** KV namespace for caching price data (TTL 24h) and metadata (TTL 7d). */
    PRICE_CACHE: KVNamespace;
    /** Durable Object namespace for per-user auth, billing, and rate-limit state. */
    USER_STATE: DurableObjectNamespace;
}
export interface ToolResult {
    [key: string]: unknown;
    content: [{
        type: "text";
        text: string;
    }];
    isError?: boolean;
}
/**
 * Create and return a fully-configured QuantRisk McpServer.
 *
 * Called once per Worker request. The `request` is captured in each tool
 * handler's closure so auth middleware can read the Authorization header.
 *
 * All 10 tools are registered here. Tool name → file mapping follows the
 * spec's naming rule: `snake_case_name` → `src/tools/kebab-case-name.ts`.
 */
export declare function createServer(env: Env, request: Request): McpServer;
//# sourceMappingURL=server.d.ts.map