TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Bundling MCP Servers in Every OpenAPI –> TypeScript SDK

16 pointsby disintegrator2 months ago

1 comment

disintegrator2 months ago
Author here.<p>Some context: Speakeasy lets you generate SDKs from OpenAPI 3.x specs and now every user that generates a TypeScript SDK gets a Model Context Protocol (MCP) server bundled with it. This is available to users on both free and paid tiers.<p>I&#x27;ve been the primary maintainer of TypeScript SDK codegen and since launching it early last year, I made a bet on Zod for defining models and tying static TypeScript types to runtime validation. During that time, LLM function calling became a widespread feature and we saw that lots of folks preferred defining function arguments using Zod schemas and having something like `zod-to-json-schema` convert them to JSON Schema.<p>Fast forward to MCP&#x27;s release and we noticed that the TypeScript SDK also accepts Zod schemas for defining tool arguments. The &quot;gap&quot; between generating a TypeScript SDK and going further to generate an MCP server was so small for us that we jumped right on it.<p>In terms of other interesting bits, the server is built out into a single JavaScript file using Bun&#x27;s bundler. We also use stricli (<a href="https:&#x2F;&#x2F;bloomberg.github.io&#x2F;stricli&#x2F;" rel="nofollow">https:&#x2F;&#x2F;bloomberg.github.io&#x2F;stricli&#x2F;</a>) for type-safe CLI argument parsing and code structuring. We&#x27;re also looking at building MCP servers out into standalone binaries which would remove the pre-requisite for node.js and npx when installing them. It&#x27;s also possible to register additional custom tools and resources on top of what we generate so you&#x27;re not locked out just because it&#x27;s generated code. The generated tool themselves are also regular ES modules. You can skip over most things and import them from the SDK and into your own MCP server if you&#x27;re building one yourself.