Logo vun GitBook MCP Server

GitBook MCP Server

Communautéit
tcsenpai

An MCP (Model Context Protocol) server that exposes documentation sites content for AI assistants. This server scrapes and indexes GitBook and other websites documentation, making it searchable and accessible through MCP tools.

Editeurtcsenpai
Repositorymcpbook
SproochJavaScript
Forks
7
Stären
19
Disponibel Tools
0
Transporttypstdio, streamable-http
Kategorien
LizenzMIT
Linken
  • Tools mat KI-Workflows verbannen

    GitBook MCP Server stellt MCP-Funktioune bereit, déi vu kompatibele KI-Clienten a KI-Agente kënne benotzt ginn.

  • 0 disponibel Tools

    Kuckt Iech déi opruffbar Aktiounen hei drënner un, mat Nimm a Beschreiwungen, wa se vum Server geliwwert ginn.

  • Konfiguratioun fir ze kopéieren

    Benotzt d'Installatiounsbeispiller, fir dëse Server an Ärem bevorzugte MCP-Client ze konfiguréieren.

  • Indicateure fir Open Source

    19 Stären an 7 Forks aus dem verlinkte Repository.

MSeeP.ai Security Assessment Badge Verified on MSeeP

Universal Documentation MCP Server

MCP Badge

A high-performance MCP (Model Context Protocol) server that transforms any documentation website into an AI-accessible knowledge base. Originally built for GitBook but works with Vercel docs, Next.js sites, Docusaurus, and many other documentation platforms. Features instant startup, intelligent caching, and automatic domain detection.

✨ Key Features

  • ⚡ Instant Startup - SQLite storage with sub-second server initialization
  • 🔍 Advanced Search - FTS5 full-text search with fuzzy matching and ranking
  • 🧠 Smart Auto-Detection - Automatically detects domain, keywords, and branding
  • 📝 Markdown Perfect - Preserves formatting with syntax-highlighted code blocks
  • 🔄 Background Updates - Non-blocking change detection and cache refresh
  • 🌐 Universal Support - Works with GitBook, Vercel docs, Next.js sites, and many other documentation platforms
  • 📡 Dual Interface - Both MCP tools and REST API endpoints
  • 🚀 Production Ready - Rate limiting, error handling, and robust caching

🚀 Quick Start

💡 Recommended: Use the interactive creator for the best experience!

🎨 Web UI Management Dashboard

bash
# Clone this repo (once)
git clone https://github.com/tcsenpai/mcpbook/
cd mcpbook

# Build the UI
npm run ui:build

# Start the web interface
npm run ui

The Web UI provides:

  • 🚀 Visual Server Creation - Step-by-step wizard with live URL validation
  • 📊 Server Management - Start/stop/delete servers with real-time status
  • 📋 Claude Desktop Integration - One-click copy config or add via CLI
  • 🖥️ Live Terminal - Real-time feedback and command execution
  • ⚠️ Safety Features - Confirmation dialogs and cancel functionality

⭐ One-Command Setup

bash
# Clone this repo (once)
git clone https://github.com/tcsenpai/mcpbook/
cd mcpbook

# Create MCP server for any documentation site instantly
npm exec create-gitbook-mcp

That's it! 🎉 The interactive wizard will:

  • ✨ Guide you through setup with smart defaults
  • 🔍 Auto-detect domain/keywords from your documentation site
  • 📦 Install in organized directories (~/.config/mcpbooks/servers/[name])
  • 🌍 Optionally install globally (accessible as your-server-name command)
  • 🤖 Auto-configure Claude Desktop (optional)
  • 🚀 Pre-cache everything for instant server startup

🛠️ Manual Setup (Advanced Users)

  1. Install and Configure

    bash
    npm install
    echo "GITBOOK_URL=https://docs.yoursite.com" > .env
  2. Build with Auto-Detection

    bash
    npm run build  # Automatically detects and configures your domain
  3. Start Server

    bash
    npm start  # Instant startup with SQLite cache
  4. Test with MCP Inspector

    bash
    npx @modelcontextprotocol/inspector node dist/index.js

📦 Installation Options

Option 1: Local Development

bash
git clone <repository>
cd mcpbook
npm install
npm run build
npm start

Option 2: Global Installation

bash
npm install -g .
# Then use the binary name from package.json
your-mcp-server-name

Option 3: Claude Desktop Integration

