generate-sdk-types
Automates TypeScript type generation from Rust tool schemas to ensure end-to-end type safety between server and client in MCP-based projects.
Introduction
The generate-sdk-types skill provides a robust automated workflow for maintaining type consistency in projects utilizing the Model Context Protocol (MCP) with Rust-based servers and TypeScript clients. It bridges the gap between Rust ToolDefinition structs and TypeScript interfaces, effectively eliminating manual synchronization efforts and preventing type drift during rapid development cycles. This skill is specifically designed for developers maintaining cross-language SDKs where server-side tool schemas evolve frequently. By automating the extraction of JSON schemas from running Rust services and converting them into strongly typed TypeScript definitions, it guarantees that client-side tool execution aligns perfectly with the backend implementation. Typical use cases include refreshing SDK definitions after modifying MCP tools, updating parameter schemas, or performing protocol-level changes. It requires the Pierre server environment and Bun runtime to facilitate the schema parsing and file generation process. The utility ensures that every tool exposed by the server is represented in the SDK's type registry, enabling developers to write type-safe code for client-side tool consumption. Key capabilities include automated type synchronization, built-in validation for type consistency, support for full tool registration lifecycle, and seamless integration with CI/CD git diff analysis to verify changes before release. Practical usage involves running the generation script after any modifications to Rust tool registries, verifying the output against existing schemas, and committing the auto-generated types to the repository. The process involves starting the backend service, executing the generation logic via Node.js or Bun, formatting the generated source code, and running type-check tests to ensure total compilation success. Constraints include mandatory dependency on the Pierre ecosystem, the requirement for a running server instance during generation, and strict adherence to the specified source directory structure for the SDK. The output is a collection of TypeScript interfaces and a centralized tool registry constant that simplifies client-side development by providing autocomplete and static type validation for all available tools.
Repository Stats
- Stars
- 6
- Forks
- 4
- Open Issues
- 1
- Language
- Not provided
- Default Branch
- main
- Sync Status
- Idle
- Last Synced
- May 3, 2026, 08:44 PM