Skip to content
Documentation

Work on your docs with an AI assistant

Connect ChatGPT, Claude, Cursor, or VS Code to one Nibleaf project by signing in or with a personal key, investigate reader questions, and publish after a fresh preview.

  • 21 min read
  • Updated

An AI assistant connected to Nibleaf can answer "what are readers failing to find?", read the pages involved, draft a fix, and prepare it for publishing, all inside one site. It uses the Model Context Protocol (MCP), an open standard that lets AI apps use tools from other services. You connect it by signing in to Nibleaf from the assistant, or with a personal key that you create yourself. The assistant can never do more than you can do in the dashboard, and nothing it writes reaches readers until the publish is confirmed against a fresh preview. Nibleaf checks the preview, not the person: the review step depends on an assistant that asks you first, so give unattended automations a Read only key.

  • Your Nibleaf instance must have MCP turned on. On a self-hosted instance an operator enables it; see Connect MCP clients securely. If it is off, the settings page says that AI connections are disabled on this instance, and every client receives mcp:disabled.
  • You need to be on the site's team, with any role. Everyone on the team can connect an assistant or create a key for themselves in Settings → AI assistants (MCP). See Invite your team for roles.
  • Install the assistant you plan to use: ChatGPT, Claude (claude.ai or Claude Desktop), Claude Code, Cursor, or VS Code with an MCP-capable chat extension.

Each connection and each key starts from a preset, shown under Assistant permissions (or What the app can do when you connect by signing in). Pick the smallest one that covers the task.

PresetWho can choose itThe assistant canThe assistant cannot
Read onlyEveryoneRead project details, pages and their content, languages, versions, aggregate analytics, saved Ask AI conversations (redacted questions, answers, and reader feedback), search settings and health, and deployments.See individual search terms, change any page, or publish.
Support writerEveryoneEverything in Read only, plus read top and failed search terms, create and edit page drafts, move, translate, hide or show pages, and publish after a fresh preview is confirmed.Delete pages, change settings, members, billing, themes, add-ons, or integrations, or publish without a fresh, confirmed preview.
Full adminAdmins and ownersEvery read and write the MCP server offers, including usage, entitlements, add-ons, themes, exports, and integration status reads.Anything the server does not offer at all: deleting content, credentials, payments, or running code.

Editors see Full admin with the note "Available to admins only." and cannot select it.

Two rules apply on top of every preset:

  • The connection or key acts as you. On every request Nibleaf re-checks your current role and account status. If an admin removes you from the workspace or suspends you, or your account is deleted, your connected apps and keys stop working on their next request.
  • Search terms are optional data. Individual search terms are available only under the conditions in What analytics can and cannot tell you. Otherwise the search-term tools return counts without terms and say why.

Signing in is the quickest way to connect, and the only way for ChatGPT and for the claude.ai and Claude Desktop connectors. You add one URL to the assistant; there is no key to copy or store. Settings → AI assistants (MCP) shows the URL under Connect by signing in (recommended): your dashboard address followed by /api/mcp. The examples below use https://docs.example.com/api/mcp. If that box says sign-in needs HTTPS, the instance is not served over HTTPS; use a personal key instead.

  1. Add the URL to your assistant, as described for each client below.
  2. The assistant opens Nibleaf in your browser. Sign in as usual, with your email code or Google.
  3. Choose the project this connection is for and what the assistant may do there: Read only, Support writer, or Full admin (admins and owners only). The presets are the ones described in Choose what the assistant may do.
  4. Review the summary: the app, the project, and in plain words what it will and will not be able to do. Select Allow. You return to the assistant, which is now connected to that one project.

An app that registered itself shows a warning that its name is not verified, and the page shows where you will be sent back to. Continue only if you started the connection from that app. To work on another project, connect the assistant again and choose that project.

In ChatGPT, open Settings → Apps & Connectors, turn on developer mode, and add a custom connector. Paste the URL, choose OAuth as its authentication, and sign in when ChatGPT opens Nibleaf.

In claude.ai or Claude Desktop, open Settings → Connectors → Add custom connector, paste the URL, then select Connect and sign in. The connector is available in both.

Add the server with its URL only:

bash
claude mcp add --transport http nibleaf "https://docs.example.com/api/mcp"

Start Claude Code, run /mcp, select nibleaf, and choose Authenticate. Claude Code keeps the tokens in its own credential store and refreshes them.

Add the server with only its URL; the editor opens the sign-in page the first time it connects. For Cursor, save this as .cursor/mcp.json:

json
{
  "mcpServers": {
    "nibleaf": {
      "url": "https://docs.example.com/api/mcp"
    }
  }
}

