import type { OAuthClientProvider } from '@modelcontextprotocol/sdk/client/auth.js'; import { Client } from '@modelcontextprotocol/sdk/client/index.js'; export interface NotionTransport { callTool(name: string, args: Record): Promise>; } export declare class NotionMCPError extends Error { readonly code: string | null; readonly raw: unknown; constructor(message: string, opts?: { code?: string | null; raw?: unknown; }); } export interface MCPNotionTransportOptions { authProvider: OAuthClientProvider; serverUrl?: string; } export declare class MCPNotionTransport implements NotionTransport { protected client: Client | null; private connectPromise; private readonly authProvider; private readonly serverUrl; constructor(opts: MCPNotionTransportOptions); private ensureConnected; callTool(name: string, args: Record): Promise>; } export declare class NotionAPIError extends Error { readonly status: number | null; readonly code: string | null; constructor(message: string, status?: number | null, code?: string | null); } export interface HttpNotionTransportOptions { apiKey: string; baseUrl?: string; /** * Absent means the generation the client is written against. A CLI verb * overrides it per line from --notion-version, so the override travels with * the transport the call sites already hold rather than as a second argument * every one of them would have to thread. */ apiVersion?: string; } export interface RestCall { method: 'GET' | 'POST' | 'PATCH' | 'PUT' | 'DELETE'; path: string; query?: Record; /** * Any JSON value, not only an object: `ntn api` sends whatever `--data` * or the pipe carried, verbatim, with no client-side object check. */ body?: unknown; /** * Per-request headers, which `ntn api` collects from its `Header:Value` * inputs. Applied last so a caller can override a default, which is what the * real CLI does (probed on the wire against ntn 0.21.9). */ headers?: Record; } export declare class HttpNotionTransport implements NotionTransport { protected readonly fetch: typeof fetch; private readonly apiKey; private readonly baseUrl; private readonly apiVersion; constructor(opts: HttpNotionTransportOptions); request(call: RestCall): Promise>; callTool(name: string, args: Record): Promise>; } //# sourceMappingURL=client.d.ts.map