Last updated
Was this helpful?
Publishing your docs with GitBook is as simple as asking your agent

Last updated
Was this helpful?
Was this helpful?
# 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.