For VS Code, save this as .vscode/mcp.json:

json
{
  "servers": {
    "nibleaf": {
      "type": "http",
      "url": "https://docs.example.com/api/mcp"
    }
  }
}

Apps you connected by signing in appear under Settings → AI assistants (MCP) → Connected apps, with their preset, when they were last used, and their latest activity; admins also see who connected each one. Select Disconnect to stop an app at once. Editors see and disconnect their own apps; admins and owners see and disconnect everyone's. A connection also stops when the person who made it leaves the workspace or is suspended. A disconnected app has to be connected and signed in again. Connecting the same app to the same project again replaces your earlier connection.

  1. Open the project, then Settings → AI assistants (MCP).
  2. Give the key a name that says where it will be used (for example "Laptop – Claude Code"), choose a preset, and choose an expiry of 7, 30, 90, 180, or 365 days (90 by default). Then select Create key. To pick scopes one by one instead of a preset, open Advanced: choose individual permissions.
  3. Copy the secret. It is shown only once. Paste it straight into your assistant or a password manager, never into chat, tickets, screenshots, or a file you commit to a repository. When it is stored, select I saved my key — hide it.

Select Test connection to confirm that the key, the server address, and MCP on the instance all work before you configure a client. On success it shows "Connected · N tools available", where N is the number of tools your key can use.

The key list shows each key's preset, when it was last used, and its latest activity; admins also see who owns each key. Editors see and revoke only their own keys. Admins and owners see everyone's keys and can revoke any of them, but only a key's owner can rotate it. Rotation revokes the old secret and issues a new one that acts as the person who rotated it.

The setup panel next to your new key offers a ready-made command, link, or configuration for each client, with the server address already filled in. The examples below use https://api.docs.example.com/api/mcp and the placeholder YOUR_NIBLEAF_KEY; replace them with the values from your setup panel.

  1. Copy the command from the setup panel. It already contains your key.
  2. Run it in a terminal:
bash
claude mcp add --transport http nibleaf "https://api.docs.example.com/api/mcp" --header "Authorization: Bearer YOUR_NIBLEAF_KEY"
  1. Start Claude Code and run /mcp; nibleaf should be listed as connected.

Because the key is part of the command, your shell saves it in its history. Remove that history entry afterwards, especially on a shared machine. Keep the default local scope. Do not add --scope project, because that writes the key into a .mcp.json file that is usually committed.

Claude Desktop reaches a remote server with a key through the mcp-remote bridge, which needs Node.js.

  1. Open the Claude Desktop configuration file: ~/Library/Application Support/Claude/claude_desktop_config.json on macOS or %APPDATA%/Claude/claude_desktop_config.json on Windows.
  2. Paste the block from the setup panel. It already contains your key:
json
{
  "mcpServers": {
    "nibleaf": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "https://api.docs.example.com/api/mcp",
        "--header",
        "Authorization:${NIBLEAF_AUTH}"
      ],
      "env": {
        "NIBLEAF_AUTH": "Bearer YOUR_NIBLEAF_KEY"
      }
    }
  }
}
  1. Quit and reopen Claude Desktop, then check that the Nibleaf tools appear in the tools menu.

The header value is passed through env without a space after the colon so the bridge receives it intact on every operating system.

  1. Set the environment variable NIBLEAF_API_KEY to your key in the environment Cursor starts from.
  2. Select Add to Cursor in the setup panel and confirm the install in Cursor. The link contains no secret: the installed entry reads the key from NIBLEAF_API_KEY. To configure Cursor by hand instead, save this as .cursor/mcp.json:
json
{
  "mcpServers": {
    "nibleaf": {
      "url": "https://api.docs.example.com/api/mcp",
      "headers": {
        "Authorization": "Bearer ${env:NIBLEAF_API_KEY}"
      }
    }
  }
}
  1. Restart Cursor and check that the nibleaf server shows a green status and lists its tools.
  1. Select Install in VS Code in the setup panel and confirm the install, or save the configuration below as .vscode/mcp.json.
  2. When VS Code first starts the server, it asks for the key in a password prompt and stores it in its secret storage. The configuration looks like this:
json
{
  "inputs": [
    {
      "id": "nibleaf-key",
      "type": "promptString",
      "description": "Nibleaf API key",
      "password": true
    }
  ],
  "servers": {
    "nibleaf": {
      "type": "http",
      "url": "https://api.docs.example.com/api/mcp",
      "headers": {
        "Authorization": "Bearer ${input:nibleaf-key}"
      }
    }
  }
}
  1. Open the chat view in agent mode and check that the Nibleaf tools are listed.

