gitbook-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| GITBOOK_TOKEN | Yes | Personal access token (required). | |
| GITBOOK_ENDPOINT | No | API base URL. | https://api.gitbook.com |
| GITBOOK_READONLY | No | Hide all write tools when true. | false |
| GITBOOK_HTTP_HOST | No | HTTP bind host. | 127.0.0.1 |
| GITBOOK_HTTP_PORT | No | HTTP port. | 3000 |
| GITBOOK_LOG_LEVEL | No | Log level: debug/info/warn/error. | info |
| GITBOOK_TRANSPORT | No | stdio or http. | stdio |
| GITBOOK_TIMEOUT_MS | No | Per-request timeout. | 30000 |
| GITBOOK_MAX_RETRIES | No | Max retries on 429/5xx/transport errors. | 5 |
| GITBOOK_HTTP_AUTH_TOKEN | No | Bearer token required on the HTTP transport. | |
| GITBOOK_MAX_CONCURRENCY | No | Max concurrent outbound GitBook HTTP requests per instance. | 8 |
| GITBOOK_HTTP_TRUST_PROXY | No | Trust X-Forwarded-* headers. | false |
| GITBOOK_HTTP_MAX_SESSIONS | No | Concurrent-session cap. | 256 |
| GITBOOK_HTTP_ALLOWED_HOSTS | No | Comma-separated hosts for DNS-rebinding allow-list. | |
| GITBOOK_HTTP_RATE_LIMIT_MAX | No | Max /mcp requests per window per IP. | 120 |
| GITBOOK_HTTP_SESSION_TTL_MS | No | Idle-session reaper TTL. | 300000 |
| GITBOOK_HTTP_ALLOWED_ORIGINS | No | Comma-separated origins for CORS allow-list. | |
| GITBOOK_HTTP_RATE_LIMIT_WINDOW_MS | No | Rate-limit window per client IP. | 60000 |
| GITBOOK_HTTP_SESSION_MAX_LIFETIME_MS | No | Absolute session lifetime. | 3600000 |
Capabilities
Features and capabilities supported by this server
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
| resources | {
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| gitbook_comment_change_requestB | Post a markdown comment on a change request (review feedback / notes). |
| gitbook_create_change_requestA | Create a change request (draft branch) on a space. Returns its id to target with gitbook_import_content / gitbook_comment_change_request, then gitbook_merge_change_request to publish. |
| gitbook_get_change_request_by_idA | Get a change request by its ID. (GET /spaces/{spaceId}/change-requests/{changeRequestId}) |
| gitbook_get_change_request_changesB | Get change request semantic changes. (GET /spaces/{spaceId}/change-requests/{changeRequestId}/changes) |
| gitbook_get_change_request_pdfA | Get a URL of the content of a change request as PDF. (GET /spaces/{spaceId}/change-requests/{changeRequestId}/pdf) |
| gitbook_get_change_request_review_by_idB | Get a change request review by its ID. (GET /spaces/{spaceId}/change-requests/{changeRequestId}/reviews/{reviewId}) |
| gitbook_get_comment_in_change_requestB | Get a change request comment. (GET /spaces/{spaceId}/change-requests/{changeRequestId}/comments/{commentId}) |
| gitbook_get_comment_reply_in_change_requestB | Get a change request comment reply. (GET /spaces/{spaceId}/change-requests/{changeRequestId}/comments/{commentId}/replies/{commentReplyId}) |
| gitbook_get_contributors_by_change_request_idB | Get all contribors of a change request. (GET /spaces/{spaceId}/change-requests/{changeRequestId}/contributors) |
| gitbook_get_file_in_change_request_by_idA | Get a change request file by its ID. (GET /spaces/{spaceId}/change-requests/{changeRequestId}/content/files/{fileId}) |
| gitbook_get_page_in_change_request_by_idB | Get a change request page by its ID. (GET /spaces/{spaceId}/change-requests/{changeRequestId}/content/page/{pageId}) |
| gitbook_get_page_in_change_request_by_pathB | Get a change request page by its path. (GET /spaces/{spaceId}/change-requests/{changeRequestId}/content/path/{pagePath}) |
| gitbook_get_requested_reviewers_by_change_request_idA | Get all change request reviewers. (GET /spaces/{spaceId}/change-requests/{changeRequestId}/requested-reviewers) |
| gitbook_get_reusable_content_in_change_request_by_idA | Get a change request reusable content by its ID. (GET /spaces/{spaceId}/change-requests/{changeRequestId}/content/reusable-contents/{reusableContentId}) |
| gitbook_get_reviews_by_change_request_idA | List all change request reviews. (GET /spaces/{spaceId}/change-requests/{changeRequestId}/reviews) |
| gitbook_get_revision_of_change_request_by_idB | Get a change request the latest content revision. (GET /spaces/{spaceId}/change-requests/{changeRequestId}/content) |
| gitbook_list_change_request_file_backlinksB | List all backlink locations of a change request file. (GET /spaces/{spaceId}/change-requests/{changeRequestId}/content/files/{fileId}/backlinks) |
| gitbook_list_change_request_linksB | List all change request links. (GET /spaces/{spaceId}/change-requests/{changeRequestId}/links) |
| gitbook_list_change_request_page_backlinksB | List all backlink locations of a change request page. (GET /spaces/{spaceId}/change-requests/{changeRequestId}/content/page/{pageId}/backlinks) |
| gitbook_list_change_request_page_meta_linksA | List all meta links of a change request page. (GET /spaces/{spaceId}/change-requests/{changeRequestId}/content/page/{pageId}/meta-links) |
| gitbook_list_change_requests_for_organizationB | List all change requests in an organization. (GET /orgs/{organizationId}/change-requests) |
| gitbook_list_change_requests_for_spaceB | List all change requests. (GET /spaces/{spaceId}/change-requests) |
| gitbook_list_comment_replies_in_change_requestA | List all change request comment replies. (GET /spaces/{spaceId}/change-requests/{changeRequestId}/comments/{commentId}/replies) |
| gitbook_list_commenters_in_change_requestA | List all users who commented in a CR. (GET /spaces/{spaceId}/change-requests/{changeRequestId}/commenters) |
| gitbook_list_comments_in_change_requestA | List all change request comments. (GET /spaces/{spaceId}/change-requests/{changeRequestId}/comments) |
| gitbook_list_files_in_change_request_by_idA | List all change request files. (GET /spaces/{spaceId}/change-requests/{changeRequestId}/content/files) |
| gitbook_list_page_links_in_change_requestA | List all change request links. (GET /spaces/{spaceId}/change-requests/{changeRequestId}/content/page/{pageId}/links) |
| gitbook_list_pages_in_change_requestA | List all change request pages. (GET /spaces/{spaceId}/change-requests/{changeRequestId}/content/pages) |
| gitbook_merge_change_requestA | Publish a change request into the live space. THIS IS DESTRUCTIVE — it changes the live published docs. Only call after the change request has been reviewed. |
| gitbook_post_comment_reply_in_change_requestB | Create a change request comment reply. (POST /spaces/{spaceId}/change-requests/{changeRequestId}/comments/{commentId}/replies) |
| gitbook_request_reviewers_for_change_requestC | Request change request reviewers. (POST /spaces/{spaceId}/change-requests/{changeRequestId}/requested-reviewers) |
| gitbook_submit_change_request_reviewC | Submit a change request review. (POST /spaces/{spaceId}/change-requests/{changeRequestId}/reviews) |
| gitbook_update_change_requestA | Pull primary content into the change request. (POST /spaces/{spaceId}/change-requests/{changeRequestId}/update) |
| gitbook_update_change_request_by_idB | Update a change request. (PATCH /spaces/{spaceId}/change-requests/{changeRequestId}) |
| gitbook_update_comment_in_change_requestB | Update a change request comment. (PUT /spaces/{spaceId}/change-requests/{changeRequestId}/comments/{commentId}) |
| gitbook_update_comment_reply_in_change_requestC | Update a change request comment reply. (PUT /spaces/{spaceId}/change-requests/{changeRequestId}/comments/{commentId}/replies/{commentReplyId}) |
| gitbook_apply_template_to_spaceC | Apply a template to a space.. (POST /spaces/{spaceId}/content/template) |
| gitbook_cancel_import_runA | Cancel an import run. (POST /org/{organizationId}/imports/{importRunId}/cancel) Asynchronous — GitBook exposes no status endpoint, so treat the result as 'started, not confirmed' and verify in GitBook. |
| gitbook_create_spaceB | Create a space. (POST /orgs/{organizationId}/spaces) |
| gitbook_duplicate_spaceC | Duplicate a space. (POST /spaces/{spaceId}/duplicate) |
| gitbook_get_comment_in_spaceA | Get a space comment. (GET /spaces/{spaceId}/comments/{commentId}) |
| gitbook_get_comment_reply_in_spaceA | Get a space comment reply. (GET /spaces/{spaceId}/comments/{commentId}/replies/{commentReplyId}) |
| gitbook_get_computed_documentB | Get a space computed document. (POST /spaces/{spaceId}/content/computed/document) |
| gitbook_get_computed_revisionC | Get a space computed revision. (POST /spaces/{spaceId}/content/computed/revision) |
| gitbook_get_current_revisionA | Get a space current revision. (GET /spaces/{spaceId}/content) |
| gitbook_get_document_by_idA | Get a space document by its ID. (GET /spaces/{spaceId}/documents/{documentId}) |
| gitbook_get_embed_by_url_in_spaceB | Resolve a URL to an embed in a given space. (GET /spaces/{spaceId}/embed) |
| gitbook_get_file_by_idA | Get a space file by its ID. (GET /spaces/{spaceId}/content/files/{fileId}) |
| gitbook_get_file_in_revision_by_idB | Get a space revision file by its ID. (GET /spaces/{spaceId}/revisions/{revisionId}/files/{fileId}) |
| gitbook_get_organization_by_idA | Get an organization by its ID. (GET /orgs/{organizationId}) |
| gitbook_get_pageA | Read a page by id. format='markdown' (default) returns rendered markdown; format='document' returns GitBook's structured Document JSON. |
| gitbook_get_page_by_pathA | Get a space page by its path. (GET /spaces/{spaceId}/content/path/{pagePath}) |
| gitbook_get_page_document_in_revision_by_idA | Get the document of a page in a revision. (GET /spaces/{spaceId}/revisions/{revisionId}/page/{pageId}/document) |
| gitbook_get_page_in_revision_by_idA | Get a space revision page by its ID. (GET /spaces/{spaceId}/revisions/{revisionId}/page/{pageId}) |
| gitbook_get_page_in_revision_by_pathB | Get a space revision page by its path. (GET /spaces/{spaceId}/revisions/{revisionId}/path/{pagePath}) |
| gitbook_get_reusable_content_by_idA | Get a space reusable content by its ID. (GET /spaces/{spaceId}/content/reusable-contents/{reusableContentId}) |
| gitbook_get_reusable_content_document_in_revision_by_idB | Get the document of a reusable content in a revision. (GET /spaces/{spaceId}/revisions/{revisionId}/reusable-contents/{reusableContentId}/document) |
| gitbook_get_reusable_content_in_revision_by_idA | Get a space revision reusable content by its ID. (GET /spaces/{spaceId}/revisions/{revisionId}/reusable-contents/{reusableContentId}) |
| gitbook_get_revision_by_idC | Get a space revision. (GET /spaces/{spaceId}/revisions/{revisionId}) |
| gitbook_get_revision_semantic_changesB | Get space revision semantic changes. (GET /spaces/{spaceId}/revisions/{revisionId}/changes) |
| gitbook_get_spaceA | Fetch a single space by id (title, visibility, urls, default revision). |
| gitbook_get_space_pdfA | Get a URL of the content of a space as PDF. (GET /spaces/{spaceId}/pdf) |
| gitbook_get_user_by_idB | Get a user by its ID. (GET /users/{userId}) |
| gitbook_import_contentA | GitBook's content-write primitive: import a public web page (sourceUrl) into a space — scoped to a change request (and optionally a page), AI-enhanced by default. There is NO direct 'set page body' API; this is the supported write path. The import is asynchronous (returns a run id + status); review in GitBook, then gitbook_merge_change_request to publish. |
| gitbook_list_comment_replies_in_spaceB | List all space comment replies. (GET /spaces/{spaceId}/comments/{commentId}/replies) |
| gitbook_list_commenters_in_spaceA | List all users who commented in a space. (GET /spaces/{spaceId}/commenters) |
| gitbook_list_comments_in_spaceA | List all space comments. (GET /spaces/{spaceId}/comments) |
| gitbook_list_filesA | List all space files. (GET /spaces/{spaceId}/content/files) |
| gitbook_list_files_in_revision_by_idA | List all space revision files. (GET /spaces/{spaceId}/revisions/{revisionId}/files) |
| gitbook_list_orgsA | List organizations the authenticated user can access. Use the returned id as orgId for other tools. |
| gitbook_list_page_links_in_spaceA | List all space page links. (GET /spaces/{spaceId}/content/page/{pageId}/links) |
| gitbook_list_pagesA | List the page tree of a space's current revision (page ids, titles, paths). Not paginated. |
| gitbook_list_pages_in_revision_by_idA | List all pages in a space revision. (GET /spaces/{spaceId}/revisions/{revisionId}/pages) |
| gitbook_list_revision_page_meta_linksB | List all meta links for a revision page. (GET /spaces/{spaceId}/revisions/{revisionId}/page/{pageId}/meta-links) |
| gitbook_list_space_file_backlinksB | List all space file backlink locations. (GET /spaces/{spaceId}/content/files/{fileId}/backlinks) |
| gitbook_list_space_linksC | Get all links in a space including their status and location where they appear.. (GET /spaces/{spaceId}/links) |
| gitbook_list_space_page_backlinksA | List all space page backlink locations. (GET /spaces/{spaceId}/content/page/{pageId}/backlinks) |
| gitbook_list_space_page_meta_linksA | List all meta links for a space page. (GET /spaces/{spaceId}/content/page/{pageId}/meta-links) |
| gitbook_list_spacesA | List the spaces inside an organization. Get orgId from gitbook_list_orgs. |
| gitbook_move_spaceB | Move a space to a new position. (POST /spaces/{spaceId}/move) |
| gitbook_post_comment_in_spaceC | Create a space comment. (POST /spaces/{spaceId}/comments) |
| gitbook_post_comment_reply_in_spaceB | Create a space comment reply. (POST /spaces/{spaceId}/comments/{commentId}/replies) |
| gitbook_restore_spaceB | Restore a deleted space. (POST /spaces/{spaceId}/restore) |
| gitbook_searchA | Full-text search. Provide orgId to search an organization, or spaceId to search a single space (exactly one is required). |
| gitbook_update_comment_in_spaceB | Update a space comment. (PUT /spaces/{spaceId}/comments/{commentId}) |
| gitbook_update_comment_reply_in_spaceB | Update a space comment reply. (PUT /spaces/{spaceId}/comments/{commentId}/replies/{commentReplyId}) |
| gitbook_update_space_by_idC | Update a space. (PATCH /spaces/{spaceId}) |
| gitbook_update_user_by_idB | Update a user by its ID. (PATCH /users/{userId}) |
| gitbook_whoamiA | Return the GitBook user the configured token authenticates as (id, name, email). |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/HoYongJin/gitbook-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server