|
| 1 | +# Multiple MCP Servers Setup |
| 2 | + |
| 3 | +This document explains how we've configured three separate MCP servers for different audiences. |
| 4 | + |
| 5 | +## Overview |
| 6 | + |
| 7 | +We now have **three MCP servers** serving different API endpoint sets: |
| 8 | + |
| 9 | +1. **`/mcp-public`** - Customer API endpoints (publicly available) |
| 10 | +2. **`/mcp-partners`** - Public Partners API endpoints (only those listed in "API Reference - Partners") |
| 11 | +3. **`/mcp-internal`** - All Partners API endpoints (internal/full spec) |
| 12 | + |
| 13 | +## MCP Server Details |
| 14 | + |
| 15 | +### `/mcp-public` |
| 16 | +- **Source**: `openapi.json` (Customer API) |
| 17 | +- **URL**: `https://api-doc.trykintsugi.com/openapi.json` |
| 18 | +- **Endpoints**: ~28 Customer API endpoints |
| 19 | +- **Audience**: Public users |
| 20 | +- **Configuration**: Auto-downloaded and MCP-enabled in workflow |
| 21 | + |
| 22 | +### `/mcp-partners` |
| 23 | +- **Source**: `openapi-partners-public.json` (filtered Partners API) |
| 24 | +- **Filtering**: Only endpoints listed in "API Reference - Partners" section of `docs.json` |
| 25 | +- **Endpoints**: ~51 public Partners API endpoints (72 pages → 51 unique paths) |
| 26 | +- **Audience**: Partners who need public API access |
| 27 | +- **Configuration**: Generated by `extract-public-partners-endpoints.py` script |
| 28 | + |
| 29 | +### `/mcp-internal` |
| 30 | +- **Source**: `openapi-partners.json` (full Partners API) |
| 31 | +- **URL**: `https://api.trykintsugi.com/openapi.json` |
| 32 | +- **Endpoints**: ~274 Partners API endpoints (all internal endpoints) |
| 33 | +- **Audience**: Internal use, full API access |
| 34 | +- **Configuration**: Auto-downloaded and MCP-enabled in workflow |
| 35 | + |
| 36 | +## File Structure |
| 37 | + |
| 38 | +``` |
| 39 | +docs-v2/ |
| 40 | +├── openapi.json # Customer API → /mcp-public |
| 41 | +├── openapi-partners.json # Full Partners API → /mcp-internal |
| 42 | +├── openapi-partners-public.json # Filtered Partners API → /mcp-partners |
| 43 | +├── docs.json # Configuration with 3 OpenAPI entries |
| 44 | +└── scripts/ |
| 45 | + ├── setup-mcp-servers.sh # Main setup script |
| 46 | + ├── extract-public-partners-endpoints.py # Filters public endpoints |
| 47 | + └── add-mcp-config-to-endpoints.sh # Adds MCP config to endpoints |
| 48 | +``` |
| 49 | + |
| 50 | +## How It Works |
| 51 | + |
| 52 | +### 1. Public Endpoints Extraction |
| 53 | + |
| 54 | +The `extract-public-partners-endpoints.py` script: |
| 55 | +- Reads `docs.json` to find all pages in "API Reference - Partners" |
| 56 | +- Parses MDX files to extract OpenAPI paths (e.g., `post /v1/transactions`) |
| 57 | +- Filters `openapi-partners.json` to only include those endpoints |
| 58 | +- Adds MCP configuration to the filtered spec |
| 59 | + |
| 60 | +### 2. MCP Configuration |
| 61 | + |
| 62 | +Each OpenAPI file has: |
| 63 | +- Root-level: `x-mint.mcp.enabled: true` |
| 64 | +- Endpoint-level: Each operation has `x-mint.mcp.enabled: true` |
| 65 | + |
| 66 | +### 3. Docs.json Configuration |
| 67 | + |
| 68 | +```json |
| 69 | +{ |
| 70 | + "openapi": [ |
| 71 | + { |
| 72 | + "url": "./openapi.json", |
| 73 | + "label": "Customer API", |
| 74 | + "mcp": { |
| 75 | + "path": "/mcp-public" |
| 76 | + } |
| 77 | + }, |
| 78 | + { |
| 79 | + "url": "./openapi-partners-public.json", |
| 80 | + "label": "Partners API (Public)", |
| 81 | + "mcp": { |
| 82 | + "path": "/mcp-partners" |
| 83 | + } |
| 84 | + }, |
| 85 | + { |
| 86 | + "url": "./openapi-partners.json", |
| 87 | + "label": "Partners API (Internal)", |
| 88 | + "mcp": { |
| 89 | + "path": "/mcp-internal" |
| 90 | + } |
| 91 | + } |
| 92 | + ] |
| 93 | +} |
| 94 | +``` |
| 95 | + |
| 96 | +## Automatic Updates |
| 97 | + |
| 98 | +The GitHub Actions workflow (`.github/workflows/update-api-docs.yml`) automatically: |
| 99 | +1. Downloads Customer API spec → `openapi.json` |
| 100 | +2. Downloads Partners API spec → `openapi-partners.json` |
| 101 | +3. Adds MCP configuration to both |
| 102 | +4. Generates filtered Partners API spec → `openapi-partners-public.json` |
| 103 | +5. Commits and deploys all three files |
| 104 | + |
| 105 | +## Manual Setup |
| 106 | + |
| 107 | +To set up locally: |
| 108 | + |
| 109 | +```bash |
| 110 | +# Run the setup script |
| 111 | +./scripts/setup-mcp-servers.sh |
| 112 | + |
| 113 | +# Or manually: |
| 114 | +# 1. Download Customer API |
| 115 | +curl https://api-doc.trykintsugi.com/openapi.json -o openapi.json |
| 116 | +./scripts/add-mcp-config-to-endpoints.sh openapi.json |
| 117 | + |
| 118 | +# 2. Download Partners API |
| 119 | +curl https://api.trykintsugi.com/openapi.json -o openapi-partners.json |
| 120 | +./scripts/add-mcp-config-to-endpoints.sh openapi-partners.json |
| 121 | + |
| 122 | +# 3. Generate filtered Partners API |
| 123 | +python3 scripts/extract-public-partners-endpoints.py |
| 124 | +``` |
| 125 | + |
| 126 | +## Accessing MCP Servers |
| 127 | + |
| 128 | +Once deployed, the MCP servers **should** be available at: |
| 129 | +- `https://kintsugi.mintlify.app/mcp-public` (Customer API) |
| 130 | +- `https://kintsugi.mintlify.app/mcp-partners` (Public Partners API) |
| 131 | +- `https://kintsugi.mintlify.app/mcp-internal` (Internal Partners API) |
| 132 | + |
| 133 | +**Important Note**: Mintlify may not support custom `mcp.path` configuration in `docs.json`. If the custom paths don't work, Mintlify will likely generate MCP servers at: |
| 134 | +- `/mcp` (first OpenAPI file - Customer API) |
| 135 | +- `/mcp-1` (second OpenAPI file - Partners Public) |
| 136 | +- `/mcp-2` (third OpenAPI file - Partners Internal) |
| 137 | + |
| 138 | +**To verify actual paths**: |
| 139 | +1. Check Mintlify dashboard → Products → MCP Server |
| 140 | +2. Look for all available MCP servers and their paths |
| 141 | +3. Update this documentation with the actual paths if different |
| 142 | + |
| 143 | +**If custom paths are needed**, you may need to: |
| 144 | +- Contact Mintlify support to request custom MCP server path support |
| 145 | +- Or reorganize the OpenAPI files in `docs.json` to match desired order |
| 146 | + |
| 147 | +## Troubleshooting |
| 148 | + |
| 149 | +### MCP Servers Not Showing |
| 150 | + |
| 151 | +1. **Check deployment**: Ensure all three OpenAPI files are committed |
| 152 | +2. **Verify MCP config**: Check that each file has `x-mint.mcp.enabled: true` |
| 153 | +3. **Manual update**: Trigger manual update in Mintlify dashboard |
| 154 | +4. **Check paths**: Verify actual MCP server paths in Mintlify dashboard |
| 155 | + |
| 156 | +### Public Endpoints Missing |
| 157 | + |
| 158 | +If `/mcp-partners` is missing endpoints: |
| 159 | +1. Check `docs.json` - ensure endpoint is listed in "API Reference - Partners" |
| 160 | +2. Verify MDX file exists: `reference/partners/{category}/{endpoint}.mdx` |
| 161 | +3. Check MDX frontmatter: Should have `openapi: {method} {path}` |
| 162 | +4. Re-run `extract-public-partners-endpoints.py` |
| 163 | + |
| 164 | +## References |
| 165 | + |
| 166 | +- [Mintlify MCP Documentation](https://www.mintlify.com/docs/ai/model-context-protocol) |
| 167 | +- Customer API: https://api-doc.trykintsugi.com/openapi.json |
| 168 | +- Partners API: https://api.trykintsugi.com/openapi.json |
| 169 | + |
0 commit comments