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

# OpenAPI to MCP

> Easiest way to power your AI agents with your API based tools

## Convert Your APIs into an MCP Server

Sometimes, you don’t want to rely on prebuilt integrations—you want to bring your own APIs. With Contexa, you can convert any OpenAPI spec into an MCP-compatible server in minutes. Whether it's a single internal service or a bundle of APIs, you can package them under one MCP server, giving your AI agents seamless access via a single URL.

<Check>
  Contexa's OpenAPI-to-MCP converter automatically parses your spec, detects endpoints, and transforms them into structured tools. All you need to do is upload your spec, fine-tune the descriptions, and deploy. No manual tool-wrapping, no boilerplate code.
</Check>

### How to deploy an MCP server from your OpenAPI spec

1. **Go to the “Create MCP Server” section** and select **“From OpenAPI specs.”**

   <img src="https://mintcdn.com/contexaai-ae648e0a/6uNgbXU7OVN59NRE/images/Screenshot2025-08-07at10.46.34AM.png?fit=max&auto=format&n=6uNgbXU7OVN59NRE&q=85&s=1b19ee4b84cbf0c5ef9f0a648a27aea5" alt="Screenshot2025 08 07at10 46 34AM Pn" width="1526" height="938" data-path="images/Screenshot2025-08-07at10.46.34AM.png" />
2. **Enter a name** for your server and **upload your OpenAPI file** (YAML or JSON).

   <img src="https://mintcdn.com/contexaai-ae648e0a/6uNgbXU7OVN59NRE/images/Screenshot2025-08-07at10.47.40AM.png?fit=max&auto=format&n=6uNgbXU7OVN59NRE&q=85&s=4b49e1ef9b1b5e87072d8fea6e3679c6" alt="Screenshot2025 08 07at10 47 40AM Pn" width="2880" height="1554" data-path="images/Screenshot2025-08-07at10.47.40AM.png" />
3. **Review your endpoints**—Contexa will automatically detect and list all available routes.

   * Use method filters (GET, POST, PUT, etc.)
   * Toggle only the endpoints you want to include

   <img src="https://mintcdn.com/contexaai-ae648e0a/6uNgbXU7OVN59NRE/images/Screenshot2025-08-07at12.00.15PM.png?fit=max&auto=format&n=6uNgbXU7OVN59NRE&q=85&s=89e0aa42caa8c6c15161c9a7dc02c5b3" alt="Screenshot2025 08 07at12 00 15PM Pn" width="2754" height="1430" data-path="images/Screenshot2025-08-07at12.00.15PM.png" />
4. **Edit tool descriptions** to make them clear and LLM-friendly.

   * Use the built-in **AI generator** if you want help crafting descriptions.

   <img src="https://mintcdn.com/contexaai-ae648e0a/6uNgbXU7OVN59NRE/images/Screenshot2025-08-07at10.48.14AM.png?fit=max&auto=format&n=6uNgbXU7OVN59NRE&q=85&s=6b1c3f7108c58394f1b02abb2c3acfda" alt="Screenshot2025 08 07at10 48 14AM Pn" width="2742" height="1428" data-path="images/Screenshot2025-08-07at10.48.14AM.png" />
5. **Configure environment variables**, if needed.

   * Contexa detects them automatically and prompts you for values
   * Optionally enable **request tracing**

   <img src="https://mintcdn.com/contexaai-ae648e0a/6uNgbXU7OVN59NRE/images/Screenshot2025-08-07at10.48.53AM.png?fit=max&auto=format&n=6uNgbXU7OVN59NRE&q=85&s=f8aff9757fdafa5672052cb0103718e9" alt="Screenshot2025 08 07at10 48 53AM Pn" width="2746" height="1428" data-path="images/Screenshot2025-08-07at10.48.53AM.png" />
6. **Click “Deploy.”**
   * Your MCP server is now live and accessible via a unique URL

Once deployed, you can test it instantly in the Playground or connect it directly to any AI agent platform that supports MCP—like Cursor, Windsurf, Claude, or VS Code.

<img src="https://mintcdn.com/contexaai-ae648e0a/6uNgbXU7OVN59NRE/images/Screenshot2025-08-07at12.17.34PM.png?fit=max&auto=format&n=6uNgbXU7OVN59NRE&q=85&s=353eafaff93dd9b5d9d45c825b0f503a" alt="Screenshot2025 08 07at12 17 34PM Pn" width="2736" height="1436" data-path="images/Screenshot2025-08-07at12.17.34PM.png" />

**Example configurations for your MCP servers:**

<Tabs>
  <Tab title="Cursor">
    ```json theme={null}
    {
    "mcpServers": {
     "Context7": {
       "url": "https://mcp.contexaai.com/v1/4n0lNwENz_PRUHUfPIXC/mcp"
     }
    }
    }
    ```
  </Tab>

  <Tab title="Windsurf">
    ```json theme={null}
    {
      "mcpServers": {
        "Context7": {
          "command": "npx",
          "args": [
            "mcp-remote",
            "https://mcp.contexaai.com/v1/4n0lNwENz_PRUHUfPIXC/mcp"
          ]
        }
      }
    }
    ```
  </Tab>

  <Tab title="Claude">
    ```json theme={null}
    {
      "mcpServers": {
        "Context7": {
          "command": "npx",
          "args": [
            "mcp-remote",
            "https://mcp.contexaai.com/v1/4n0lNwENz_PRUHUfPIXC/mcp"
          ]
        }
      }
    }
    ```
  </Tab>

  <Tab title="VS Code">
    ```json theme={null}
    {
      "servers": {
        "Context7": {
          "type": "sse",
          "url": "https://mcp.contexaai.com/v1/4n0lNwENz_PRUHUfPIXC/mcp"
        }
      }
    }
    ```
  </Tab>
</Tabs>

<Note>
  After deploying your server, you can start using the server across any MCP compatible client by copying the config and pasting it in the mcp.json file for your respective client.
</Note>
