|
| 1 | +# MCP (Model Context Protocol) Setup |
| 2 | + |
| 3 | +This document explains how MCP is configured for the Kintsugi Partners API documentation. |
| 4 | + |
| 5 | +## Overview |
| 6 | + |
| 7 | +The Model Context Protocol (MCP) enables AI tools (like Claude, Cursor, VS Code) to access your documentation and API endpoints. Our setup automatically enables MCP for all endpoints in the Partners API reference. |
| 8 | + |
| 9 | +## Configuration |
| 10 | + |
| 11 | +MCP is configured at the file level in the `openapi-partners.json` file using the `x-mint` extension: |
| 12 | + |
| 13 | +```json |
| 14 | +{ |
| 15 | + "openapi": "3.1.0", |
| 16 | + "x-mint": { |
| 17 | + "mcp": { |
| 18 | + "enabled": true |
| 19 | + } |
| 20 | + }, |
| 21 | + ... |
| 22 | +} |
| 23 | +``` |
| 24 | + |
| 25 | +This enables MCP for **all endpoints** in the Partners API by default. New endpoints that are added to the API will automatically be available as MCP tools once the OpenAPI spec is updated. |
| 26 | + |
| 27 | +## Automatic Updates |
| 28 | + |
| 29 | +The MCP configuration is automatically applied in two places: |
| 30 | + |
| 31 | +1. **GitHub Actions Workflow** (`.github/workflows/update-api-docs.yml`): |
| 32 | + - Runs every 6 hours |
| 33 | + - Downloads the latest OpenAPI spec from `https://api.trykintsugi.com/openapi.json` |
| 34 | + - Automatically adds MCP configuration |
| 35 | + - Regenerates documentation |
| 36 | + - Commits changes if updates are detected |
| 37 | + |
| 38 | +2. **Local Script** (`scripts/generate-api-docs.sh`): |
| 39 | + - Can be run manually for local development |
| 40 | + - Uses `scripts/add-mcp-config.sh` to add MCP configuration |
| 41 | + |
| 42 | +## How It Works |
| 43 | + |
| 44 | +When the OpenAPI spec is downloaded: |
| 45 | +1. The spec is fetched from the API endpoint |
| 46 | +2. The `add-mcp-config.sh` script adds the `x-mint.mcp.enabled: true` configuration |
| 47 | +3. Mintlify generates documentation with MCP enabled |
| 48 | +4. The MCP server is automatically available at `https://[your-docs-url]/mcp` |
| 49 | + |
| 50 | +## MCP Server Access |
| 51 | + |
| 52 | +Once deployed, your MCP server will be available at: |
| 53 | +- **URL**: `https://[your-mintlify-docs-url]/mcp` |
| 54 | +- You can find this URL in your Mintlify dashboard under the MCP Server section |
| 55 | + |
| 56 | +## Security |
| 57 | + |
| 58 | +- MCP servers only work with **public documentation** (not behind authentication) |
| 59 | +- API endpoints exposed through MCP will use the authentication requirements defined in your OpenAPI `securitySchemes` |
| 60 | +- Users will be prompted for authentication credentials when needed |
| 61 | +- Only endpoints explicitly enabled for MCP are exposed |
| 62 | + |
| 63 | +## Customization |
| 64 | + |
| 65 | +To disable MCP for specific endpoints, you can add endpoint-level configuration: |
| 66 | + |
| 67 | +```json |
| 68 | +{ |
| 69 | + "paths": { |
| 70 | + "/v1/admin/sensitive-endpoint": { |
| 71 | + "get": { |
| 72 | + "x-mint": { |
| 73 | + "mcp": { |
| 74 | + "enabled": false |
| 75 | + } |
| 76 | + } |
| 77 | + } |
| 78 | + } |
| 79 | + } |
| 80 | +} |
| 81 | +``` |
| 82 | + |
| 83 | +However, since we're using file-level configuration, all endpoints are enabled by default. If you need to exclude specific endpoints, you would need to modify the script to handle exclusions. |
| 84 | + |
| 85 | +## Monitoring |
| 86 | + |
| 87 | +You can monitor your MCP server and view all available tools in the Mintlify dashboard under the **MCP Server** section. |
| 88 | + |
| 89 | +## References |
| 90 | + |
| 91 | +- [Mintlify MCP Documentation](https://www.mintlify.com/docs/ai/model-context-protocol) |
| 92 | +- [Model Context Protocol Specification](https://modelcontextprotocol.io/) |
| 93 | + |
0 commit comments