json
{
  "mcpServers": {
    "gitbook": {
      "command": "node",
      "args": ["/absolute/path/to/dist/index.js"],
      "env": {
        "GITBOOK_URL": "https://docs.yoursite.com"
      }
    }
  }
}

Config file locations:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\\Claude\\claude_desktop_config.json

Option 4: StreamableHTTP Transport

bash
npm run start:http  # StreamableHTTP on port 3001
node dist/index.js --streamable-http --port=3002  # Custom port

Option 5: REST API Server

bash
npm run start:api  # HTTP server on port 3000
PORT=8080 npm run start:api  # Custom port

🌐 Platform Compatibility

While originally designed for GitBook, this MCP server has proven compatibility with many documentation platforms:

✅ Guaranteed to Work

  • GitBook (original target platform)
  • Custom GitBook instances

🎯 Successfully Tested

  • Vercel-hosted docs (docs.vercel.com, aptos.dev)
  • Next.js documentation sites
  • Static site generators with consistent navigation
  • Most HTML-based documentation platforms

🔧 How It Works

The scraper intelligently:

  • Discovers navigation through link crawling
  • Extracts content from any HTML structure
  • Adapts to different layouts automatically
  • Handles various authentication and routing patterns

💡 Pro Tip: If a site has consistent navigation and accessible content, our scraper will likely work! The auto-detection feature adapts to different site structures automatically.

⚙️ Configuration

Auto-Detection (Recommended)

env
GITBOOK_URL=https://docs.yoursite.com
AUTO_DETECT_DOMAIN=true
AUTO_DETECT_KEYWORDS=true

The server will automatically:

  • Generate domain-specific tool names (stripe_docs_search, api_docs_get_page)
  • Extract relevant keywords from content
  • Create contextual descriptions for better AI integration

Manual Configuration

env
# Target GitBook (required)
GITBOOK_URL=https://docs.yoursite.com

# Custom branding (optional)
SERVER_NAME=my-api-docs
SERVER_DESCRIPTION=API documentation and guides
DOMAIN_KEYWORDS=api,rest,graphql,endpoints
TOOL_PREFIX=api_

# Performance tuning
CACHE_TTL_HOURS=1
MAX_CONCURRENT_REQUESTS=5
SCRAPING_DELAY_MS=100

Configuration Examples

API Documentation:

env
GITBOOK_URL=https://api-docs.yourservice.com
TOOL_PREFIX=api_
DOMAIN_KEYWORDS=api,rest,endpoints,authentication

→ Results in: api_search_content, api_get_page, etc.

Product Documentation:

env
GITBOOK_URL=https://help.yourproduct.com  
TOOL_PREFIX=help_
DOMAIN_KEYWORDS=tutorial,guide,troubleshooting

→ Results in: help_search_content, help_get_page, etc.

🛠️ Available Tools

The server exposes 7 MCP tools with automatic prefixing:

Core Tools

ToolDescriptionParameters
{prefix}_search_contentAdvanced search with rankingquery: Search terms
{prefix}_get_pageGet specific page contentpath: Page path (e.g., "/api/auth")
{prefix}_list_sectionsGet table of contentsNone
{prefix}_get_section_pagesGet all pages in sectionsection: Section name
{prefix}_refresh_contentForce cache refreshNone
{prefix}_get_code_blocksExtract code with syntax highlightingpath: Page path
{prefix}_get_markdownGet formatted markdownpath: Page path

MCP Prompts

  • explain_section - Generate comprehensive tutorials
  • summarize_page - Create concise summaries
  • compare_sections - Compare documentation sections
  • api_reference - Format as API documentation
  • quick_start_guide - Generate quick start guides

🌐 HTTP Interfaces

The server supports both MCP StreamableHTTP and traditional REST API:

StreamableHTTP MCP Protocol:

bash
# Health check
curl http://localhost:3001/health

# MCP requests (requires MCP client)
curl -X POST http://localhost:3001/mcp \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc": "2.0", "id": 1, "method": "tools/list"}'

REST API (separate server):

bash
# Search content
curl "http://localhost:3000/api/search?q=authentication"

# Get specific page
curl "http://localhost:3000/api/page/api/authentication"

# Get page as markdown
curl "http://localhost:3000/api/page/api/authentication/markdown"

# Get code blocks
curl "http://localhost:3000/api/page/api/authentication/code"

# List sections
curl "http://localhost:3000/api/sections"

