Ask AI assistant widget for Fumadocs
Add an AI assistant or AI search widget to your Fumadocs site using Biel.ai's React components. You can also connect AI agents through MCP, with or without installing the widget.
Prerequisites
- A Biel.ai account.
- A project with indexed content.
- A Fumadocs site.
- Node.js installed.
Add the assistant widget

-
Install Biel.ai for React:
npm install biel-react biel-search -
Create a client component at
components/BielWidget.tsx. Start the file with'use client':'use client';import { useEffect } from 'react';import { BielButton } from 'biel-react';import bielPackage from 'biel-search/package.json';export default function BielWidget() {useEffect(() => {if (!document.querySelector('script[data-biel]')) {const script = document.createElement('script');script.type = 'module';script.src = `https://cdn.jsdelivr.net/npm/biel-search@${bielPackage.version}/dist/biel-search/biel-search.esm.js`;script.dataset.biel = '';document.head.appendChild(script);}}, []);return (<BielButtonproject="<YOUR_PROJECT_ID>"header-title="Biel.ai assistant"button-position="bottom-right"modal-position="bottom-right"button-style="dark">Ask AI</BielButton>);}Replace
<YOUR_PROJECT_ID>with your project's ID from the Biel.ai dashboard. -
In your existing
app/layout.tsx, import the client component and widget stylesheet:import BielWidget from '@/components/BielWidget';import 'biel-search/dist/biel-search/biel-search.css';Render
<BielWidget />inside your existing<body>, alongsideRootProvider. Keep the root layout's HTML, fonts, metadata, and existing content. See Next.js Server and Client Components for client boundaries. -
Run
npm run dev, open your site, and send a test question.
Add the search widget
-
Install
biel-react:npm install biel-react biel-search -
Create
components/BielSearch.tsx:'use client';import { useEffect } from 'react';import { BielSearchButton } from 'biel-react';import bielPackage from 'biel-search/package.json';export default function BielSearch() {useEffect(() => {if (!document.querySelector('script[data-biel]')) {const script = document.createElement('script');script.type = 'module';script.src = `https://cdn.jsdelivr.net/npm/biel-search@${bielPackage.version}/dist/biel-search/biel-search.esm.js`;script.dataset.biel = '';document.head.appendChild(script);}}, []);return (<BielSearchButton project="<YOUR_PROJECT_ID>" button-style="rounded">Search</BielSearchButton>);}Replace
<YOUR_PROJECT_ID>with your project ID. -
For Fumadocs UI 16, create
components/BielDocsLayout.tsxto replace both search triggers:'use client';import { DocsLayout, type DocsLayoutProps } from 'fumadocs-ui/layouts/docs';import BielSearch from './BielSearch';export default function BielDocsLayout(props: DocsLayoutProps) {return (<DocsLayout{...props}slots={{...props.slots,searchTrigger: { sm: BielSearch, full: BielSearch },}}/>);} -
In your docs layout, use
BielDocsLayoutin place ofDocsLayout, keeping the existing page tree and options. In the root layout, import the stylesheet and disable the built-in search dialog on your existingRootProvider:import 'biel-search/dist/biel-search/biel-search.css';<RootProvider search={{ enabled: false }}>{children}</RootProvider> -
Run
npm run dev. Test Search in the sidebar and the mobile header. For other Fumadocs versions, render<BielSearch />in your own header or follow the framework’s layout customization guide.
Connect AI agents with MCP
Let AI tools search and read your indexed documentation. MCP is available on every plan and during your trial.
- In the Biel.ai dashboard, open your project’s Settings > MCP.
- Select Enable MCP server and click Save.
- In the widget, open Connect via MCP using the
<>button. Select your AI client or choose MCP URL to copy the endpoint into its settings.
Without the widget: after enabling MCP, copy MCP endpoint from Settings > MCP and add it to your AI client. No widget installation or website changes are required.
The widget also exposes WebMCP tools to compatible browser agents visiting your site. Use the latest widget release and keep Enable WebMCP selected in Settings > MCP.
Next steps
- Customize the widget's appearance, behavior, and tone.
- Connect integrations like GitHub Actions, MCP, or Zapier.