Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions api-playground/openapi-setup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
keywords: ["OpenAPI", "API specification", "Swagger"]
---

OpenAPI is a specification for describing APIs. Mintlify supports OpenAPI 3.0 and 3.1 documents to generate interactive API documentation and keep it up to date.

Check warning on line 7 in api-playground/openapi-setup.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

api-playground/openapi-setup.mdx#L7

Did you really mean 'APIs'?

## Add an OpenAPI specification file

Expand Down Expand Up @@ -60,7 +60,7 @@

### Specify the base URL for your API

To enable the API playground, add a `servers` field to your OpenAPI specification with your API's base URL.

Check warning on line 63 in api-playground/openapi-setup.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

api-playground/openapi-setup.mdx#L63

Did you really mean 'API's'?

```json
{
Expand Down Expand Up @@ -147,7 +147,7 @@
}
```

The `x-default` extension is supported on `apiKey` and `http` bearer security scheme types. The value appears as the default input in the playground's authentication fields.

Check warning on line 150 in api-playground/openapi-setup.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

api-playground/openapi-setup.mdx#L150

In general, use active voice instead of passive voice ('is supported').

You can also use `x-default` on any schema property in your OpenAPI specification to set a default value in the API playground without affecting the `default` field in the schema definition.

Expand Down Expand Up @@ -258,6 +258,65 @@
}
```

### MCP

Control which API endpoints are exposed as tools on your [MCP server](/ai/model-context-protocol) by adding `x-mint: mcp` to any operation. By default, all endpoints in your OpenAPI specification are available as MCP tools. Use this extension to disable specific endpoints, or to customize the tool name and description that AI applications see.

Check warning on line 263 in api-playground/openapi-setup.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

api-playground/openapi-setup.mdx#L263

In general, use active voice instead of passive voice ('are exposed').

```json {6-10}
{
"paths": {
"/users": {
"get": {
"summary": "List users",
"x-mint": {
"mcp": {
"enabled": false
}
}
}
}
}
}
```

The `mcp` object supports the following properties:

<ResponseField name="enabled" type="boolean" default="true">
Whether to expose this endpoint as an MCP tool. Set to `false` to hide the endpoint from your MCP server.
</ResponseField>

<ResponseField name="name" type="string">
Override the tool name that AI applications see. If not set, Mintlify generates a name from the operation ID or the HTTP method and path.
</ResponseField>

<ResponseField name="description" type="string">
Override the tool description that AI applications see. If not set, Mintlify uses the operation's `summary` or `description`.
</ResponseField>

You can customize the tool name and description to help AI applications understand when and how to use the endpoint:

```json {6-10}
{
"paths": {
"/users/search": {
"post": {
"summary": "Search users by filters",
"x-mint": {
"mcp": {
"name": "search_users",
"description": "Search for users by name, email, or role. Returns paginated results."
}
}
}
}
}
}
```

<Note>
The legacy `x-mcp` extension at the operation level is still supported but `x-mint: mcp` is preferred. If both are present, `x-mint: mcp` takes precedence.
</Note>

## Auto-populate API pages

Add an `openapi` field to any navigation element in your `docs.json` to automatically generate pages for OpenAPI endpoints. You can control where these pages appear in your navigation structure, as dedicated API sections or with other pages.
Expand Down Expand Up @@ -446,7 +505,7 @@

The method and path must exactly match your OpenAPI spec. If you have multiple OpenAPI specifications, include the path to the correct specification in your reference. You can also reference external OpenAPI URLs in `docs.json`.

#### Autogenerate endpoint pages

Check warning on line 508 in api-playground/openapi-setup.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

api-playground/openapi-setup.mdx#L508

Use 'autogenerat(e|ed|ing)?' instead of 'Autogenerate'.

To autogenerate MDX files from your OpenAPI specification, use the Mintlify [scraper](https://www.npmjs.com/package/@mintlify/scraping).

Expand Down Expand Up @@ -496,9 +555,9 @@

</CodeGroup>

## Webhooks

Check warning on line 558 in api-playground/openapi-setup.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

api-playground/openapi-setup.mdx#L558

Use 'webhooks?' instead of 'Webhooks'.

Webhooks are HTTP callbacks that your API sends to notify external systems when events occur. Webhooks are supported in OpenAPI 3.1+ documents.

Check warning on line 560 in api-playground/openapi-setup.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

api-playground/openapi-setup.mdx#L560

Use 'webhooks?' instead of 'Webhooks'.

Check warning on line 560 in api-playground/openapi-setup.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

api-playground/openapi-setup.mdx#L560

Use 'webhooks?' instead of 'Webhooks'.

Check warning on line 560 in api-playground/openapi-setup.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

api-playground/openapi-setup.mdx#L560

In general, use active voice instead of passive voice ('are supported').

Add a `webhooks` field to your OpenAPI document alongside the `paths` field.

Expand Down
Loading