# Get section pages
curl "http://localhost:3000/api/sections/API/pages"

# Server status
curl "http://localhost:3000/api/status"

# Refresh cache
curl -X POST "http://localhost:3000/api/refresh"

🎯 Usage Examples

Auto-Detection Results

  • docs.stripe.com → stripe_search_content, stripe_get_page
  • docs.react.dev → react_search_content, react_get_page
  • api.yourcompany.com → api_search_content, api_get_page
  • Generic sites → docs_search_content, docs_get_page

MCP Tool Usage

bash
# Search for authentication docs
{"tool": "api_search_content", "arguments": {"query": "oauth authentication"}}

# Get specific page
{"tool": "api_get_page", "arguments": {"path": "/auth/oauth"}}

# Get code examples
{"tool": "api_get_code_blocks", "arguments": {"path": "/sdk/quickstart"}}

# Refresh content
{"tool": "api_refresh_content", "arguments": {}}

🏗️ Architecture

  • SQLite Storage - Fast startup with FTS5 full-text search
  • Background Updates - Non-blocking change detection
  • Auto-Detection - Domain and keyword extraction
  • Parallel Scraping - Configurable concurrency
  • Smart Caching - Only updates changed content

Key Components

  • GitBookScraper - Web scraping and content extraction
  • SQLiteStore - High-performance storage with FTS5 search
  • DomainDetector - Automatic domain and keyword detection
  • GitBookMCPServer - MCP server with tool handlers
  • GitBookRestAPI - HTTP endpoints for web integration

🔧 Development

bash
# Development mode with auto-reload
npm run dev

# Build with auto-detection
npm run build

# Run manual auto-detection
npm run auto-detect

# Clean build (no auto-detection)
npm run build:clean

# Test with MCP Inspector
npx @modelcontextprotocol/inspector node dist/index.js

🌍 Universal GitBook Support

Works with any public GitBook, including:

  • API Documentation - Stripe, Twilio, etc.
  • Framework Docs - React, Vue, Angular
  • Product Guides - Help centers and tutorials
  • Developer Resources - SDKs and references
  • Company Wikis - Internal documentation

⚡ Performance

  • Instant Startup: Sub-second initialization with SQLite cache
  • Background Updates: Non-blocking change detection
  • Smart Indexing: FTS5 full-text search with ranking
  • Efficient Storage: SQLite replaces slow JSON parsing
  • Memory Optimized: On-demand loading instead of full memory cache

🚧 Limitations

  • Public GitBooks Only - Requires publicly accessible sites
  • Static Content - Scrapes published HTML, not API-based
  • Manual Refresh - No real-time updates (use refresh tool)
  • Text-Focused - Extracts text content, not interactive elements

📄 License

MIT


Need help? Check the MCP documentation or open an issue.

Installatioun

TypingMind
Viraussetzungen:

Node.js 18+

{
  "mcpServers": {
    "tcsenpai-mcpbook": {
      "command": "npx",
      "args": [
        "-y",
        "gitbook-mcp-server"
      ]
    }
  }
}

GitBook MCP Server MCP mat verschiddene KI-Modeller benotzen

TypingMind verbënnt MCP-Tools um Niveau vum Aarbechtsberäich. Soubal GitBook MCP Server verbonnen ass, kënnt Dir et mat verschiddene KI-Modeller an TypingMind benotzen, amplaz et fir all Modell separat anzeriichten. Dir kënnt MCP lokal op Ärem Apparat ausféieren oder Iech mat enger Remote-MCP-Server-URL verbannen.

Optioun 1: De lokale Connector benotzen

Benotzt dës Optioun, wann den MCP-Server Zougrëff op lokal Fichieren, Appen oder privat Ressourcen op Ärem Computer brauch.

1

D'MCP-Astellungen opmaachen

Gitt an TypingMind op „Astellungen“, „Erweidert Astellungen“, dann op „Model Context Protocol“ a wielt „Connector ariichten“.

  1. Maacht TypingMind an Ärem Browser op.
  2. Klickt op d'Astellungssymbol.
  3. Gitt op „Erweidert Astellungen“.
  4. Maacht d'Sektioun „Model Context Protocol“ op.
  5. Klickt op „Connector ariichten“ a wielt „Dësen Apparat“.
Ariichtungsbildschierm vum TypingMind-MCP-Connector mat „Dësen Apparat“ ausgewielt
2

