Skip to content

Tutorial: Add an AI Chatbot to Your Docs Site with Claude Code or Cursor

In this tutorial, you’ll add an AI chatbot to a documentation site that you build from a Git repository, and let your coding agent (Claude Code, Cursor or a similar tool) do the work in the repo. By the end, visitors can ask a question on any page and get an answer from your documentation with a link to the page it came from. Your agent can also search the same documentation and fix the pages that users struggle with.

ChatbotIQ is a European platform that turns your help center, documentation, or website into an AI assistant. It answers only from your content, links to its sources, and says so when your content doesn’t cover a question.

Scenario: Your documentation lives in a Git repository and is built with a static site generator such as Docusaurus, MkDocs, Astro Starlight, VitePress, Mintlify or Next.js. You already use a coding agent in that repository. You want an “Ask AI” assistant on the published site without writing the integration yourself, and you want to know which questions the documentation doesn’t answer.

Time needed: About 20 minutes. Indexing runs in the background.

What you’ll need:

  • Your docs site published at a public address
  • The repository, and a way to run the site locally
  • A coding agent with access to the repository, such as Claude Code or Cursor

Who does what:

StepWhoWhere
Sign up, index the site, create the botYouChatbotIQ dashboard
Add the widget and run the site locallyYour coding agentYour docs repository
Search the docs while writing code or docsYour coding agentYour bot’s MCP server
Fix the pages users struggle withYour coding agentInsights MCP server and your repository

  1. Go to Knowledge Base → ”+ Add Source” → Website.
  2. Enter the address of your published docs (e.g., https://docs.yourproduct.com).
  3. Keep Sitemap Discovery. Docusaurus, MkDocs, Mintlify and most other generators publish a sitemap.xml, so discovery takes seconds. If your site has no sitemap, use Link Crawling instead.
  4. On Mintlify (and GitBook or Scroll Sites), open Advanced Options → Performance and turn on Simple Mode. These platforms publish a markdown version of each page, and ChatbotIQ reads that instead, so the crawl is much faster.
  5. Click Start Discovery, review the pages it found, and click Start Crawling.

Versioned docs? Each version of a page counts as a separate page toward your plan’s page limit. If your readers only use the current version, deselect the older ones before you crawl. See Configure Crawling for Your Site.


  1. Go to Bots → “Create Bot”.
  2. Basic Info: Name it (for example “Docs Assistant”) and choose Technical Documentation as the bot type. It is tuned for precise, citation-rich answers.
  3. Sources: Select the source from Step 1.
  4. Model: GPT-6.1 Terra (the recommended default) suits most documentation.
  5. Behavior: Paste this template into Base Prompt and customize it:
You are the documentation assistant for [Product Name].
Guidelines:
- Give step-by-step instructions when the user asks how to do something
- Include a short code example when the documentation has one
- If the user's version or setup matters and they have not said which one they use, ask
  1. Review the summary and click Create Bot. You land in the Playground.

Ask it five questions your users actually ask, plus one your docs don’t cover. The bot should answer the first five with links to the right pages and say plainly that it doesn’t know the last one.


Step 3: Make the bot public and copy the code

Section titled “Step 3: Make the bot public and copy the code”
  1. In the bot’s Settings → Advanced, set Privacy to Public.
  2. Under Allowed Domains, add your docs domain (e.g., docs.yourproduct.com) so the bot can’t be embedded elsewhere. Add localhost too while you test; it covers every local port. If your dev server runs on 127.0.0.1 (MkDocs does by default), add that as well. Remove both once the site is live.
  3. Switch to the Deploy tab, open Website widget, and scroll to Advanced Options. Copy the JavaScript-only embed code. It is easier for an agent to place than the HTML code at the top, because every docs generator can load a JavaScript file on all pages.

Step 4: Let your coding agent add the widget

Section titled “Step 4: Let your coding agent add the widget”

Open your coding agent in the docs repository and give it this prompt. Replace the code block with the code you copied; your bot ID is already filled in there.

Add the ChatbotIQ chat widget to this documentation site.
This is the widget code:
```js
window.__chatbotiq = {
botId: 'YOUR-BOT-ID',
domain: 'www.chatbotiq.eu',
apiBase: 'https://app.chatbotiq.eu',
};
var s = document.createElement('script');
s.src = 'https://www.chatbotiq.eu/embedded.js';
s.async = true;
document.head.appendChild(s);
```
Requirements:
- Put the code in its own file and load it on every page with this site's own
mechanism (a config option, theme override or layout). Do not edit build output.
- Load it once per visit: moving between pages must not load it again or remove
the chat launcher.
- If the site sets a Content-Security-Policy, allow what the widget needs and
tell me exactly what you changed.
- Change nothing else.
- Start the local dev server and tell me which URL to open.

This is where the code usually ends up, so you can check the agent’s change:

Docs generatorWhere the script is loaded
Docusaurusscripts in docusaurus.config.js, pointing at a file in static/
MkDocs (including Material for MkDocs)extra_javascript in mkdocs.yml, pointing at a file in docs/
Astro Starlightthe head option of the Starlight integration in astro.config.mjs
VitePresshead in .vitepress/config
Mintlifya .js file in the docs content directory, which Mintlify includes on every page
Next.js, Nextraa next/script tag in the root layout

Review the diff before you accept it. The change should be a new script file and a few lines of configuration.


  1. Open the URL the agent gave you. The launcher appears in the bottom-right corner.
  2. Ask a question, then click a link in the answer. Move to another page: there should still be exactly one launcher.
  3. If the launcher doesn’t appear, open the browser console (F12 → Console) and look for [ChatbotIQ] messages or blocked requests. Paste them into your agent’s chat; it can fix most of them. See also Troubleshooting.
  4. Commit and deploy the way you usually publish your docs.
  5. Open the live site with a hard refresh (Ctrl+Shift+R or Cmd+Shift+R) and check the launcher once more. Then remove localhost and 127.0.0.1 from Allowed Domains.

Preview deployments (for example on Vercel or Netlify) run on a different domain. Add that exact domain to Allowed Domains if you want to test there.

To match the widget to your site’s colors, see Match Your Widget to Your Brand.


Step 6: Give your agent the same documentation

Section titled “Step 6: Give your agent the same documentation”

Your bot is also an MCP server. Connect it to your coding agent and the agent can search your published documentation the same way the bot does, for example to check how a feature is documented before it changes the code, or, once a new page is published and the source has re-synced, whether the bot finds it.

  1. In the Playground, open the Deploy tab and pick AI assistants.
  2. Choose With API Key and copy the key. It is shown once.
  3. Add the server to Claude Code:
Terminal window
claude mcp add --transport http chatbotiq-docs \
https://app.chatbotiq.eu/v1/mcp/bots/<bot-id>/mcp \
--header "Authorization: Bearer mcpk_your_api_key_here"

For Cursor, VS Code and other tools, see Connect via MCP.

With an API key, the agent also gets a submit_feedback tool. When it finds a passage that is wrong or outdated, it can report it, and the report lands in your doc issues (Step 7).


Every question the bot can’t answer, and every answer that gets a thumbs-down, points at a page that is missing, outdated or unclear. ChatbotIQ collects them under Analytics → Doc issues: one issue per problem, with the questions behind it and, when known, the page and section to change.

Because your documentation is a repository, your coding agent can fix those pages itself. Connect the Insights MCP server, which gives the agent your workspace’s doc issues:

  1. Open Analytics → Docs Insights and, under Connect your AI assistant, copy the endpoint from the Claude Code tab.
  2. Add it and sign in:
Terminal window
claude mcp add --transport http --scope user chatbotiq-insights \
https://app.chatbotiq.eu/v1/mcp/workspaces/<workspace-id>/mcp
  1. Start Claude Code (claude), run /mcp, pick chatbotiq-insights and sign in when the browser opens. Owners and admins can tick write access on the approval page; the agent needs it to close issues.

Then ask:

Take the oldest open doc issue, find the file in this repository for the page it points to, and draft the change. Don’t commit yet.

Read the draft. The agent tells you when a fact has to come from someone who knows the product instead of being made up. When you have published the fix, ask it to close the issue with the page’s URL and re-sync the source. If users keep asking about the topic, the issue reopens on its own.

Using Claude Code inside the Claude desktop app, or Cursor? See Close the Documentation Feedback Loop for the sign-in steps, and Work Through Doc Issues for assigning issues to the people who own each part of the docs.


On the Standard plan and above, sources re-crawl automatically, and only pages that changed are indexed again. To pick up a change right away, click Update on the source in Knowledge Base, or ask your agent to re-sync it through the Insights MCP server. See Keep Content Up to Date.


Start your free 14-day trial and have an assistant answering from your documentation in about 20 minutes. No credit card needed.

Short on time? Send us your docs address and we’ll prepare the assistant for you.