Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Neon 4 min read Opinion easyNovice

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

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.

Assumes: REST APIsOpenAPI specsLLM tool calling

Related posts

  • Give your agent Neon tools

    Neon mediumAdept

    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. A raw 1:1 OpenAPI-to-MCP mapping still makes a poor default even now that progressive tool discovery has eased context bloat, because agents need workflow-level operations such as branches.createAndConnect (create branch, attach compute, fetch connection string) rather than raw REST calls. The package now powers the hosted Neon MCP Server, which grows to 104 tools: 85 Management API tools plus 19 hand-written tools for SQL, migrations and diagnostics. The server can be filtered by category, scoped to a project or made read-only, and all non-read operations carry approval annotations that the host is responsible for enforcing.

  • You are Doing MCP Wrong: 3 Big Misconceptions

    Docker mediumAdept

    MCP is a model-facing protocol for LLM tool use and context exchange, not a replacement for REST or gRPC. Tools execute while agents plan, re-plan and evaluate, and MCP also covers resources, prompts and elicitations alongside tools. The recommended architecture treats MCP as the seam between a non-deterministic planning layer and a deterministic execution layer. Concrete patterns include wrapping existing APIs with tools that declare pre/postconditions, keeping the agent control loop outside tools with explicit stop criteria, versioning prompts in a registry, using elicitations for low-confidence branches, and tracing plan → tool → result for replay and audit.

  • Designing MCP tools for agents: Lessons from building Datadog’s MCP server

    Datadog Engineering mediumAdept

    Thin API wrappers make poor MCP tools: agents flood their context windows, blow token budgets on oversized records, and infer trends from raw samples. Datadog's MCP server fixes this with token-efficient formats (CSV/TSV for flat data, YAML for nested), trimmed default fields, and pagination by token budget instead of record count, fitting about 5x more records per token. It also exposes a SQL query interface over logs, which made eval runs about 40% cheaper. Other lessons: keep tool count low with flexible tools, opt-in toolsets or layering; return specific, actionable error messages; offer a RAG docs-search tool; and include guidance hints in tool results.

  • What’s MCP all about? Comparing MCP with LLM function calling

    Neon mediumAdept

    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. A Home Assistant light-control function is implemented both ways. The first version uses OpenAI tool definitions in JSON, with the app parsing tool_calls and executing them itself. The second is an MCP server built with the TypeScript SDK, a Zod schema and stdio transport, registered in Cursor. The takeaway is that function calling leaves discovery and execution to each app, while MCP standardizes them so tools can be reused across agents like Cursor, Windsurf and Claude Desktop.

  • 5 Best Practices for Building, Testing, and Packaging MCP Servers

    Docker mediumAdept

    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. Tool names and descriptions double as documentation for agents, while user docs explain the value. Test the connect, list-tools and tool-call lifecycle with the MCP Inspector or `docker mcp` commands, and open connections per tool call rather than at startup so tools can be listed even when the server is misconfigured. Package servers as Docker images using stdio transport for submission to the Docker MCP Catalog.

The quest for software engineering knowledge.

Look:
Layout: