Skip to main content

What is OpenAPI MCP Server?

The OpenAPI MCP Server feature allows you to automatically create an MCP server from any existing OpenAPI (Swagger) specification. Instead of manually coding an MCP server to expose your API endpoints, TrueFoundry parses your OpenAPI spec and generates tools for each endpoint automatically. This is particularly useful when you want to:
  • Quickly expose existing REST APIs as MCP tools for AI agents
  • Avoid duplicating API definitions between your backend and MCP server
  • Quickly create a POC for development

How It Works

When you provide an OpenAPI specification, TrueFoundry:
  1. Parses the OpenAPI spec to extract all available endpoints, their parameters, request bodies, and response schemas
  2. Generates MCP tools for each endpoint with appropriate input schemas derived from the OpenAPI definition
  3. Creates a OpenAPI MCP server that proxies requests to your actual API endpoints
  4. Handles authentication based on the security schemes defined in your OpenAPI spec
OpenAPI ElementMCP MappingNotes
operationIdTool nameUses operationId if present; otherwise generates a name
summary / descriptionTool descriptionUses summary if available, falls back to description
parameters + requestBodyTool inputSchemaCombined into a single input schema
responsesTool outputSchemaResponse schema

Create an OpenAPI MCP Server

Follow the interactive demo below to create and configure an MCP server from your OpenAPI specification:
1

Navigate to MCP Servers

Go to the MCP Servers tab in the TrueFoundry AI Gateway and click Add Server.
2

Select OpenAPI Source

Click From OpenAPI spec. You can provide your OpenAPI specification in one of the following ways:
MethodDescription
URLProvide a publicly accessible URL to your OpenAPI JSON or YAML file
Paste ContentPaste the raw OpenAPI specification content
3

Select Tools and Configure

After providing the OpenAPI spec, select the tools you want to expose. For each tool, you can configure:
FieldDescription
Tool NameThe name used to call the tool (defaults to operationId from the spec)
Tool DescriptionA description to help AI agents understand when to use this tool
4

Configure Server Details

Provide the following configuration for your OpenAPI MCP Server:
FieldDescription
NameA descriptive name for the MCP server (e.g., my-api-server)
DescriptionA brief description of what this MCP server provides
OpenAPI Server URLThe base URL of your API server where requests will be proxied
5

Configure Authentication and Access Controls

Set up authentication based on how your API is secured. See MCP Gateway Auth & Security for detailed authentication options and Access Control for managing permissions.
6

Create and Test

Click Create to generate your OpenAPI MCP Server. Once created, you can:
  • Test tools in the Playground
  • View generated tools in the Tools tab
  • Get integration snippets from the How To Use tab

Frequently Asked Questions

TrueFoundry supports OpenAPI 3.0 and 3.1 specifications.
Yes, you can update the OpenAPI specification at any time. Navigate to the MCP server settings and upload a new spec or update the URL. Tools will be regenerated based on the updated specification.
API errors are passed through to the AI agent as tool execution failures. The error response body and status code are included in the error message, allowing the agent to handle or report the error appropriately.
Yes. Configure the appropriate authentication method when creating the MCP server. The gateway handles injecting authentication headers or tokens into every request made to your API.
Yes. Once your OpenAPI MCP Server is created, you can include its tools in a Virtual MCP Server to create curated tool collections that combine endpoints from multiple APIs.

Best Practices

Use Descriptive Operation IDs

Ensure your OpenAPI spec has clear operationId values as these become tool names that AI agents use.

Document Parameters Well

Include detailed descriptions for all parameters as this helps AI agents understand when and how to use each tool.

Secure Sensitive Endpoints

Use endpoint filtering to exclude administrative or destructive operations from the MCP server.