Swagger MCP Server

The Swagger MCP Server lets you connect Swagger Studio to AI-powered assistants like Claude, GitHub Copilot, and Cursor. Once connected, you can search for APIs or domains, create or update definitions, and run governance checks - all through natural-language conversations inside your AI tool.

Note that only selected public APIs are accessible through the MCP server.

What is an MCP server?

The Model Context Protocol (MCP) is an open standard that allows AI assistants to communicate with external tools and data sources. It provides a structured way for AI clients to discover what tools are made available by an MCP server, understand what each tool does, and call those tools to retrieve data or perform actions.

The Swagger MCP Server implements this standard for Swagger Studio. It gives your AI assistant a set of tools it can implement on your behalf - for example, searching your API catalog or running a governance scan. Once you enter your request in plain English, the assistant selects and calls the appropriate tool, and displays the results.

The Swagger MCP Server is open source and available at GitHub.

Available Swagger Studio tools

Once your AI assistant connects to the Swagger MCP Server, it can access the following Swagger Studio tools:

Tool

Actions

search_apis_and_domains

Searches for APIs and domains in Swagger Studio based on the specified criteria.

Returns a list of APIs and domains matching the search parameters, along with metadata such as owner, name, description, version, and specification.

get_api_definition

Retrieves a complete, resolved API based on the specified owner, name, and version.

create_or_update_api

Creates a new API or updates an existing one in the registry, based on the specified owner, name, and definition content. If an API matching the owner and name exists, it is updated - if not, the operation creates a new API.

Returns the API's metadata, including owner, name, version, Swagger Studio URL, and operation type.

create_api_from_prompt

Generates and saves an API from a natural-language prompt using SmartBear AI, ensuring compliance with your organization’s governance rules.

Returns the API's metadata, including owner, name, specification, version, Swagger Studio URL, and operation type.

scan_api_standardization

Runs a governance scan against an API using your organization’s style guides.

Returns a list of validation errors and warnings, including severity, rule name, and location.

standardize_api

Scans an API for governance issues and automatically fixes them using SmartBear AI. Depending on the provided prompt, it can save the fixed API as a new version instead of overwriting the current one.

Returns a scan summary with the number and details of detected errors, including a description, line number, and severity.

list_organizations

Returns the list of organizations you belong to, including their names, descriptions, and member counts.

For guidance on the available tools for other SmartBear products, see MCP Server Capabilities.

Choose the connection mode

You can connect to the Swagger MCP Server in two ways: through the Remote MCP Server hosted by Swagger, or by running the MCP Server locally as an npm package. The following table summarizes the differences between these two options:

Remote MCP Server

Local MCP Server

Setup

No installation required. Add a single URL to your AI client.

Requires Node.js 20 or later and npm on your machine.

Authentication

OAuth sign-in through your browser. No API key required.

Requires a Swagger API key, supplied as an environment variable.

Updates

Automatic and managed by SmartBear. The hosted server is always current.

Manual. Update your npm package when a new version is released.

On-premise support

Swagger Studio SaaS only.

Available for both SaaS and On-premise Swagger Studio instances.

Suitable for

Quick start, SaaS users, no-install environments.

On-premise installations, CI/CD pipelines, and offline use.

Access and security

The Swagger MCP Server respects the same access controls you have in Swagger Studio . You will only see the APIs and domains that your account has permission to view. Organization-level roles and resource-level roles both apply.

In the Remote MCP Server, authentication goes through a secure browser sign-in flow (OAuth). Your Swagger password is never sent to your AI client. Requests and responses are transmitted over HTTPS, and no API data is stored beyond what is needed to complete a single request.

In the Local MCP Server, your API key is passed as an environment variable to the local process. To keep it safe:

  • Use your editor's secure input feature (like the VS Code promptString method) instead of writing the key directly in a config file.

  • Do not commit configuration files that contain your API key to version control.

  • Rotate your key periodically in Swagger under Settings > API Keys.

Remote MCP Server

The Swagger Remote MCP Server is a hosted version of the Swagger MCP Server, managed by SmartBear. Your AI client connects to the server through HTTPS, with no installation or local setup required.

When you add the Swagger Remote MCP Server URL to your AI client, the client sends tool requests to the hosted server over a secure connection. The server calls the Swagger Studio APIs, retrieves the results, and returns them to your AI client. The first time you connect, a browser window opens and prompts you to sign in with your Swagger account. Subsequent requests are authenticated automatically.

The Swagger Remote MCP Server for Swagger Studio is available at: https://swagger.mcp.smartbear.com/mcp.

Connect your AI client to the Swagger Remote MCP Server

To configure a connection between your AI assistant and the Remote MCP Server, do the following:

VS Code with GitHub Copilot

  1. Open the Command Palette (Ctrl+Shift+P on Windows/Linux, Cmd+Shift+P on macOS).

  2. Run MCP: Add Server… and select HTTP (Remote).

  3. Enter the URL https://swagger.mcp.smartbear.com/mcp and give the server a name (for example, smartbear-swagger).

  4. First-time authentication: a browser window opens. Sign in with your Swagger account to authorize the connection. Subsequent requests are authenticated automatically.

Alternatively, create or edit .vscode/mcp.json in your workspace:

{
  "servers": {
    "smartbear-swagger": {
      "type": "http",
      "url": "https://swagger.mcp.smartbear.com/mcp"
    }
  }
}

As with the Command Palette method, you are prompted to sign in with your Swagger account the first time you use the server.

Cursor

  1. Open your mcp.json configuration file.

  2. Add the following:

    {
      "mcpServers": {
        "smartbear-swagger": {
          "transport": {
            "type": "http",
            "url": "https://swagger.mcp.smartbear.com/mcp"
          }
        }
      }
    }
    
  3. Save the file.

  4. First-time authentication: a browser window opens. Sign in with your Swagger account to authorize the connection. Subsequent requests are authenticated automatically.

Claude Desktop

  1. Open your Claude Desktop configuration file:

    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

    • Windows: %APPDATA%\Claude\claude_desktop_config.json

  2. Add the following to the file:

    {
      "mcpServers": {
        "smartbear-swagger": {
          "transport": {
            "type": "http",
            "url": "https://swagger.mcp.smartbear.com/mcp"
          }
        }
      }
    }
    
  3. Save the file and restart Claude Desktop.

  4. First-time authentication: a browser window opens. Sign in with your Swagger account to authorize the connection. Subsequent requests are authenticated automatically.

Claude Code

  1. Run the following command in your terminal:

    claude mcp add --transport http smartbear-swagger https://swagger.mcp.smartbear.com/mcp
    
  2. First-time authentication: a browser window opens. Sign in with your Swagger account to authorize the connection. Subsequent requests are authenticated automatically.

Publication date: