GitBook MCP server for AI agents and assistants

Securely connect your AI agents and chatbots (Claude, ChatGPT, Cursor, etc) with GitBook MCP or direct API to browse sites, open pages, manage change requests, and run GitBook operations through natural language.

GitBook MCP logoGitBook MCP
Dcr Oauth

GitBook MCP is GitBook's hosted MCP server for browsing sites, pages, and change requests. It gives AI tools a secure, ready-made way to work with GitBook content.

13 Tools

Try GitBook MCP now

Type what you want done — sign in and watch it run live in the Tool Router playground.

TOOL ROUTER PLAYGROUND
GitBook MCP
Try asking
TOOLS

Supported Tools

Every GitBook MCP action and event your agent gets out of the box.

Create change request

Opens a change request on a space.

Describe operation

Describes one GitBook API operation found via search: its path/query parameters and request-body JSON Schema, so you can build params for invoke_operation.

Get page

Returns a page from the space's main content as markdown plus its id, title and path.

Get schema definition

Returns the JSON Schema of a type that a tool's input schema leaves out, such as a document block, along with the types it contains.

Get site structure

Returns a site's navigation structure: its sections, groups, external links (with destination URLs), and published spaces, with the paths and ids needed to read content.

Get subscription information

Returns a GitBook organization's subscription: whether it is on a trial, the free plan or a paid plan, when an active trial ends and how many days are left, and where to upgrade.

Get usage guide

Returns procedural guidance for working with GitBook through this server (content model and step-by-step recipes).

Invoke operation

Runs one GitBook API operation discovered via search, for capabilities not covered by a curated tool.

List sites

Lists the published sites in a GitBook organization, the usual entry point for orientation.

List site topics

Lists the topics and subtopics a site's content and visitor questions are organised under, ranked by how many Ask AI questions they drew over the range, with each one's answered rate, open findings and id.

Report tool feedback

Sends a feedback report to GitBook about this MCP server's tools or operations: a confusing tool or parameter, a failed or unusable call, or a missing capability.

Search

Searches the GitBook API operations this server can run, returning matches (id, method, path, summary) to run with invoke_operation.

Submit or merge change request

Merges a change request, publishing its edits to the space.

SETUP GUIDE

Connect GitBook MCP Tool with your Agent

1

Install Composio

typescript
npm install @composio/core ai @ai-sdk/mcp @ai-sdk/openai
Install the Composio SDK and your agent framework
2

Create a session with MCP enabled

typescript
import { Composio } from "@composio/core";

const composio = new Composio();
const { mcp } = await composio.create("your-user-id", {
  toolkits: ["gitbook_mcp"],
  mcp: true,
});
Create a session scoped to GitBook MCP and read its MCP URL and headers
3

Connect your agent to the MCP server

typescript
import { createMCPClient } from "@ai-sdk/mcp";
import { openai } from "@ai-sdk/openai";
import { generateText, stepCountIs } from "ai";

const client = await createMCPClient({
  transport: { type: "http", url: mcp.url, headers: mcp.headers },
});

const { text } = await generateText({
  model: openai("gpt-5.6-sol"),
  tools: await client.tools(),
  prompt: "Open the Getting Started page on my GitBook site and summarize its setup steps.",
  stopWhen: stepCountIs(10),
});

console.log(text);
await client.close();
Pass the session's MCP URL and headers to your agent and run a GitBook MCP request
SETUP GUIDE

Connect GitBook MCP API Tool with your Agent

1

Install Composio

typescript
npm install @composio/core @composio/openai openai
Install the Composio SDK, the OpenAI provider, and the OpenAI SDK
2

Create a Composio session

typescript
import OpenAI from "openai";
import { Composio } from "@composio/core";
import { OpenAIResponsesProvider } from "@composio/openai";

const composio = new Composio({ provider: new OpenAIResponsesProvider() });
const client = new OpenAI();

const session = await composio.create("your-user-id", { toolkits: ["gitbook_mcp"] });
const tools = await session.tools();
Initialize Composio with the OpenAI Responses provider and create a session scoped to GitBook MCP
3

Run GitBook MCP tools with your agent

typescript
let response = await client.responses.create({
  model: "gpt-5.6-sol",
  tools,
  input: [{ role: "user", content: "Open the Getting Started page on my GitBook site and summarize its setup steps." }],
});

while (response.output.some((o) => o.type === "function_call")) {
  const outputs = await composio.provider.handleToolCalls(session, response.output);
  response = await client.responses.create({
    model: "gpt-5.6-sol",
    tools,
    previous_response_id: response.id,
    input: outputs,
  });
}

console.log(response.output_text);
Send a request, execute the GitBook MCP tool calls through the session, and print the final answer

Why Use Composio?

AI Native GitBook MCP Integration

  • Supports both GitBook MCP and direct API based integrations
  • Structured, LLM-friendly schemas for reliable tool execution
  • Rich coverage for reading, writing, and querying your GitBook data

Managed Auth

  • Built-in OAuth handling with automatic token refresh and rotation
  • Central place to manage, scope, and revoke GitBook access
  • Per user and per environment credentials instead of hard-coded keys

Agent Optimized Design

  • Tools are tuned using real error and success rates to improve reliability over time
  • Comprehensive execution logs so you always know what ran, when, and on whose behalf

Enterprise Grade Security

  • Fine-grained RBAC so you control which agents and users can access GitBook
  • Scoped, least privilege access to GitBook resources
  • Full audit trail of agent actions to support review and compliance
FRAMEWORKS

Use GitBook MCP with any AI Agent Framework

Choose a Framework you want to connect GitBook MCP with

Rolling this out across your team?

Give your team centralized access control across every framework with Composio’s MCP Gateway.

EXPLORE MCP GATEWAY
FAQ

Frequently asked questions

Start with GitBook MCP.It takes 30 seconds.

Managed auth, hosted MCP servers, and every GitBook MCP tool your agent needs.Free to start.

Start building