import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { GlitchMcpConfig } from "./config.js"; import { GlitchClient } from "./glitchClient.js"; export interface CreateServerOptions { readonly config: GlitchMcpConfig; readonly client?: GlitchClient; /** * Per-request bearer token (HTTP transport). Forwarded to the hosted Glitch * service so a multi-tenant deployment authenticates as the caller, not as a * single shared operator token. Ignored when an explicit client is supplied. */ readonly authToken?: string; /** * Whether the upload tool may read local file paths. stdio passes true (the * developer's own machine); HTTP passes false so it never reads the server's * filesystem from a tool argument. Ignored when an explicit client is supplied. */ readonly localFileAccess?: boolean; } export declare function createGlitchMcpServer(options: CreateServerOptions): McpServer; export declare function runStdioServer(config: GlitchMcpConfig): Promise; export interface HttpServerOptions { readonly config: GlitchMcpConfig; readonly port: number; readonly host: string; } /** * Local Streamable HTTP mode for development and enterprise self-hosted proxies. * * Stateless: every request builds a fresh server bound to the caller's bearer. * OAuth discovery is optional (GLITCH_MCP_OAUTH_ENABLED); when enabled the server * advertises protected-resource metadata and challenges unauthenticated requests, * while token verification stays with the hosted Glitch facade. */ export declare function runHttpServer(options: HttpServerOptions): Promise; /** * Extract a bearer token from an Authorization header value. * * Returns undefined for missing or non-bearer headers so the adapter can fall * back to the configured token (stdio) or report authentication_required. */ export declare function bearerFromAuthorization(header: unknown): string | undefined;