> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getmcp.com/llms.txt
> Use this file to discover all available pages before exploring further.

# OpenAPI Import

> Import all endpoints from an OpenAPI 3.x spec and generate tools automatically.

## Overview

The OpenAPI Import feature reads an OpenAPI 3.x specification and turns every operation into a GetMCP tool in one step. Instead of configuring each endpoint manually, you give GetMCP the spec and it creates the full tool list — with correct HTTP methods, URL templates, parameter schemas, and descriptions pulled directly from the spec.

This is useful when:

* Your API already has an OpenAPI spec (most modern APIs do)
* You want to expose dozens of endpoints without configuring them one by one
* You want parameter types, descriptions, and required flags imported automatically

<Note>
  For Swagger 2.0 specs, use [Swagger Import](/docs/guides/swagger-import). For Postman collections, use [Postman Import](/docs/guides/postman-import).
</Note>

## How to Use

<img src="https://mintcdn.com/infiwebs/gDJxCN8mnpgMsXPG/images/import-options.png?fit=max&auto=format&n=gDJxCN8mnpgMsXPG&q=85&s=5dbac5e035ea5e84a1b33ce99eede3ec" alt="Tool creation method selector — choose From OpenAPI spec" width="1406" height="658" data-path="images/import-options.png" />

<Steps>
  <Step title="Open the Import Dialog">
    Navigate to your server's **Tools** tab and click the **Import** dropdown, then select **OpenAPI / Swagger**. The three-step import modal opens.
  </Step>

  <Step title="Provide the Spec">
    Choose how to provide the spec — paste text, upload a file, or fetch from a URL.

    <img src="https://mintcdn.com/infiwebs/gDJxCN8mnpgMsXPG/images/openapi-spec.png?fit=max&auto=format&n=gDJxCN8mnpgMsXPG&q=85&s=ce94c8ff3c53e5a057cd0fb8b8410bec" alt="OpenAPI import dialog — paste text with spec content" width="1012" height="735" data-path="images/openapi-spec.png" />

    **Paste text** — copy the JSON or YAML spec content and paste it directly.

    **Upload file** — drag and drop or click to select a `.json`, `.yaml`, or `.yml` file (up to 10 MB).

    **Fetch from URL** — enter a public URL pointing to the spec (e.g. `https://api.example.com/openapi.json`). Private IPs are blocked; if fetch fails, paste the spec instead.

    Then click **Parse**.
  </Step>

  <Step title="Select Operations to Import">
    GetMCP parses the spec and shows a preview table listing every discovered operation with its HTTP method, path, name, and description.

    <img src="https://mintcdn.com/infiwebs/gDJxCN8mnpgMsXPG/images/parse-openapi-spec.png?fit=max&auto=format&n=gDJxCN8mnpgMsXPG&q=85&s=53cdbdac9e5df89de98f05b38c623653" alt="OpenAPI import preview — operations list with method, name, and path" width="1008" height="842" data-path="images/parse-openapi-spec.png" />

    * Check or uncheck individual operations
    * Use **Select all** / **Deselect all** to bulk-toggle
    * Operations with warnings are flagged — hover to see what needs attention
    * Choose **On conflict**: skip existing tools (default) or create duplicates

    Click **Import N tools** when ready.
  </Step>

  <Step title="Review Results">
    The result screen shows how many tools were created, skipped (already exist), or failed with the specific error.

    Click **Done** to return to the tools list.
  </Step>
</Steps>

## What Gets Imported

| Spec Field                                            | Imported As                                                      |
| ----------------------------------------------------- | ---------------------------------------------------------------- |
| Operation `operationId` / `summary`                   | Tool name                                                        |
| Operation `description`                               | Tool description                                                 |
| HTTP method (`get`, `post`, `put`, `patch`, `delete`) | HTTP Method                                                      |
| `servers[0].url` + path                               | Endpoint URL                                                     |
| Path parameters (`in: path`)                          | Input parameters mapped to Path                                  |
| Query parameters (`in: query`)                        | Input parameters mapped to Query String                          |
| `requestBody` fields (JSON)                           | Input parameters mapped to Request Body                          |
| `required: [...]` array                               | Required flags on parameters                                     |
| Parameter `description`                               | Parameter description                                            |
| Parameter `type` / `schema`                           | Parameter type (string, integer, number, boolean, array, object) |

<Note>
  Auth headers detected in the spec's `securitySchemes` are noted in the preview but not stored as credentials. Configure production credentials after import in **Server Settings → Authentication**.
</Note>

## Supported Spec Versions

| Version       | Support                                                   |
| ------------- | --------------------------------------------------------- |
| OpenAPI 3.0.x | Full support                                              |
| OpenAPI 3.1.x | Full support                                              |
| Swagger 2.0   | Use [Swagger Import](/docs/guides/swagger-import) instead |

## Tips

<Tip>
  Most API providers publish their OpenAPI spec at a predictable URL — often `/openapi.json`, `/api-docs`, or linked from the developer docs. Try the URL input first to avoid copy-pasting large files.
</Tip>

<Tip>
  After import, review each tool's description. The spec's `operationId` often becomes the tool name — rename it to something more natural if needed (e.g. `getUserById` → `get_user`).
</Tip>

<Warning>
  Operations with very large request body schemas (over 64 KB) are skipped with a warning. Simplify the schema or configure those tools manually.
</Warning>
