Labsco
bucketeer-io logo

Bucketeer Docs Local MCP Server

β˜… 1

from bucketeer-io

A local server to query Bucketeer documentation, which automatically fetches and caches content from its GitHub repository.

πŸ”₯πŸ”₯βœ“ VerifiedFreeAdvanced setup

Bucketeer Docs Local MCP Server

Overview

This project provides a Model Context Protocol (MCP) server for Bucketeer documentation. It offers an interface for searching and retrieving content from Bucketeer's feature flag and experimentation platform documentation, enabling AI assistants to provide accurate information about Bucketeer's features and usage.

Starting the Server

npm start

Document Sources

The server automatically fetches and indexes documentation from the bucketeer-io/bucketeer-docs repository:

  • GitHub Repository Integration:

    • Automatically fetches .mdx files from the docs/ directory and all subdirectories
    • Processes frontmatter and markdown content for optimal search indexing
    • Caches fetched content using SHA hashes and only updates when files are modified
    • Supports recursive directory traversal to capture all documentation files
  • Intelligent Indexing:

    • Extracts keywords from titles, descriptions, headers, and content
    • Builds searchable index with relevance scoring based on keyword matches and full-text search
    • Optimized for Bucketeer-specific terminology (feature flags, experiments, SDKs, targeting, etc.)
    • Handles frontmatter extraction (title, description) from MDX files
  • Cache Management:

    • Files are cached locally in files/docs/ directory as JSON files
    • Document index is stored in files/index/document-index.json
    • GitHub cache stored in files/docs/github_cache.json with SHA-based change detection
    • Use npm run build:index:force to force rebuild the entire index

Using with npx

First-time Setup

  1. Build the document index:
npx @bucketeer/docs-local-mcp-server build-index
  1. Use in your MCP configuration as shown in the next section.

Updating the Index

To update the documentation index (e.g., when new documentation is available):

npx @bucketeer/docs-local-mcp-server build-index --force

Development Commands

  • npm run build - Compile TypeScript files to dist/ directory
  • npm run build:index - Build/update the document index from GitHub repository
  • npm run build:index:force - Force rebuild the entire index (ignores cache)
  • npx @bucketeer/docs-local-mcp-server build-index - Build index using npx
  • npx @bucketeer/docs-local-mcp-server build-index --force - Force rebuild index using npx
  • npm run dev:index - Build and update index in development mode
  • npm run dev - Build and start server in development mode
  • npm run lint - Run Biome linting
  • npm run lint:fix - Run Biome linting and fix linting errors

File Structure

files/
β”œβ”€β”€ docs/           # Cached JSON files from GitHub repository
β”œβ”€β”€ index/          # Document search index
β”‚   └── document-index.json
└── [created automatically when building index]

Architecture

The server consists of several key components:

  1. GithubDocumentFetcher: Recursively fetches .mdx files from the GitHub repository
  2. IndexManager: Builds and manages the searchable document index
  3. SearchService: Provides search functionality with keyword matching and full-text search
  4. MCP Server: Exposes tools via the Model Context Protocol