跳到正文
DEV Community· Jeff·· 3 小時前AI 評分37

Cursor MCP 設定與 OpenAPI 生成的 MCP 伺服器比較

Cursor MCP Config vs an OpenAPI-Generated MCP Server

AI 導讀

Cursor 設定中的手寫 MCP 項目需要自行維護;OpenAPI 生成的 MCP 伺服器以 API 合約為依據,API 變更時可重新生成,並顯示各工具的來源。兩者都可向 Agent 提供工具;有合約的 API 可用生成伺服器,沒有規格的功能則可保留手寫項目。

正文

Jeff

Short answer: A hand-written MCP entry in Cursor's config is plumbing you maintain; a generated server is derived from the contract. Both expose tools to the agent, but only the generated one stays correct when the API changes and shows where each tool came from. The config is the connection; the spec is the source of truth.

What a hand-written entry gives you

You can point Cursor at any MCP server, including one you write yourself. That is flexible, and it is the right path for a capability that has no contract. The downside is that the server is now another artifact: its tools, parameters, and descriptions are maintained by hand and drift the moment the API changes.

What a generated server gives you

Property Hand-written Generated from OpenAPI
Tool source You Operations and schemas
Provenance Implicit Visible per tool
On contract change Manual edit Regenerates on save
Weak / skipped tools Silent Surfaced

The failure that generated servers avoid

The most common hand-written failure is a stale tool description: the endpoint moved, the parameter changed type, and the server still advertises the old shape. The agent trusts it and fails at runtime. A generated server cannot advertise a shape the contract does not declare.

They compose

You are not choosing one forever. Generate the server for the API you own, and keep hand-written entries for capabilities that genuinely have no spec.

This is part of the Powerduck vs Cursor comparison. Next, read why agents hallucinate API calls.

來源:DEV Community · dev.to