ChatGPT connects by signing in, not with a key; follow Sign in from ChatGPT. The claude.ai and Claude Desktop connector screens also sign in; see Sign in from Claude.

Ask the assistant to "call get_capabilities". The answer names the bound project and lists exactly the tools and prompts your key can use. If a tool you expect is missing, your preset or your current role does not include it.

This walk-through uses a Support writer key.

  1. Find what readers miss. Ask: "Using get_failed_searches for the last 7 days, which searches found nothing? Group similar terms." You can also start from the find_content_gaps prompt. If the tool reports that terms are unavailable, see What analytics can and cannot tell you.
  2. Check before writing. Ask the assistant to run search_pages for each group, so it extends an existing page rather than creating a duplicate.
  3. Draft the fix. Ask it to update the closest page with update_page, or create a new one with create_page_draft. The change lands as a draft in the working copy. Readers still see the published site.
  4. Review the draft. Open the page in the Nibleaf editor and read it as a reader would. Edit it yourself if needed. If you edit after the assistant read the page, its next write fails with mcp:revision_conflict instead of overwriting your work; it then reads the page again and merges its change.
  5. Preview the publish. Ask for preview_publish. It lists every unpublished change in the project, including other people's drafts, because a publish is project-wide. If the list contains something that is not ready, stop and coordinate with its author.
  6. Publish on your confirmation. When you are satisfied, tell the assistant to publish. It calls publish_changes with confirm: true and the token from the preview. If anything changed after the preview, the publish is refused with mcp:preview_stale and you preview again.
  7. Check the live site. Ask it to watch get_deployment until the deployment is ready, then open the page while signed out and search for one of the original failed terms. Follow Publish and verify for the complete reader check.

The deployment message records the name of the key that published, and the audit log records the key and the person it acted for, without storing page content.

  • Body format. Page bodies are Markdown or MDX, up to 128 KiB per page. A leading YAML frontmatter block may set title, description, and icon; explicit tool arguments win over frontmatter. This is the same parser Git sync uses, so escaped characters in frontmatter values are not decoded, exactly as in Git sync.
  • MDX is never executed. Readers' pages are rendered through react-markdown with rehype-sanitize. MDX expressions and import or export lines appear as plain text rather than running.
  • Translations. translate_page creates the translation as a draft in the target language. It names the source revision it translated, so a source that changed meanwhile is refused with mcp:revision_conflict instead of saving a stale translation. If one already exists, it fails with mcp:translation_exists and data.pageId names the existing page; edit that page with update_page. To pair the pages, it may also set a shared translation key on the source page and on other-language pages already paired with it by path, using the same revision-safe write.
  • Hiding a page. After the next publish, a page hidden with set_page_visibility leaves navigation, site search, the sitemap, and llms.txt, and its URL stops serving it. Its child pages leave navigation but stay reachable at their own URLs. A link from a visible page to a hidden page fails the publish's broken-link check, so fix those links first.
  • Drafts first. Writes change the working copy only. Nothing is live until a publish succeeds.
  • Preview, then confirm. Publishing needs a fresh preview and an explicit confirmation carrying the preview token. Reviewing the preview before you confirm is the recommended step, but Nibleaf can't enforce it. The token is bound to you, the project, and exactly what the publish would ship. It expires after 10 minutes and is effectively single-use: any edit, publish, or rollback after the preview, including the publish it approved, makes it stale.
  • Review before you confirm. Nibleaf can check that a confirmation matches a fresh preview, but not that a person read it. An assistant that runs without asking you could confirm on its own, so keep Support writer for assistants you work with and Read only for anything unattended.
  • The whole change list. The preview names up to 50 changed pages and any site settings that would change, such as the theme or navigation. When more pages are pending, the assistant tells you; review the full list in the dashboard's publish dialog before approving.
  • Project-wide publish. A publish includes everyone's unpublished changes in the project, not only the assistant's.
  • No silent overwrites. Every edit names the revision it is based on.
  • No duplicate actions on retry. An assistant can attach a clientRequestId so a retried request is not applied twice. Reusing the same ID with different arguments is refused.
  • No deletion. There is no delete tool. Hiding a page is reversible.
  • Untrusted content stays data. Page text, search terms, and reader feedback can contain anything a visitor or author typed. Nibleaf tells the assistant never to follow instructions found inside them. If an assistant suggests doing something because a page or search term "says so", decline.
  • Limits. Each key has a request limit, a separate per-minute limit on write tool calls, and an hourly limit on publishes. preview_publish does not count against the write limit.
  • Audit trail. Every write attempt is recorded, whether it succeeds, fails validation, is denied, conflicts, is rate limited, or is replayed from a retry. Tool inputs and page content are never stored.