De Connector-Befeel ausféieren

Wielt „Dësen Apparat“, kopéiert de Befeel aus TypingMind a féiert en am Terminal aus. Loosst de Prozess lafen, wärend Dir MCP benotzt.

  1. Kopéiert den Ariichtungsbefeel, deen TypingMind uweist.
  2. Maacht Terminal op macOS oder Windows Terminal op Windows op.
  3. Pescht de Befeel an a féiert en aus.
  4. Bestätegt d'Installatioun vum Package, wann den Terminal Iech freet, ob Dir weiderfuere wëllt.
  5. Loosst den Terminal an de Prozess doranner lafen, wärend Dir MCP-Tools benotzt.
3

GitBook MCP Server als Server derbäisetzen

Wann de Connector-Status „Prett“ ass, klickt op „Serveren änneren“ a pescht d'MCP-Serverkonfiguratioun an.

  1. Waart, bis de Connector-Status „Prett“ weist.
  2. Klickt op „Serveren änneren“.
  3. Pescht d'MCP-Serverkonfiguratioun vu GitBook MCP Server an.
  4. Späichert d'Serverlëscht.
  5. Aktualiséiert, wann Dir kontrolléiere wëllt, ob de Connector nach ëmmer prett ass.
MCP-Astellunge vun TypingMind mat aktivem Server an dem Knäppchen „Serveren änneren“
{
  "mcpServers": {
    "tcsenpai-mcpbook": {
      "command": "npx",
      "args": [
        "-y",
        "gitbook-mcp-server"
      ]
    }
  }
}
4

D'Verbindung mat verschiddene Modeller benotzen

Späichert d'Serverlëscht, maacht „Plugins“ op an aktivéiert d'MCP-Tools vu GitBook MCP Server. Wielt dann e belibegen ënnerstëtzte KI-Modell an TypingMind a benotzt d'Tools am Chat oder weist se engem KI-Agent zou.

  1. Maacht d'Säit „Plugins“ an TypingMind op.
  2. Aktivéiert d'MCP-Tools vu GitBook MCP Server.
  3. Start e Chat a wielt de KI-Modell, deen Dir benotze wëllt.
  4. Benotzt d'MCP-Tools am Chat oder weist se engem KI-Agent zou.
  5. Wiesselt bei Bedarf op en anere KI-Modell, ouni MCP nei ze verbannen.
TypingMind-Chat mat aktivéierte MCP-Tools an engem ausgewielte KI-Modell
Hëlleft Dir mir bei dëser Aufgab mat GitBook MCP Server?
GitBook MCP Server
Jo. Ech hunn et gelies.
Dat hunn ech mat GitBook MCP Server fonnt.

Optioun 2: Eng MCP-Server-URL derbäisetzen

Benotzt dës Optioun, wann GitBook MCP Server scho remote gehost gëtt oder Är Ekipp ee gemeinsame Connector wëllt, op dee méi Benotzer kënnen zougräifen.

1

MCP-Connectoren opmaachen

Gitt an TypingMind op „Plugins“, maacht „MCP-Connectoren“ op a wielt dann „URL derbäisetzen“.

  1. Maacht TypingMind an Ärem Browser op.
  2. Gitt op „Plugins“.
  3. Maacht „MCP-Connectoren“ op.
  4. Klickt op „URL derbäisetzen“.
TypingMind-Formulaire fir eng benotzerdefinéiert MCP-Server-URL derbäizesetzen
2

D'Server-URL apeschen

Gitt Är Server-URL am Feld „Server-URL“ an. Setzt e Verbindungsnumm, eng Beschreiwung, e Symbol, benotzerdefinéiert HTTP-Headeren oder OAuth-Clientastellungen derbäi, wann de Server se erfuerdert.

  1. Pescht Är Server-URL an d'Feld „Server-URL“.
  2. Gitt en Numm fir d'Verbindung mat GitBook MCP Server an.
  3. Setzt eng Beschreiwung an e Symbol derbäi, fir d'Verbindung méi einfach erëmzeerkennen.
  4. Setzt benotzerdefinéiert HTTP-Headeren oder OAuth-Clientdetailer derbäi, wann de Server eng Authentifizéierung erfuerdert.
3

D'Verbindung erstellen

