UNPKG

notion-mcp-server

Version:

Notion MCP server with token auth: connect Claude Code, Claude Desktop, Cursor, VS Code, Codex and any MCP client to Notion. Search, create and edit pages, query databases, comment and upload files. Runs headless in CI and agents.

17 lines (16 loc) • 746 B
// Bridge between Zod-validated request shapes and the SDK's strict // discriminated-union request types. Zod can describe loose shapes // (z.record, z.unknown), but `@notionhq/client` request types use // branded discriminated unions that Zod inference can't preserve. // // Each helper below is a single typed boundary cast: the runtime payload // has already been validated by Zod; the cast only tells TypeScript what // the SDK expects on the wire. Prefer these over `as never` so the cast // target stays visible and grep-able. /** * Cast a Zod-validated payload to its SDK request shape. The runtime value * has already been narrowed by the schema; this only widens the static type. */ export function asSdk(value) { return value; }