Overview

The Model Context Protocol (MCP) is an open protocol that connects your functions to LLMs and AI applications. With Mintlify’s integration, you can automatically generate an MCP server from your existing documentation or OpenAPI specifications, enabling seamless AI-powered interactions with your product.

Quick Usage Guide

Any public documentation hosted on Mintlify can be extracted as an MCP server using a simple command:

npx @mintlify/mcp add <your-subdomain-or-domain>

Examples:

# Using subdomain
npx @mintlify/mcp add mintlify

# Using domain
npx @mintlify/mcp add mintlify.com

Authentication

When you run the command, you’ll need to provide two API keys, External Admin Key and Chat API Key.

These can be found in your Mintlify Dashboard under Settings > API Keys.

Select MCP Clients

After authentication, you’ll choose which MCP clients to enable for your server:

Once configured, your MCP server is ready to use with the command provided in the terminal.

Configuring Your MCP Server

Now let’s take a look at how to configure your MCP server.

Default Functionality

All MCP servers include the search tool by default, allowing users to query information across your entire documentation.

Adding API Functions

If you have an OpenAPI specification, you can expose specific endpoints as MCP tools by using the x-mcp extension at either the file or endpoint level.

File-Level Configuration

Enable MCP for all endpoints in a specification file:

{
  "openapi": "3.1.0",
  "x-mcp": {
    "enabled": true
  },
  // Other OpenAPI content
}

Endpoint-Level Configuration

Enable MCP for specific endpoints only:

{
  "paths": {
    "/api/v1/users": {
      "x-mcp": {
        "enabled": true
      },
      // Endpoint configuration
    }
  }
}

Authentication Handling

If your OpenAPI spec defines authentication using securitySchemes, these authentication methods will be automatically applied to your MCP server.

Monitoring Your MCP Server

After publishing your changes, you can view all available MCP tools in the Available Tools section on the MCP server page in your dashboard.

Distribution

User Installation

Your users can install and use your MCP server with:

npx @mintlify/mcp add <your-subdomain-or-domain>

This provides them with a ready-to-use MCP server that connects your documented functions to AI applications.