Build an MCP server from an OpenAPI or Swagger specification using the mcp-use TypeScript SDK. Each operation in the specification becomes an MCP tool the LLM can call. The server runs locally for testing using streamable HTTP transport and can be deployed using the provided deploy script.
Tasks
Dereference the OpenAPI or Swagger document into a single JSON object on disk before mapping operations.
Map OpenAPI parameters and request bodies to a merged Zod object schema for the MCP tool definition.
Inputs
OpenAPI 3.x or Swagger 2.0 document
File path, URL, or pasted specification content
Outputs
MCP server exposing REST API operations as individual tools
Dereferenced JSON specification file
Limitations and checks
Transport must be streamable HTTP, not stdio.
OpenAPI circular references are kept as-is and must be treated as opaque object types in Zod.
Verify that the correct scaffold template was chosen: `--template mcp-apps` if any widgets are needed, otherwise `--template blank`.
Search the dereferenced specification file to confirm there are no remaining `$ref` pointers.
Ensure authentication secrets are read from environment variables and are never placed directly in the conversation or committed to the repository.
AI Search
Find projects, verify facts, compare options, or turn a complex need into an actionable plan
Try a searchA click only fills the search box; you stay in control