<?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: lorenzosaraiva</title>
    <description>The latest articles on DEV Community by lorenzosaraiva (@lorenzosaraiva).</description>
    <link>https://dev.to/lorenzosaraiva</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3806279%2F6f721c25-3f41-45ec-a66e-d2e3a87ed45a.png</url>
      <title>DEV Community: lorenzosaraiva</title>
      <link>https://dev.to/lorenzosaraiva</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/lorenzosaraiva"/>
    <language>en</language>
    <item>
      <title>How I Turned 1,079 GitHub API Endpoints into 25 AI-Ready Tools</title>
      <dc:creator>lorenzosaraiva</dc:creator>
      <pubDate>Wed, 04 Mar 2026 17:22:09 +0000</pubDate>
      <link>https://dev.to/lorenzosaraiva/how-i-turned-1079-github-api-endpoints-into-25-ai-ready-tools-2ga8</link>
      <guid>https://dev.to/lorenzosaraiva/how-i-turned-1079-github-api-endpoints-into-25-ai-ready-tools-2ga8</guid>
      <description>&lt;p&gt;If you've tried connecting an AI assistant to a REST API through MCP (Model Context Protocol), you've probably hit the same wall I did: the tooling either doesn't exist for the API you need, or it generates hundreds of tools that make the LLM choke.&lt;/p&gt;

&lt;p&gt;I built &lt;a href="https://github.com/lorenzosaraiva/mcpforge" rel="noopener noreferrer"&gt;MCPForge&lt;/a&gt; to fix that. It's a CLI that takes any OpenAPI spec and generates a production-ready MCP server, with an AI optimization layer that curates endpoints down to the ones that actually matter.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Problem
&lt;/h2&gt;

&lt;p&gt;MCP is blowing up. Claude Desktop, Cursor, and a growing list of AI tools support it. But if you want to connect one of these tools to a REST API, you have two options:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Option 1: Write an MCP server by hand.&lt;/strong&gt; Define every tool, write HTTP handlers, wire up auth, handle errors, write a README. Hours of boilerplate per API.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Option 2: Auto-generate from the OpenAPI spec.&lt;/strong&gt; Tools like FastMCP and Stainless can do this. But the output is a 1:1 mapping of endpoints to tools. A big API like GitHub has over 1,000 endpoints. Dumping 1,000 tools on an LLM doesn't work. The context window fills up, tool selection gets confused, and the results are garbage.&lt;/p&gt;

&lt;p&gt;Even FastMCP's own documentation says auto-generated servers are better for prototyping than production use with LLMs.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Fix: AI-Powered Tool Curation
&lt;/h2&gt;

&lt;p&gt;MCPForge adds an intelligence layer between parsing and generation. After reading the OpenAPI spec, it sends the parsed endpoints to Claude and asks it to curate them like a senior API designer would.&lt;/p&gt;

&lt;p&gt;The optimizer:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Picks the 25 most useful endpoints for typical use cases&lt;/li&gt;
&lt;li&gt;Rewrites descriptions to be concise and action-oriented&lt;/li&gt;
&lt;li&gt;Drops noise like health checks, admin routes, and deprecated endpoints&lt;/li&gt;
&lt;li&gt;Groups related operations when it makes sense&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here are the real numbers from running it on three popular APIs:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;API&lt;/th&gt;
&lt;th&gt;Raw Endpoints&lt;/th&gt;
&lt;th&gt;After Optimization&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;GitHub&lt;/td&gt;
&lt;td&gt;1,079&lt;/td&gt;
&lt;td&gt;25&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Stripe&lt;/td&gt;
&lt;td&gt;587&lt;/td&gt;
&lt;td&gt;25&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Spotify&lt;/td&gt;
&lt;td&gt;97&lt;/td&gt;
&lt;td&gt;25&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Strict mode (the default) targets 25 or fewer tools. If you need broader coverage, there's a standard mode that caps at 80, or you can set a custom limit with &lt;code&gt;--max-tools&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  How It Works
&lt;/h2&gt;

&lt;p&gt;The whole flow is one command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx mcpforge init &lt;span class="nt"&gt;--optimize&lt;/span&gt; https://api.example.com/openapi.json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It parses the spec, runs the optimizer, and generates a complete TypeScript MCP server project with auth handling, error handling, and a README that includes copy-paste config for Claude Desktop and Cursor.&lt;/p&gt;

&lt;h3&gt;
  
  
  No OpenAPI Spec? No Problem.
&lt;/h3&gt;

&lt;p&gt;A lot of APIs don't publish an OpenAPI spec. MCPForge has a &lt;code&gt;--from-url&lt;/code&gt; mode that scrapes API documentation pages and uses Claude to infer the endpoint structure:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx mcpforge init &lt;span class="nt"&gt;--from-url&lt;/span&gt; https://docs.some-api.com/reference
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It's not as accurate as working from a spec, but it gets you 80% of the way there without any manual work.&lt;/p&gt;

&lt;h3&gt;
  
  
  Detecting Breaking Changes
&lt;/h3&gt;

&lt;p&gt;One thing that came up repeatedly in feedback: what happens when the upstream API changes its spec after you've generated a server?&lt;/p&gt;

&lt;p&gt;MCPForge has a &lt;code&gt;diff&lt;/code&gt; command that compares the current spec against what was used during generation and flags changes with risk scoring:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;High risk&lt;/strong&gt;: removed endpoints, parameter type changes, new required fields&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Medium risk&lt;/strong&gt;: response schema changes, deprecations&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Low risk&lt;/strong&gt;: new endpoints added, description updates
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;mcpforge diff
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This came directly from Reddit feedback. Someone pointed out that silent spec drift is worse than a loud failure, and they were right.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Learned Building This
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Feedback-driven development works.&lt;/strong&gt; I posted on Reddit and got real, specific feedback within hours. "100 tools is still too many" turned into strict mode. "What happens when specs change?" turned into the diff command. Building in public with fast iteration beats planning in private.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The moat isn't the code, it's the curation.&lt;/strong&gt; The actual code generation is straightforward. The hard part is making the AI optimizer produce genuinely good tool sets. The prompt engineering for that is where most of the iteration went.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;LLMs have strong opinions about tool count.&lt;/strong&gt; Through testing, I found that 20-30 tools is the sweet spot for most MCP clients. Below 15 and you're missing useful functionality. Above 50 and tool selection degrades noticeably.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try It
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# From an OpenAPI spec&lt;/span&gt;
npx mcpforge init &lt;span class="nt"&gt;--optimize&lt;/span&gt; https://petstore3.swagger.io/api/v3/openapi.json

&lt;span class="c"&gt;# From a docs page&lt;/span&gt;
npx mcpforge init &lt;span class="nt"&gt;--from-url&lt;/span&gt; https://jsonplaceholder.typicode.com/

&lt;span class="c"&gt;# Inspect a spec before generating&lt;/span&gt;
npx mcpforge inspect https://api.example.com/openapi.json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It's open source and MIT licensed: &lt;a href="https://github.com/lorenzosaraiva/mcpforge" rel="noopener noreferrer"&gt;github.com/lorenzosaraiva/mcpforge&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you try it on an API and something breaks, open an issue. The project is a few days old and there are definitely rough edges, especially on large or unusual specs.&lt;/p&gt;

</description>
      <category>mcp</category>
      <category>ai</category>
      <category>typescript</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
