Skip to main content

Ask AI assistant widget for VuePress

Add an AI assistant or AI search widget to your VuePress documentation using Biel.ai's web components. You can also connect AI agents through MCP, with or without installing the widget.

Prerequisites​

Add the assistant widget​

Assistant widget for docs

For VuePress 2.x​

  1. Open your VuePress config file (.vuepress/config.js or .vuepress/config.ts).

  2. Add the Biel.ai scripts to the head configuration:

    import { defineUserConfig } from 'vuepress'

    export default defineUserConfig({
    // ... your other config
    head: [
    [
    'link',
    { rel: 'stylesheet', href: 'https://cdn.jsdelivr.net/npm/biel-search/dist/biel-search/biel-search.css' }
    ],
    [
    'script',
    { type: 'module', src: 'https://cdn.jsdelivr.net/npm/biel-search/dist/biel-search/biel-search.esm.js' }
    ],
    [
    'script',
    {},
    `
    if (typeof window !== 'undefined') {
    window.addEventListener('DOMContentLoaded', () => {
    const button = document.createElement('biel-button');
    button.setAttribute('project', '<YOUR_PROJECT_ID>');
    button.setAttribute('header-title', 'Biel.ai assistant');
    button.setAttribute('button-position', 'bottom-right');
    button.setAttribute('modal-position', 'bottom-right');
    button.setAttribute('button-style', 'dark');
    button.textContent = 'Ask AI';
    document.body.appendChild(button);
    });
    }
    `
    ]
    ]
    })

    Replace <YOUR_PROJECT_ID> with your project's ID from the Biel.ai dashboard.

  3. Start your VuePress development server:

    npm run docs:dev
  4. Open your documentation and send a test question.

For VuePress 1.x​

  1. Open your VuePress config file (.vuepress/config.js).

  2. Add the following to your config:

    module.exports = {
    // ... your other config
    head: [
    [
    'link',
    { rel: 'stylesheet', href: 'https://cdn.jsdelivr.net/npm/biel-search/dist/biel-search/biel-search.css' }
    ],
    [
    'script',
    { type: 'module', src: 'https://cdn.jsdelivr.net/npm/biel-search/dist/biel-search/biel-search.esm.js' }
    ],
    [
    'script',
    {},
    `
    window.addEventListener('DOMContentLoaded', function() {
    var button = document.createElement('biel-button');
    button.setAttribute('project', '<YOUR_PROJECT_ID>');
    button.setAttribute('header-title', 'Biel.ai assistant');
    button.setAttribute('button-position', 'bottom-right');
    button.setAttribute('modal-position', 'bottom-right');
    button.setAttribute('button-style', 'dark');
    button.textContent = 'Ask AI';
    document.body.appendChild(button);
    });
    `
    ]
    ]
    }

    Replace <YOUR_PROJECT_ID> with your project's ID from the Biel.ai dashboard.

  3. Start your VuePress development server:

    npm run docs:dev

Add the search widget​

VuePress 2​

  1. Install biel-search:

    npm install biel-search
  2. In .vuepress/client.js, register SearchBox to replace the default theme’s search control. Merge this into an existing client configuration if you have one:

    import { defineClientConfig } from 'vuepress/client';
    import bielPackage from 'biel-search/package.json';
    import { h, onMounted } from 'vue';
    import 'biel-search/dist/biel-search/biel-search.css';

    export default defineClientConfig({
    enhance({ app }) {
    app.component('SearchBox', {
    setup() {
    onMounted(() => {

    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 () => h('biel-search-button', {
    project: '<YOUR_PROJECT_ID>',
    'button-style': 'rounded',
    }, 'Search');
    },
    });
    },
    });
  3. Replace <YOUR_PROJECT_ID> with your project ID. Run npm run docs:dev, open Search, and test a documentation query.

VuePress 1​

  1. Create .vuepress/components/BielSearch.vue:

    <script>
    export default {
    render(h) {
    return h('biel-search-button', {
    attrs: { project: '<YOUR_PROJECT_ID>', 'button-style': 'rounded' },
    }, ['Search']);
    },
    };
    </script>
  2. Load the widget assets and override the search component alias in .vuepress/config.js. Preserve your existing configuration and any chainWebpack changes:

    const path = require('path');

    module.exports = {
    head: [
    ['link', { rel: 'stylesheet', href: 'https://cdn.jsdelivr.net/npm/biel-search/dist/biel-search/biel-search.css' }],
    ['script', { type: 'module', src: 'https://cdn.jsdelivr.net/npm/biel-search/dist/biel-search/biel-search.esm.js' }],
    ],
    chainWebpack(config) {
    config.resolve.alias.set(
    '@SearchBox',
    path.resolve(__dirname, 'components/BielSearch.vue')
    );
    },
    };
  3. Replace <YOUR_PROJECT_ID> with your project ID. Run npm run docs:dev, open Search, and test a documentation query.

Connect AI agents with MCP​

Let AI tools search and read your indexed documentation. MCP is available on every plan and during your trial.

  1. In the Biel.ai dashboard, open your project’s Settings > MCP.
  2. Select Enable MCP server and click Save.
  3. 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​