---
title: "Auto-generating MCP Servers from OpenAPI Schemas: Yay or Nay?"
description: "Auto-generating an MCP server as a 1:1 mapping of an OpenAPI spec works poorly."
url: "https://swe.quest/articles/auto-generating-mcp-servers-from-openapi-schemas-yay-or-nay-ddbbf7dc3df515f6"
canonical: "https://neon.com/blog/autogenerating-mcp-servers-openai-schemas"
source: "Neon"
published: "2025-05-01"
difficulty: "easy"
kind: "Opinion"
reading_minutes: 4
tags: ["ai-agents","api-design","llms"]
---

# Auto-generating MCP Servers from OpenAPI Schemas: Yay or Nay?

A post on [Neon](https://swe.quest/sources/neon.md), published 2025-05-01, 4 min read, Opinion. Original: [https://neon.com/blog/autogenerating-mcp-servers-openai-schemas](https://neon.com/blog/autogenerating-mcp-servers-openai-schemas)

## Summary

Auto-generating an MCP server as a 1:1 mapping of an OpenAPI spec works poorly. LLMs struggle to pick among hundreds of similar tools (GitHub's API has over 600 operations), handle complex JSON payloads and optional parameters badly, and resource-centric REST endpoints don't match the task-level workflows agents perform. The recommended hybrid is to use codegen as a starting point, aggressively prune the generated tools, and rewrite descriptions to explain when and why to use each one. Then add higher-level tools that wrap multi-step workflows, while staying cautious about statefulness. Neon built its open-source MCP server this way on top of its TypeScript SDK, including a workflow for running and testing database migrations.

Written by swe.quest, not by the author.

**Difficulty:** Easy: no special background needed; explains what something is and why it matters

## Topics

- [AI agents](https://swe.quest/tags/ai-agents.md) (AI & ML)
- [API design](https://swe.quest/tags/api-design.md) (Backend & APIs)
- [LLMs](https://swe.quest/tags/llms.md) (AI & ML)

## Prerequisites

- REST APIs ([easy posts on API design](https://swe.quest/tags/api-design.md?difficulty=easy))
- OpenAPI specs
- LLM tool calling ([easy posts on LLMs](https://swe.quest/tags/llms.md?difficulty=easy))

## Keywords

Model Context Protocol, OpenAPI, Neon, Tadata, openapisearch, FastAPI

## Related posts

- [Give your agent Neon tools](https://swe.quest/articles/give-your-agent-neon-tools-25669ff9dbbd96d7.md): Neon · 2026-09-03 · Medium · 7 min read · AI agents, API design, TypeScript, PostgreSQL
  Neon's new @neon/tools package turns the ergonomic @neon/sdk client into typed agent tools, using Zod request schemas generated from the OpenAPI spec, with adapters for MCP, Mastra and Vercel's Eve.
- [You are Doing MCP Wrong: 3 Big Misconceptions](https://swe.quest/articles/you-are-doing-mcp-wrong-3-big-misconceptions-4ed8974e9536c439.md): Docker · 2025-09-03 · Medium · 4 min read · AI agents, LLMs, API design, Observability
  MCP is a model-facing protocol for LLM tool use and context exchange, not a replacement for REST or gRPC.
- [Designing MCP tools for agents: Lessons from building Datadog’s MCP server](https://swe.quest/articles/designing-mcp-tools-for-agents-lessons-from-building-datadog-s-mcp-server-d09621598f568627.md): Datadog Engineering · 2026-03-04 · Medium · 8 min read · AI agents, API design, LLMs, Observability
  Thin API wrappers make poor MCP tools: agents flood their context windows, blow token budgets on oversized records, and infer trends from raw samples.
- [What’s MCP all about? Comparing MCP with LLM function calling](https://swe.quest/articles/what-s-mcp-all-about-comparing-mcp-with-llm-function-calling-fcce1ee01a7d0aed.md): Neon · 2025-03-12 · Medium · 5 min read · AI agents, LLMs, TypeScript
  The Model Context Protocol (MCP) builds on LLM function calling by moving tool definitions and execution out of individual LLM applications into standalone servers that any MCP-compatible client can discover and invoke.
- [5 Best Practices for Building, Testing, and Packaging MCP Servers](https://swe.quest/articles/5-best-practices-for-building-testing-and-packaging-mcp-servers-156585fac07369be.md): Docker · 2025-07-03 · Medium · 7 min read · AI agents, Containers, API design, Testing
  MCP servers work best when designed around the agent as the real caller: keep a small "tool budget" by grouping endpoints into use-case tools and prompts instead of one tool per API endpoint, and return error messages that tell the agent what to fix (e.g., an invalid API\_TOKEN configuration) rather than human-facing denials.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
