Connect your coding agent (MCP)
Give Claude Code, Cursor, or any MCP-compatible coding agent read access to your app's documentation corpus.
Your app's documentation — both the customer-facing guide and the internal dev wiki — can be exposed to coding agents as an MCP (Model Context Protocol) server. This lets agents search and read your docs while they build, so answers are grounded in your actual documentation instead of stale training data.
The MCP server runs on your web app at POST /api/mcp and is off by default. It requires an admin API key to connect.
Prerequisites
-
API keys enabled. Set both env vars and rebuild:
API_KEYS_ENABLED=true NEXT_PUBLIC_API_KEYS_ENABLED=true -
MCP server enabled. Set the flag:
DOCS_MCP_ENABLED=true -
An admin API key. Go to Settings → API Keys, generate a key, and copy the
sk_...token. The MCP endpoint requires the caller to be an admin (it exposes the dev wiki).
Tools available
| Tool | Description |
|---|---|
search_docs | Search the docs corpus. Returns ranked sections with title, heading, URL, corpus, and snippet. Accepts query, optional limit (1–50, default 8), and optional corpus (guide, dev, or all). |
get_doc | Retrieve the full text of a documentation page by its URL path (e.g. /docs/getting-started). |
list_docs | List all documentation pages. Returns URL, title, and corpus for each page. |
Claude Code
Add the server to your ~/.claude.json (or project .claude.json):
{
"mcpServers": {
"app-docs": {
"type": "http",
"url": "https://your-app.example.com/api/mcp",
"headers": {
"Authorization": "Bearer sk_your_api_key_here"
}
}
}
}Replace https://your-app.example.com with your app's URL, and sk_your_api_key_here with your actual admin API key.
For local development:
{
"mcpServers": {
"app-docs": {
"type": "http",
"url": "http://localhost:3000/api/mcp",
"headers": {
"Authorization": "Bearer sk_your_api_key_here"
}
}
}
}Cursor
In Cursor, go to Settings → MCP and add a new server:
- Name:
app-docs - Type:
http - URL:
https://your-app.example.com/api/mcp
Then add the authorization header. In your project's .cursor/mcp.json:
{
"mcpServers": {
"app-docs": {
"url": "https://your-app.example.com/api/mcp",
"headers": {
"Authorization": "Bearer sk_your_api_key_here"
}
}
}
}Windsurf / Other MCP clients
Any MCP client that supports Streamable HTTP transport can connect. Point it at:
- URL:
https://your-app.example.com/api/mcp - Method:
POST - Header:
Authorization: Bearer sk_your_api_key_here
Security notes
- The endpoint returns 404 unless both
API_KEYS_ENABLEDandDOCS_MCP_ENABLEDare set totrue. This hides the endpoint entirely when disabled. - Only admin users can connect. Non-admin API keys receive a 403.
- The server exposes both the customer guide and the internal dev wiki. This is intentional — coding agents benefit from the full context. Restrict access by only issuing admin API keys to trusted developers.
- API keys authenticate via
Authorization: Bearer sk_...— no session cookies, no unauthenticated fallback.