diff --git a/api-playground/openapi-setup.mdx b/api-playground/openapi-setup.mdx index 43008bd4d..d101650ce 100644 --- a/api-playground/openapi-setup.mdx +++ b/api-playground/openapi-setup.mdx @@ -208,6 +208,72 @@ Add content before the auto-generated API documentation using `x-mint: content`. } ``` +### MCP + +Control which API endpoints are exposed as tools in your [MCP server](/ai/model-context-protocol) using `x-mint: mcp`. By default, all endpoints are available as MCP tools. Use this extension to exclude endpoints or customize how they appear to AI applications. + +```json {8-12} +{ + "paths": { + "/users": { + "get": { + "summary": "Get users", + "description": "Retrieve a list of users", + "x-mint": { + "mcp": { + "enabled": false + } + } + } + } + } +} +``` + +The `x-mint: mcp` extension supports these properties: + +| Property | Type | Description | +| :------- | :--- | :---------- | +| `enabled` | `boolean` | Set to `false` to exclude this endpoint from your MCP server. Defaults to `true`. | +| `name` | `string` | Override the tool name that appears in AI applications. Defaults to the operation's `summary`. | +| `description` | `string` | Override the tool description. Defaults to the operation's `description`. | + +This example excludes an internal endpoint and customizes another: + +```json {8-10, 21-25} +{ + "paths": { + "/internal/metrics": { + "get": { + "summary": "Get internal metrics", + "description": "Returns system metrics for monitoring", + "x-mint": { + "mcp": { + "enabled": false + } + } + } + }, + "/users/search": { + "post": { + "summary": "Search users", + "description": "Search for users by various criteria", + "x-mint": { + "mcp": { + "name": "search_users", + "description": "Find users by name, email, or other attributes. Returns matching user profiles." + } + } + } + } + } +} +``` + + + The legacy `x-mcp` extension is still supported but deprecated. Use `x-mint: mcp` for new configurations. + + ### Href Set the URL of the autogenerated endpoint page using `x-mint: href`. When `x-mint: href` is present, the generated API page uses the specified URL instead of the default autogenerated URL.