- Home
- MCP servers
- GitBook
GitBook
- typescript
15
GitHub Stars
typescript
Language
5 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"rickysullivan-gitbook-mcp": {
"command": "npx",
"args": [
"gitbook-mcp",
"--organization-id=your_organization_id_here"
],
"env": {
"GITBOOK_SPACE_ID": "space_67890",
"GITBOOK_API_TOKEN": "gb_api_your_token_here",
"GITBOOK_ORGANIZATION_ID": "org_12345"
}
}
}
}You can connect to GitBook content and workflows through a dedicated MCP server that exposes content, spaces, collections, and AI-assisted prompts. This server lets you discover, read, search, and retrieve documentation data programmatically while supporting automation and AI-driven documentation tasks.
How to use
To use the GitBook MCP server, configure an MCP client to connect via the provided stdio or http options. You can run multiple client configurations to integrate with IDEs or AI assistants. Each client will authenticate with a GitBook API token and can specify an organization or space context to scope operations. Typical workflows include listing organizations and spaces, exploring space content and pages, retrieving page content, and running AI prompts to analyze, summarize, or optimize documentation.
How to install
Prerequisites you need before installing:
- Node.js 20+
- npm
- GitBook API token (generate at the GitBook developer portal)
Clone the MCP server repository, install dependencies, and set up the local environment, then run the development server.
Install steps
# Clone the MCP server repository
git clone https://github.com/rickysullivan/gitbook-mcp.git
cd gitbook-mcp
# Install dependencies
npm install
# Set up local development environment (optional but recommended)
npm run setup
# Add your GitBook API token for development only
# Create a local environment file and export the token
# Example: echo "GITBOOK_API_TOKEN=gb_api_your_token_here" > .env.local
Start the server for development
npm run dev
Configuration and usage notes
Use the following environment variables and CLI arguments to configure the MCP server for your workspace. The API token is required, while organization and space identifiers can be set as defaults or provided per request.
Environment and runtime options
Environment variables you may configure in your local environment or in an .env file include: GITBOOK_API_TOKEN, GITBOOK_ORGANIZATION_ID, and GITBOOK_SPACE_ID. You can also pass --organization-id and --space-id on startup to set defaults for the session.
Additional sections
Configuration options include: CLI arguments, embedded configuration files, and environment variables. If you use a default organization or space, tools marked as optional will omit corresponding IDs and automatically use the configured defaults. Explicit parameters override defaults.
Security considerations
Keep your GitBook API token secure. Do not commit tokens to version control. Use environment-specific configurations (like local .env files or environment variables in your deployment platform) to supply the token at runtime.
Troubleshooting tips
If you encounter authentication or permission issues, verify that the API token is correct and has access to the target organization and spaces. For misconfigurations, confirm that the organization and space IDs (if used) exist and that your token is active.
Prompts and tools overview
The server offers 6 AI-powered prompts to support documentation workflows and 12 tools for content operations. You can fetch documentation topics, analyze gaps, audits, and summaries, and perform content optimization.
Examples of typical commands to start a client connection
Connect via an IDE or assistant using a configuration that points to the local or remote MCP endpoint and passes the required authentication token. Each client configuration should specify the server command, arguments, and environment variables as shown in the supported examples.
Available tools
list_organizations
Lists all accessible GitBook organizations.
list_spaces
Lists spaces, optionally filtered by organization.
get_space
Retrieves detailed information about a specific space.
get_space_content
Retrieves the content structure and pages of a space.
search_content
Searches for content within a space using full-text search.
get_page_content
Retrieves the content of a specific page.
get_page_by_path
Retrieves page content using the page path.
get_space_files
Lists all files in a space.
get_file
Retrieves details of a specific file.
list_collections
Lists all accessible collections.
get_collection
Retrieves details of a specific collection.
get_collection_spaces
Lists all spaces within a collection.
fetch_documentation
Fetches and analyzes GitBook documentation content for specific topics.
analyze_content_gaps
Identifies gaps and missing content in documentation.
content_audit
Performs quality audits of documentation content.
documentation_summary
Generates comprehensive summaries of GitBook spaces.
content_optimization
Optimizes content for SEO, readability, structure, or performance.