Get the FREE Ultimate OpenClaw Setup Guide →

gitbook

A Model Context Protocol (MCP) server that provides access to GitBook's API for AI assistants and LLM applications.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio rickysullivan-gitbook-mcp npx gitbook-mcp --organization-id=your_organization_id_here \
  --env GITBOOK_API_TOKEN="gb_api_your_token_here"

How to use

This GitBook MCP server exposes GitBook data through the MCP interface, allowing AI agents and assistants to discover organizations, browse spaces, inspect collections and content, and retrieve page content and file metadata. It includes 12 content-related tools organized by function (organization discovery, space management, content retrieval, file management, and collection management) along with 6 AI-powered prompts to streamline documentation workflows. Typical workflows include listing accessible organizations, exploring spaces within an org, fetching page content or space structures, searching content, and retrieving metadata for files and collections. Tools are designed to be read-only where appropriate and to operate in an open-world fashion, making it suitable for embedding in assistants that need up-to-date GitBook data. To use the server, configure it with your GitBook API token and optionally an organization or space ID, then invoke the available MCP tools to query or fetch content programmatically.

How to install

Prerequisites:

  • Node.js (LTS version recommended) and npm installed on your machine
  • GitBook API token (generate at https://app.gitbook.com/account/developer)
  • Optional: Organization ID if you want to scope by organization

Installation steps:

  1. Ensure Node.js and npm are installed
    • Check: node -v and npm -v
  2. Obtain your GitBook API token and organization ID
  3. Run the MCP server using npx (no local install required):
    • npx gitbook-mcp --organization-id=your_organization_id_here
  4. Supply the API token via environment variable (recommended):
    • GITBOOK_API_TOKEN=gb_api_your_token_here npx gitbook-mcp --organization-id=your_organization_id_here
  5. (Optional) Persist config in your IDE or editor integration using the example configurations provided in the README, replacing placeholders with your actual values.

Additional notes

Notes and tips:

  • The server expects GITBOOK_API_TOKEN in environment variables or in the MCP config under env.
  • Organization and space IDs are optional but recommended for scoping results; you can discover them using list_organizations and list_spaces tools after setup.
  • The .env file is only supported for local development when running the server directly, not when using npx gitbook-mcp in a production or embedded workflow.
  • If you encounter rate limits or authentication issues, verify that your API token has the necessary scopes for the operations you intend to perform (e.g., read access to organizations, spaces, and content).
  • The 12 content tools cover organization discovery, space management, content retrieval (pages and content structure), file management, and collection discovery; they are designed to be combined with prompts for documentation workflows.
  • When configuring in IDEs or editors, ensure the command and args exactly reflect the placeholder organization ID and token you intend to use.

Related MCP Servers

Sponsor this space

Reach thousands of developers