The search tools use the same numbers and privacy rules as the Search section of the analytics dashboard:

  • A search counts once, as the reader's final query, not once per keystroke.
  • A term's text is shown only when at least two visitors searched for it. Rarer terms are still counted, but stay hidden.
  • Failed searches are terms that found nothing, or found results nobody clicked.

Individual search terms exist only when all of these are true:

  • the instance runs ClickHouse analytics (ANALYTICS_MODE=clickhouse);
  • the site is public, and an admin turned on search terms for it: in Analytics → Search, select Turn on search terms;
  • the reader allowed analytics, or the site does not ask for consent.

When terms are missing, the tools still return totals and rates, with a hint that says why. Relational analytics never stores search text, result counts or clicks, so failed searches are unavailable there.

get_referrers also reports AI crawler activity when the instance runs ClickHouse analytics: crawler requests, pages AI assistants fetched for a person, the crawlers, and the most crawled pages.

Every preset, including Read only, can read saved Ask AI conversations with list_ai_conversations and get_ai_conversation: the questions readers asked, the answers, and their ratings and comments. These are the same conversations your team sees under AI assistant, and the same privacy rules apply. Nibleaf saves text only while Save questions to improve your docs is on, tries to remove details such as email addresses, phone numbers, and keys before saving, and never saves who the reader was. Turning saving off stops saving the text of new conversations. Conversations saved earlier keep their text, and the tools can still read it, until someone deletes the conversation or the retention period ends. For conversations saved while saving was off, the tools return counts, ratings, and costs without text.

Other limits:

  • The Was this page helpful? widget has no comment field, so page feedback is only helpful or not helpful votes.
  • Search, crawler and page feedback data are not split by language, so those tools ignore the language filter. They say so in their response.
What you seeWhyWhat to do
mcp:disabledMCP is off on the instance.Ask your operator to enable it.
auth:invalid_api_key (HTTP 401)The key expired, was revoked, was pasted incompletely, or its owner was removed, suspended, or deleted.Create a new key and update the client.
auth:invalid_token (HTTP 401)The signed-in connection was disconnected, or the person who connected it was removed or suspended.Connect the assistant again and sign in.
"This connection request expired" in the browserMore than 10 minutes passed between starting to connect and approving.Start connecting again from the assistant.
auth:insufficient_scope, mcp:scope_required, or a tool is missingThe key's preset does not include it, or your current role does not allow it.Create a key with a larger preset, or ask an admin about your role.
auth:insufficient_roleYour current role no longer allows this change.Ask an admin about your role.
mcp:actor_requiredThe key has no live owner, so it cannot write.Create a new key of your own.
mcp:revision_conflictSomeone changed the page after the assistant read it. The error data includes currentRevision.Ask the assistant to read the page again with get_page, merge its change, and retry with the new revision.
mcp:translation_existsThe page already has a translation in that language; data.pageId names it.Edit that page with update_page.
mcp:preview_staleSomething changed after preview_publish.Run preview_publish again, review the new list, then confirm.
mcp:preview_expiredThe preview token is older than 10 minutes.Run preview_publish again.
mcp:preview_invalidThe token is not valid for this person and project.Run preview_publish again and use the new token.
mcp:confirmation_requiredpublish_changes was called without confirm: true.Confirm only after you approved the preview.
mcp:nothing_to_publishThere are no unpublished changes.Nothing to do.
mcp:publish_blockedThe publish is blocked, for example by redirect issues, exactly as it would be in the dashboard.Fix the issue in the dashboard, then preview again.
mcp:publish_in_progressA publish is still being built, so page edits and new publishes wait. Nothing was saved.Wait until get_deployment reports the deployment ready or failed, then retry.
mcp:idempotency_conflictThe same clientRequestId was reused with different arguments.Use a new clientRequestId for a different write.
mcp:idempotency_in_progressA request with the same clientRequestId is still running.Retry shortly.
http:rate_limitedA request, write, or publish limit was reached.Wait for data.retryAfterSeconds (or Retry-After); slow the assistant down or batch the work.

When you ask for help, share the request ID from the error, never the key, the Authorization header, or page content.

The assistant sees only the entries its key allows. The Preset column shows the smallest preset that includes each entry. A prompt appears only when the key holds every scope listed for it.

