First public release of MCP Client Generator — a tool to generate type-safe TypeScript clients from MCP servers.
Features
- Type-safe — Generated TypeScript types from server schemas
- Zero config auth — OAuth 2.1 with PKCE, just approve in browser
- Tree-shakable — Only bundle the methods you import
Quick Start
# Generate client from URL
npx mcp-client-gen https://mcp.notion.com/mcp -o notion.tsimport { createNotionClient } from "./notion";
import { createMcpConnection } from "mcp-client-gen";
const connection = await createMcpConnection({
url: "https://mcp.notion.com/mcp",
});
const notion = createNotionClient(connection);
const pages = await notion.notionSearch({ query: "Meeting Notes" });CLI Usage
# URL mode (primary)
npx mcp-client-gen <url> # Output to stdout
npx mcp-client-gen <url> -o <file> # Output to file
npx mcp-client-gen <url> <file> # Shorthand
# Config mode (reads .mcp.json, .cursor/, .vscode/)
npx mcp-client-gen # Interactive
npx mcp-client-gen -y # Accept defaultsPublic API
import { generateClient, createMcpConnection, browserAuth } from "mcp-client-gen";
const result = await generateClient([{ url: "https://mcp.notion.com/mcp" }]);
const connection = await createMcpConnection({ url: "https://mcp.notion.com/mcp" });Full Changelog: v0.0.1...v0.1.0