> For the complete documentation index, see [llms.txt](https://gitbook.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gitbook.com/docs/overview.md).

# Overview

{% columns %}
{% column width="33.33333333333333%" %}

## Publish your documentation in under 5 minutes

Publishing your docs with GitBook is as simple as asking your agent

<a href="https://app.gitbook.com/" class="button primary">Sign up</a><a href="https://www.gitbook.com/enterprise" class="button secondary">Get a demo</a>
{% endcolumn %}

{% column width="66.66666666666667%" %}
{% code overflow="wrap" expandable="true" %}

````md
# GitBook Setup Agent

## Task
Take my docs and turn them into a live, published GitBook site. Go end-to-end — don't stop until it's live or you hit a step only I can do.

## Tooling
You have two ways to work with GitBook. Check what's available and pick accordingly:

1. **GitBook MCP server** (preferred if already connected) — check your available tools for `gitbook-mcp`. If it's connected, use it.
2. **GitBook skill** (fallback, or if I ask for it) — if the MCP server isn't installed and can't be added, install the skill instead:
```bash
   npx skills add GitbookIO/gitbook-skills
```
   Then follow the skill's instructions to drive the GitBook REST API directly. This path requires a GitBook API token (PAT) from me — ask for it if you don't have one.

## Setting up the MCP server (if not connected)
Connect to `https://mcp.gitbook.com/mcp`. Use OAuth unless I give you a PAT.

**Claude Code:**
```bash
claude mcp add --transport http gitbook-mcp https://mcp.gitbook.com/mcp
```
(with PAT, add `--header "Authorization: Bearer <YOUR_PAT>"`) — then run `/mcp` to auth/verify.

**Codex:**
```bash
codex mcp add gitbook-mcp --url https://mcp.gitbook.com/mcp
```
(for PAT, set `GITBOOK_MCP_TOKEN` and add a `[mcp_servers.gitbook-mcp]` block with `bearer_token_env_var` to `~/.codex/config.toml`) — verify with `codex mcp list`.

If MCP setup fails or isn't supported in this environment, fall back to the skill (option 2 above) rather than stopping.

## Import Docs
Once you have a working connection (MCP or skill), pull in my existing docs (point me to a folder, repo, or other docs site if you need one) and set up the site, structure, and content from there. Either path should end in the same result: a structured, published site.
````

{% endcode %}

<p align="center"><a href="claude://code/new?q=%23%20GitBook%20Setup%20Agent%0A%23%23%20Task%0ATake%20my%20docs%20and%20turn%20them%20into%20a%20live%2C%20published%20GitBook%20site%2C%20using%20the%20GitBook%20MCP%20server.%20Go%20end-to-end%20%E2%80%94%20don%27t%20stop%20until%20it%27s%20live%20or%20you%20hit%20a%20step%20only%20I%20can%20do.%0A%23%23%20Getting%20Started%0AConnect%20to%20the%20GitBook%20MCP%20server%3A%20%60https%3A//mcp.gitbook.com/mcp%60.%20Use%20OAuth%20unless%20I%20give%20you%20a%20PAT.%0A%2A%2AClaude%20Code%3A%2A%2A%0A%60%60%60bash%0Aclaude%20mcp%20add%20--transport%20http%20gitbook-mcp%20https%3A//mcp.gitbook.com/mcp%0A%60%60%60%0A%28with%20PAT%2C%20add%20%60--header%20%22Authorization%3A%20Bearer%20%3CYOUR_PAT%3E%22%60%29%20%E2%80%94%20then%20run%20%60/mcp%60%20to%20auth/verify.%0A%2A%2ACodex%3A%2A%2A%0A%60%60%60bash%0Acodex%20mcp%20add%20gitbook-mcp%20--url%20https%3A//mcp.gitbook.com/mcp%0A%60%60%60%0A%28for%20PAT%2C%20set%20%60GITBOOK_MCP_TOKEN%60%20and%20add%20a%20%60%5Bmcp_servers.gitbook-mcp%5D%60%20block%20with%20%60bearer_token_env_var%60%20to%20%60~/.codex/config.toml%60%29%20%E2%80%94%20verify%20with%20%60codex%20mcp%20list%60.%0A%23%23%20Import%20Docs%0AOnce%20connected%2C%20pull%20in%20my%20existing%20docs%20%28point%20me%20to%20a%20folder%2C%20repo%2C%20or%20other%20docs%20site%20if%20you%20need%20one%29%20and%20use%20the%20MCP%20server%20to%20set%20up%20the%20site%2C%20structure%2C%20and%20content%20from%20there." class="button secondary" data-icon="claude">Claude Code</a><a href="cursor://anysphere.cursor-deeplink/prompt?text=%23%20GitBook%20Setup%20Agent%0A%23%23%20Task%0ATake%20my%20docs%20and%20turn%20them%20into%20a%20live%2C%20published%20GitBook%20site%2C%20using%20the%20GitBook%20MCP%20server.%20Go%20end-to-end%20%E2%80%94%20don%27t%20stop%20until%20it%27s%20live%20or%20you%20hit%20a%20step%20only%20I%20can%20do.%0A%23%23%20Getting%20Started%0AConnect%20to%20the%20GitBook%20MCP%20server%3A%20%60https%3A//mcp.gitbook.com/mcp%60.%20Use%20OAuth%20unless%20I%20give%20you%20a%20PAT.%0A%2A%2AClaude%20Code%3A%2A%2A%0A%60%60%60bash%0Aclaude%20mcp%20add%20--transport%20http%20gitbook-mcp%20https%3A//mcp.gitbook.com/mcp%0A%60%60%60%0A%28with%20PAT%2C%20add%20%60--header%20%22Authorization%3A%20Bearer%20%3CYOUR_PAT%3E%22%60%29%20%E2%80%94%20then%20run%20%60/mcp%60%20to%20auth/verify.%0A%2A%2ACodex%3A%2A%2A%0A%60%60%60bash%0Acodex%20mcp%20add%20gitbook-mcp%20--url%20https%3A//mcp.gitbook.com/mcp%0A%60%60%60%0A%28for%20PAT%2C%20set%20%60GITBOOK_MCP_TOKEN%60%20and%20add%20a%20%60%5Bmcp_servers.gitbook-mcp%5D%60%20block%20with%20%60bearer_token_env_var%60%20to%20%60~/.codex/config.toml%60%29%20%E2%80%94%20verify%20with%20%60codex%20mcp%20list%60.%0A%23%23%20Import%20Docs%0AOnce%20connected%2C%20pull%20in%20my%20existing%20docs%20%28point%20me%20to%20a%20folder%2C%20repo%2C%20or%20other%20docs%20site%20if%20you%20need%20one%29%20and%20use%20the%20MCP%20server%20to%20set%20up%20the%20site%2C%20structure%2C%20and%20content%20from%20there." class="button secondary" data-icon="cursor">Cursor</a><a href="codex://threads/new?prompt=%23%20GitBook%20Setup%20Agent%0A%23%23%20Task%0ATake%20my%20docs%20and%20turn%20them%20into%20a%20live%2C%20published%20GitBook%20site%2C%20using%20the%20GitBook%20MCP%20server.%20Go%20end-to-end%20%E2%80%94%20don%27t%20stop%20until%20it%27s%20live%20or%20you%20hit%20a%20step%20only%20I%20can%20do.%0A%23%23%20Getting%20Started%0AConnect%20to%20the%20GitBook%20MCP%20server%3A%20%60https%3A//mcp.gitbook.com/mcp%60.%20Use%20OAuth%20unless%20I%20give%20you%20a%20PAT.%0A%2A%2AClaude%20Code%3A%2A%2A%0A%60%60%60bash%0Aclaude%20mcp%20add%20--transport%20http%20gitbook-mcp%20https%3A//mcp.gitbook.com/mcp%0A%60%60%60%0A%28with%20PAT%2C%20add%20%60--header%20%22Authorization%3A%20Bearer%20%3CYOUR_PAT%3E%22%60%29%20%E2%80%94%20then%20run%20%60/mcp%60%20to%20auth/verify.%0A%2A%2ACodex%3A%2A%2A%0A%60%60%60bash%0Acodex%20mcp%20add%20gitbook-mcp%20--url%20https%3A//mcp.gitbook.com/mcp%0A%60%60%60%0A%28for%20PAT%2C%20set%20%60GITBOOK_MCP_TOKEN%60%20and%20add%20a%20%60%5Bmcp_servers.gitbook-mcp%5D%60%20block%20with%20%60bearer_token_env_var%60%20to%20%60~/.codex/config.toml%60%29%20%E2%80%94%20verify%20with%20%60codex%20mcp%20list%60.%0A%23%23%20Import%20Docs%0AOnce%20connected%2C%20pull%20in%20my%20existing%20docs%20%28point%20me%20to%20a%20folder%2C%20repo%2C%20or%20other%20docs%20site%20if%20you%20need%20one%29%20and%20use%20the%20MCP%20server%20to%20set%20up%20the%20site%2C%20structure%2C%20and%20content%20from%20there." class="button secondary" data-icon="openai">Codex</a></p>
{% endcolumn %}
{% endcolumns %}

#### Quickstart guides

<table data-card-size="large" data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><h4><i class="fa-robot">:robot:</i></h4></td><td><strong>AI quickstart</strong></td><td><a href="/pages/JajPcVBpwGpo9xnjyzpG">/pages/JajPcVBpwGpo9xnjyzpG</a></td></tr><tr><td><h4><i class="fa-hand-pointer">:hand-pointer:</i></h4></td><td><strong>Editor quickstart</strong></td><td><a href="/pages/LeZB5bRRRrTrkSl678Cp">/pages/LeZB5bRRRrTrkSl678Cp</a></td></tr></tbody></table>

#### Explore GitBook's features

<table data-view="cards"><thead><tr><th></th><th></th><th></th><th></th><th></th><th data-hidden data-card-cover data-type="image">Cover image</th><th data-hidden data-type="image">Cover image (dark)</th><th data-hidden data-type="image">Cover image (dark)</th><th data-hidden data-type="image">Cover image (dark)</th><th data-hidden data-type="image">Cover image (dark)</th><th data-hidden data-type="image">Cover image (dark)</th><th data-hidden data-card-cover-dark data-type="image">Cover image (dark)</th></tr></thead><tbody><tr><td><h4>GitBook Agent</h4></td><td><a href="/spaces/NkEGS7hzeqa35sMXQZ4X/pages/I1LzGfTgQ5YbJG6cOtPP">Writing with GitBook Agent</a></td><td><a href="/spaces/NkEGS7hzeqa35sMXQZ4X/pages/cfQTrT0DlBarmP7uWCDx">Review change requests</a></td><td><a href="/spaces/NkEGS7hzeqa35sMXQZ4X/pages/pQI5kA4D8MsUdAtYCL3v">Identify content gaps</a></td><td><a href="/spaces/NkEGS7hzeqa35sMXQZ4X/pages/oOxMtvETyB2rKLzrO3uM">Channels</a></td><td><a href="/files/sVJL56v4PrSfH4lx2vNR">/files/sVJL56v4PrSfH4lx2vNR</a></td><td><a href="/files/DIZKH6SadxbgWF8B1SOq">/files/DIZKH6SadxbgWF8B1SOq</a></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td><h4>GitBook Assistant</h4></td><td><a href="/spaces/NkEGS7hzeqa35sMXQZ4X/pages/p6K5x8aCszGQ0xYf96Z2">Connections</a></td><td><a href="/spaces/NkEGS7hzeqa35sMXQZ4X/pages/1jXhhA4CEgYWHkM7L2H0">Docs Embed</a></td><td><a href="/spaces/NkEGS7hzeqa35sMXQZ4X/pages/rAwYwcAgV1bbN6XvdFzm">Connect to custom tools</a></td><td></td><td><a href="/files/EKqMWZNq7kDTHrAWwxVw">/files/EKqMWZNq7kDTHrAWwxVw</a></td><td></td><td><a href="/files/BMfFbqwV6PXlGqIfi0yS">/files/BMfFbqwV6PXlGqIfi0yS</a></td><td></td><td></td><td></td><td></td></tr><tr><td><h4>Git Sync</h4></td><td><a href="/spaces/NkEGS7hzeqa35sMXQZ4X/pages/CNZjEOJPpYRlwnZonGwV">Enabling GitHub Sync</a></td><td><a href="/spaces/NkEGS7hzeqa35sMXQZ4X/pages/Dx7ZG0VYWGDhpVhTp0J3">Content configuration</a></td><td><a href="/spaces/NkEGS7hzeqa35sMXQZ4X/pages/o9K7JHI3RDvKskfitrdU">GitHub pull request preview</a></td><td><a href="/spaces/NkEGS7hzeqa35sMXQZ4X/pages/nWluNiLE1i6y79ALnpAh">Monorepos</a></td><td><a href="/files/G5R5tYFsTr3Z13DHdpsc">/files/G5R5tYFsTr3Z13DHdpsc</a></td><td></td><td></td><td><a href="/files/DkwXAfEcywBpYyIz8LYL">/files/DkwXAfEcywBpYyIz8LYL</a></td><td></td><td></td><td></td></tr><tr><td><h4>AI Insights</h4></td><td><a href="/spaces/NkEGS7hzeqa35sMXQZ4X/pages/XzaPTAotGlG6FXnRb9Nq">AI insights</a></td><td><a href="/spaces/NkEGS7hzeqa35sMXQZ4X/pages/m6LOhkgWYpmL4u1LYydz">GitBook Assistant</a></td><td><a href="/spaces/NkEGS7hzeqa35sMXQZ4X/pages/pQI5kA4D8MsUdAtYCL3v">Identify content gaps</a></td><td><a href="/spaces/NkEGS7hzeqa35sMXQZ4X/pages/26Gxb8Al3EJRM41yVVxc">Site analytics</a></td><td><a href="/files/GLiqw6HbQStLvD6N1cmn">/files/GLiqw6HbQStLvD6N1cmn</a></td><td></td><td></td><td></td><td><a href="/files/oGJld57CIt6YEN1Bg3Pd">/files/oGJld57CIt6YEN1Bg3Pd</a></td><td></td><td></td></tr><tr><td><h4>MCP Server</h4></td><td><a href="/spaces/NkEGS7hzeqa35sMXQZ4X/pages/NiMm2ls8TMSz6Si8wY61">GitBook MCP</a></td><td><a href="/spaces/NkEGS7hzeqa35sMXQZ4X/pages/biYvWYyOTbkQs94S5MI1">MCP servers for published docs</a></td><td><a href="/spaces/NkEGS7hzeqa35sMXQZ4X/pages/7kwhl5QIBiI80sIQe3Ap">AI coding assistants and skill.md</a></td><td><a href="/spaces/NkEGS7hzeqa35sMXQZ4X/pages/rWwZnS9OUmNugz1aNKSX">Optimizing for AI</a></td><td><a href="/files/pXcTkYY0cOOSv6STQuAk">/files/pXcTkYY0cOOSv6STQuAk</a></td><td></td><td></td><td></td><td></td><td><a href="/files/EwhFlFVdwwlp883E54Jz">/files/EwhFlFVdwwlp883E54Jz</a></td><td></td></tr><tr><td><h4>API</h4></td><td><a href="/spaces/2SyQSbIa1iYS7z6Dx5di/pages/fPDrhpoBpT2XvowhteEg">GitBook API</a></td><td><a href="/spaces/2SyQSbIa1iYS7z6Dx5di/pages/6OzUWR95VKSzFiOfDRak">Quickstart</a></td><td><a href="/spaces/2SyQSbIa1iYS7z6Dx5di/pages/RUvdmIKeuCU1QCU5Uett">API reference</a></td><td></td><td><a href="/files/0mexZ6mo3RtTcdi535XF">/files/0mexZ6mo3RtTcdi535XF</a></td><td></td><td></td><td></td><td></td><td></td><td><a href="/files/2kAz2DuYPPK6V5PbWc6y">/files/2kAz2DuYPPK6V5PbWc6y</a></td></tr></tbody></table>

#### Looking for something else?

<button type="button" class="button primary" data-action="ask" data-icon="gitbook-assistant">Ask a question…</button>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://gitbook.com/docs/overview.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