NameKindScopePresetPurpose
get_capabilitiesToolmcp:connectRead onlyList the bound project and the tools, resources, and prompts this key can use.
get_projectToolprojects:readRead onlyRead project details.
list_pagesToolpages:readRead onlyList pages and their place in the page tree.
get_pageToolpages:readRead onlyRead one page, including its content and current revision.
search_pagesToolpages:readRead onlyFind existing pages by title or content before writing.
list_languagesToollanguages:readRead onlyList the project's languages.
list_versionsToolversions:readRead onlyList documentation versions.
get_analytics_overviewToolanalytics:readRead onlyAggregate traffic, engagement, and search counts, without terms.
get_top_pagesToolanalytics:readRead onlyMost-viewed pages for a range.
get_page_feedbackToolanalytics:readRead onlyReader helpful and unhelpful feedback per page.
get_referrersToolanalytics:readRead onlyWhere readers come from, classified, including AI assistants, plus AI crawler activity.
list_ai_conversationsToolanalytics:readRead onlyFind saved Ask AI conversations, filtered by answer and feedback. Question text appears for conversations saved while saving questions was on, until they are deleted or expire.
get_ai_conversationToolanalytics:readRead onlyRead one saved Ask AI conversation: redacted questions, answers, and reader feedback.
get_ai_feedback_summaryToolanalytics:readRead onlyHow often Ask AI answers, reader ratings, cost, and how readers use it.
list_ai_content_gapsToolanalytics:readRead onlyQuestions Ask AI could not answer or readers rated down; candidates for new articles.
get_ai_usageToolanalytics:readRead onlyAsk AI spend per day and model, with totals.
get_search_configurationToolsearch:readRead onlySearch settings for the project.
get_search_index_diagnosticsToolsearch:readRead onlyContent-free index state and revision.
get_search_healthToolsearch:readRead onlyWhether search is healthy and up to date.
list_deploymentsTooldeployments:readRead onlyRecent deployments.
get_deploymentTooldeployments:readRead onlyOne deployment's status, for checking a publish.
get_pending_changesTooldeployments:readRead onlyUnpublished changes waiting in the working copy.
get_top_searchesToolanalytics:search_termsSupport writerMost frequent reader search terms.
get_failed_searchesToolanalytics:search_termsSupport writerSearches that found nothing, or found results nobody clicked.
create_page_draftToolpages:writeSupport writerCreate a new page as a draft.
update_pageToolpages:writeSupport writerEdit a page's draft; needs expectedRevision.
move_pageToolpages:writeSupport writerMove a page in the page tree.
translate_pageToolpages:writeSupport writerCreate a page's translation as a draft.
set_page_visibilityToolpages:writeSupport writerHide or show a page.
preview_publishTooldeployments:publishSupport writerList everything the next publish would include and return a preview token.
publish_changesTooldeployments:publishSupport writerPublish after review; needs confirm: true and the preview token.
get_usage_summaryToolusage:readFull adminUsage quantities and limits.
get_entitlementsToolentitlements:readFull adminPlan entitlements.
check_entitlementToolentitlements:readFull adminCheck one entitlement.
list_addonsTooladdons:readFull adminList add-ons and their state.
get_addonTooladdons:readFull adminRead one add-on.
list_addon_audit_eventsTooladdons:readFull adminAdd-on change history.
get_theme_templateToolthemes:readFull adminRead the theme template.
get_theme_catalogToolthemes:readFull adminList available themes.
preview_theme_importToolthemes:readFull adminValidate and preview a theme without saving it.
list_exportsToolexports:readFull adminList export jobs.
get_exportToolexports:readFull adminRead one export job.
get_git_integration_statusToolintegrations:readFull adminGit sync status.
list_integrationsToolintegrations:readFull adminList integrations.
get_integrationToolintegrations:readFull adminRead one integration.
find_content_gapsPromptanalytics:search_terms, pages:read, search:read, pages:write, deployments:publishSupport writerTurn failed searches into a list of missing pages, draft the chosen ones, and stop at a publish preview.
weekly_docs_health_reportPromptanalytics:read, search:read, deployments:readRead onlySummarize traffic, feedback, referrers, search health, and pending changes for the week. Without analytics:search_terms it says failed searches are unavailable to the key.
draft_articlePromptpages:read, search:read, pages:writeSupport writerDraft a new article after checking for an existing one.
translate_articlePromptpages:read, pages:writeSupport writerDraft a translation of an existing page.
review_unhelpful_pagesPromptanalytics:read, pages:read, pages:writeSupport writerReview pages readers marked unhelpful and propose revision-safe edits.
nibleaf://projects/{projectId}/pages/{pageId}/markdownResourcepages:readRead onlyOne page as text/markdown with frontmatter, in the same format as Git sync.

Analytics tools take a range of 24h, 7d, 30d, or 90d, or a from and to date no more than 90 days apart. Prompts only describe steps; they never publish on their own.

Was this page helpful?