Klickt op „Verbindung erstellen“, gitt dann zeréck op d'Plugin-Lëscht a kontrolléiert, ob déi nei MCP-Verbindung aktiv ass.

  1. Klickt op „Verbindung erstellen“.
  2. Gitt zeréck op d'Lëscht vun de MCP-Connectoren.
  3. Kontrolléiert, ob d'Verbindung mat GitBook MCP Server als aktiv ugewise gëtt.
  4. Aktualiséiert d'Plugin-Lëscht, wann d'Verbindung net direkt ugewise gëtt.
4

Modeller wiesselen ouni nei ze verbannen

Start e Chat mat Ärem bevorzugte Modell, aktivéiert d'Tools vu GitBook MCP Server ënner „Plugins“ a wiesselt bei Bedarf op en anere Modell. D'MCP-Verbindung bleift am TypingMind-Aarbechtsberäich disponibel.

  1. Start en neie Chat an TypingMind.
  2. Wielt de KI-Modell, deen Dir benotze wëllt.
  3. Aktivéiert d'Tools vu GitBook MCP Server ënner „Plugins“.
  4. Biet de Modell, den Tool ze benotzen, wann néideg.
  5. Wiesselt op en anere KI-Modell a benotzt déiselwecht MCP-Verbindung weider.
TypingMind-Chat mat aktivéierte MCP-Tools an engem ausgewielte KI-Modell
Hëlleft Dir mir bei dëser Aufgab mat GitBook MCP Server?
GitBook MCP Server
Jo. Ech hunn et gelies.
Dat hunn ech mat GitBook MCP Server fonnt.

Heefeg gestallte Froen

Fir wat gëtt de MCP-Server GitBook MCP Server benotzt?

GitBook MCP Server ass e MCP-Server, deen et kompatibele KI-Clienten erlaabt, sech mat externen Tools a Kontext ze verbannen. An TypingMind kënnt Dir dëse MCP-Server eemol derbäisetzen a seng Tools an Ärem KI-Aarbechtsberäich zur Verfügung stellen.

Kann ech GitBook MCP Server MCP mat méi KI-Modeller an TypingMind benotzen?

Jo. TypingMind verbënnt MCP-Tools um Niveau vum Aarbechtsberäich. Sou kënnt Dir GitBook MCP Server mat verschiddene KI-Modeller wéi Claude, ChatGPT, Gemini oder anere Modeller benotzen, déi Dir an TypingMind konfiguréiert hutt, ouni de MCP-Server fir all Modell separat anzeriichten.

Firwat GitBook MCP Server MCP mat TypingMind benotzen?

TypingMind ass eng vun de beschte Benotzeruewerfläche fir LLM-Chat, well et méi KI-Modeller, Prompts, Plugins, KI-Agenten, API-Schlësselen a MCP-Tools an engem Aarbechtsberäich zesummebréngt. Wann GitBook MCP Server verbonnen ass, kënnt Dir seng MCP-Tools mat Äre bevorzugte Modeller benotzen a gläichzäiteg Är Chataarbecht an TypingMind organiséieren.

Wéi verbannen ech GitBook MCP Server MCP mat TypingMind?

Dir kënnt GitBook MCP Server iwwer de lokale MCP-Connector oder iwwer d'URL vun engem Remote-MCP-Server mat TypingMind verbannen. Benotzt de lokale Connector, wann de Server Zougrëff op Fichieren, Apps oder privat Ressourcen op Ärem Apparat brauch, an eng Server-URL, wann de MCP-Server op Distanz gehost gëtt.

Wéi eng Tools stellt GitBook MCP Server MCP an TypingMind zur Verfügung?

GitBook MCP Server stellt MCP-Funktiounen zur Verfügung, déi Dir op der Plugins-Säit vun TypingMind aktivéiere kënnt, fir se am Chat ze benotzen oder KI-Agenten zouzeweisen.

Muss ech meng API-Schlëssele mat TypingMind deelen, fir GitBook MCP Server MCP ze benotzen?

Nee. TypingMind setzt op lokal Veraarbechtung a léisst Iech d'Kontroll iwwer Är Modellubidder, API-Schlësselen, Prompts a MCP-Konfiguratioun. Wann GitBook MCP Server eng Authentifizéierung verlaangt, setzt déi néideg Headeren, OAuth-Astellungen oder lokal Konfiguratioun fir dee MCP-Server derbäi, wann Dir d'Verbindung erstallt.

Änlech MCP-Serveren

All weisen

Elo Ären eegene KI-Workspace ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