<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Christopher Dondici</title>
    <description>The latest articles on DEV Community by Christopher Dondici (@christopherdond).</description>
    <link>https://dev.to/christopherdond</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4134549%2F61502346-cb3b-486e-abb3-cd468d7ac1a1.jpg</url>
      <title>DEV Community: Christopher Dondici</title>
      <link>https://dev.to/christopherdond</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/christopherdond"/>
    <language>en</language>
    <item>
      <title>I turned a real OpenAPI into an MCP server in 5 min (without losing custom code on regen)</title>
      <dc:creator>Christopher Dondici</dc:creator>
      <pubDate>Sun, 20 Sep 2026 19:50:35 +0000</pubDate>
      <link>https://dev.to/christopherdond/i-turned-a-real-openapi-into-an-mcp-server-in-5-min-without-losing-custom-code-on-regen-2j2k</link>
      <guid>https://dev.to/christopherdond/i-turned-a-real-openapi-into-an-mcp-server-in-5-min-without-losing-custom-code-on-regen-2j2k</guid>
      <description>&lt;p&gt;I built an OpenAPI to MCP server generator for TypeScript, Python and Go.&lt;/p&gt;

&lt;p&gt;The v1 mistake: 1 endpoint = 1 tool. On a real API with 200 operations, you get a 200-tool server. Nobody can use that. That was the exact feedback I got on Reddit, and it was right.&lt;/p&gt;

&lt;p&gt;What I changed in 2.1.5:&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Grouping by tag or path
&lt;/h2&gt;

&lt;p&gt;200 operations across 8 tags become ~8 tools. Each group routes internally by &lt;code&gt;action&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;node dist/cli/index.js generate -i api.yaml -o ./out --group-by tag&lt;br&gt;
node dist/cli/index.js generate -i api.yaml -o ./out --include-tags pets --group-by tag&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Filter before you generate&lt;br&gt;
Only generate what you will use:&lt;br&gt;
node dist/cli/index.js generate -i api.yaml -o ./out --path-prefix "/users/&lt;strong&gt;"&lt;br&gt;
node dist/cli/index.js generate -i api.yaml -o ./out --include-paths "/users/&lt;/strong&gt;,/orders/&lt;em&gt;" --exclude-paths "/users/internal/&lt;/em&gt;"&lt;br&gt;
node dist/cli/index.js generate -i api.yaml -o ./out --operation-allowlist listPets,createPet&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Regen without losing custom code&lt;br&gt;
Your code lives between markers and survives regen with a 3-way merge:&lt;br&gt;
// @@mcp-gen:start:get_pets&lt;br&gt;
const user = await db.users.findById(args.id);&lt;br&gt;
return { content: [{ type: "text", text: JSON.stringify(user) }] };&lt;br&gt;
// @@mcp-gen🔚get_pets&lt;br&gt;
node dist/cli/index.js generate -i api.yaml -o ./out --incremental&lt;br&gt;
Reusable logic goes in handlers.custom.* — never overwritten without --force.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Fase 0 P0 fixes in 2.1.5&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;TypeScript: real query serialization (get_pets({ limit: 5 }) -&amp;gt; /pets?limit=5)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Python: _build_query / _build_headers in --http mode, including grouped tools&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Go: --http wired to the real APIClient, no more not yet wired stubs&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Registry is v3-only with actionable errors for removed keys and v2 specs&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Try it with the repo example&lt;br&gt;
git clone &lt;a href="https://github.com/ChristopherDond/MCP-Generator.git" rel="noopener noreferrer"&gt;https://github.com/ChristopherDond/MCP-Generator.git&lt;/a&gt;&lt;br&gt;
cd MCP-Generator&lt;br&gt;
npm ci&lt;br&gt;
npm run build&lt;br&gt;
node dist/cli/index.js generate -i examples/petstore.yaml -l typescript -o ./my-server&lt;br&gt;
node dist/cli/index.js validate -i examples/petstore.yaml&lt;br&gt;
Or install directly:&lt;/p&gt;

&lt;p&gt;npm install -g @christopher_dondici/&lt;a href="mailto:mcp-gen@2.1.5"&gt;mcp-gen@2.1.5&lt;/a&gt;&lt;br&gt;
Repo: &lt;a href="https://github.com/ChristopherDond/MCP-Generator" rel="noopener noreferrer"&gt;https://github.com/ChristopherDond/MCP-Generator&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Validated with npm run build + npm test (11 suites, 196 tests).&lt;/p&gt;

</description>
      <category>mcp</category>
      <category>ai</category>
      <category>opensource</category>
      <category>openapi</category>
    </item>
  </channel>
</rss>
