bookstack-mcp
This MCP server lets Claude search, read, and write BookStack wiki content in Markdown through 11 focused tools.
Search shelves, books, chapters, and pages with BookStack syntax (
"exact",[tag=value],{in_name:...}).List items by type, filter by name/book, sort by name or last updated, paginate.
Get page content as Markdown, a book's table of contents, a chapter's pages, or a shelf's books.
Create pages from Markdown directly in a book or chapter, plus new books, chapters, and shelves.
Update pages by replacing, appending/prepending, renaming, retagging, or moving them; WYSIWYG pages stay WYSIWYG.
Edit pages with exact find-and-replace on Markdown source (Markdown pages only).
Update shelves/books/chapters: rename, change descriptions/tags, move chapters, add/remove books on a shelf.
Delete pages, chapters, books, or shelves to BookStack's recycle bin (soft delete, explicit use only).
Preserve editor type per page and work in Markdown; new pages are always created in Markdown.
Allows interaction with a BookStack wiki instance, providing tools to search, read, and write wiki content in Markdown. Supports managing shelves, books, chapters, and pages, including creating, updating, editing via find-and-replace, moving, tagging, and deleting items. Reads pages as Markdown and preserves each page's editor type when writing.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@bookstack-mcp search the wiki for our onboarding checklist"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
bookstack-mcp
A focused MCP server for BookStack, built for Claude Code. Search, read and write your wiki in Markdown, straight from a chat with Claude β no dashboards, no config files to hand-edit, no 50-tool surface to learn. 11 tools, 3 environment variables, one setup command.
π·πΊ Π ΡΡΡΠΊΠ°Ρ Π²Π΅ΡΡΠΈΡ
Why this one
There are already a few BookStack MCP servers out there. Most of them expose the whole BookStack API 1:1 β dozens of tools, image galleries, Letta-specific compatibility notes, permission and user management β which is powerful but a lot to load into a model's context and a lot to configure for what most people actually want: read the wiki, write to the wiki, in Markdown.
This one does less on purpose:
11 tools, not 30β60.
search/list/getcover every read; six tools cover every write.Markdown-native. Pages come back as Markdown; new pages are written as Markdown; a targeted
edit_pagetool does find-and-replace on a page's source instead of resending the whole thing.One setup command.
npm run setupasks for your BookStack URL and API token, verifies them against your instance, and registers the server in Claude Code's config itself.Errors you can act on. A bad token, a wrong URL, a permission gap, a rate limit β each comes back as a plain-English message with what to do about it, not a raw HTTP status.
No new infra. For yourself it runs over stdio: no server, no database, no Docker. For a team there's an optional HTTP mode β one container, still no database, and everyone signs in with their own BookStack token.
Related MCP server: BookStack MCP Server
Install
1. Get a BookStack API token. Avatar β My Account β Access & Security β API Tokens β Create Token (older versions: Edit Profile β API Tokens). Save the Token ID and Token Secret β the secret is shown once. The user's role needs the Access System API permission (admins have it by default).
2. Add the server β with npx, from the Docker image (neither needs a clone or a build), or from source.
Option A: npx. With Node 20 or newer installed:
npx -y -p @yand3r3d3v/bookstack-mcp bookstack-mcp-setupThis is the setup wizard described under Option C. It registers the server as
npx -y @yand3r3d3v/bookstack-mcp, so each new session runs the latest release.
Option B: Docker. Add this to ~/.claude.json under mcpServers (or to a project's own
.mcp.json if you only want it there):
"bookstack": {
"type": "stdio",
"command": "docker",
"args": [
"run", "-i", "--rm", "--no-healthcheck",
"-e", "BOOKSTACK_URL", "-e", "BOOKSTACK_TOKEN_ID", "-e", "BOOKSTACK_TOKEN_SECRET",
"ghcr.io/yand3r3d3v/bookstack_mcp:latest", "node", "dist/index.js"
],
"env": {
"BOOKSTACK_URL": "https://wiki.example.com",
"BOOKSTACK_TOKEN_ID": "...",
"BOOKSTACK_TOKEN_SECRET": "..."
}
}This is the same image as the shared server; node dist/index.js at the end
switches it to stdio. The bare -e NAME flags pass the values from env into the container, so the
secret doesn't end up in args. The image is multi-arch (amd64 / arm64); :latest follows main,
release tags like :0.1.0 are pinned. To update: docker pull ghcr.io/yand3r3d3v/bookstack_mcp:latest.
If the desktop app can't find docker, use its absolute path (which docker).
Option C: from source. Clone, install and run setup:
git clone https://github.com/yand3r3d3v/bookstack_mcp.git
cd bookstack_mcp
npm install
npm run setupsetup asks for the URL, Token ID and Token Secret, checks them against your BookStack instance,
and registers the server in Claude Code's user config (~/.claude.json, available in every
project β it keeps a backup at ~/.claude.json.before-bookstack-mcp). Run it again any time to
change settings; pressing Enter keeps the current value.
3. Start a new Claude Code session. Run /mcp to confirm bookstack shows up connected.
Add this to ~/.claude.json under mcpServers (or to a project's own .mcp.json if you only want
it there):
"bookstack": {
"type": "stdio",
"command": "/opt/homebrew/bin/node",
"args": ["/path/to/bookstack_mcp/dist/index.js"],
"env": {
"BOOKSTACK_URL": "https://wiki.example.com",
"BOOKSTACK_TOKEN_ID": "...",
"BOOKSTACK_TOKEN_SECRET": "..."
}
}Use an absolute path to node β the GUI app doesn't always inherit your shell's PATH. Run
npm run build first so dist/index.js exists.
Shared server (HTTP)
Instead of everyone cloning the repo, you can run one server for the whole team and add it to Claude by
URL. It works behind a reverse proxy on a sub-path of an existing domain
(https://tools.example.com/bookstack-mcp), so no new domain or certificate is needed.
Each person signs in with their own BookStack API token through a standard OAuth flow: Claude opens a sign-in page, you paste your Token ID and Secret, done. Everyone keeps exactly their own BookStack permissions.
The server stores nothing. The tokens it hands to Claude are encrypted with
MCP_AUTH_SECRETand carry the user's BookStack token inside. No database, no sessions β restart or scale it freely.Revoking access = deleting the API token in BookStack (takes effect within 5 minutes).
Run it
The image is prebuilt on GHCR, so you only need two files, not the repo:
mkdir bookstack-mcp && cd bookstack-mcp
curl -fsSLO https://raw.githubusercontent.com/yand3r3d3v/bookstack_mcp/main/compose.yaml
curl -fsSL https://raw.githubusercontent.com/yand3r3d3v/bookstack_mcp/main/.env.example -o .env
# fill in BOOKSTACK_URL, MCP_PUBLIC_URL, MCP_AUTH_SECRET in .env
docker compose up -dTo update: docker compose pull && docker compose up -d. From a checkout of the repo,
docker compose up -d --build builds the image locally instead. Without Docker: npm install && npm run build, set the variables, npm run serve.
Variable | |
| Your BookStack, e.g. |
| This server's public address including the sub-path, e.g. |
| Encrypts the tokens given to Claude: |
| Where sign-in may redirect back to. Default |
| Listen address, default |
|
|
BOOKSTACK_TOKEN_ID / BOOKSTACK_TOKEN_SECRET aren't used in this mode.
Reverse proxy on a sub-path
nginx, in the server block of the existing domain:
location /bookstack-mcp/ {
proxy_pass http://127.0.0.1:3000;
}
# OAuth discovery checks the root of the domain first (RFC 8414). Required if the main site answers
# unknown URLs with 200 (an SPA, a catch-all) β otherwise Claude fails to connect; harmless either way.
location = /.well-known/oauth-authorization-server/bookstack-mcp {
proxy_pass http://127.0.0.1:3000;
}
location = /.well-known/oauth-protected-resource/bookstack-mcp/mcp {
proxy_pass http://127.0.0.1:3000;
}The sub-path may be passed through as-is (as above) or stripped (proxy_pass http://127.0.0.1:3000/;);
the server accepts both. Any other proxy works the same way. HTTPS is required for anything but
localhost.
Connect Claude
As a connector (Claude desktop app, claude.ai β Chat, Cowork and the Code tab alike): Settings β
Connectors β Add custom connector, URL https://tools.example.com/bookstack-mcp/mcp, then Connect and
sign in with your BookStack token. On Team/Enterprise plans an owner adds it once for the organization.
Claude reaches custom connectors from Anthropic's cloud, so the server has to be reachable from the
internet, not just from your VPN.
In Claude Code (CLI; the desktop Code tab reads the same config) β the connection is made from your machine, so an internal-only server is fine:
claude mcp add --transport http --scope user bookstack https://tools.example.com/bookstack-mcp/mcpThen run /mcp, pick bookstack β Authenticate. Or skip OAuth and pass the BookStack token directly:
claude mcp add --transport http --scope user bookstack https://tools.example.com/bookstack-mcp/mcp --header "Authorization: Token TOKEN_ID:TOKEN_SECRET"Usage
Just ask, in plain language:
"search the wiki for how we configured nginx"
"what's in the Infra book?"
"write this up in the Infra book, Networking chapter"
"add a section about the new cameras to the VLAN page"
"create a Projects shelf with a Backend book on it"
For the common "write up what we just did" case, there's a ready-made prompt:
/mcp__bookstack__documentClaude will find the right place for it, check whether a page on the topic already exists (and extend it instead of creating a near-duplicate), write it for a colleague who wasn't in this conversation, and hand you the link.
To stop Claude Code from asking permission for every read, add this to ~/.claude/settings.json:
{ "permissions": { "allow": ["mcp__bookstack__search", "mcp__bookstack__list", "mcp__bookstack__get"] } }Write tools will still ask for confirmation.
Tools
Tool | What it does |
| Full-text search, with BookStack's own syntax: |
| List shelves / books / chapters / pages; filter by name or book, sort by last updated |
| Page β its content as Markdown; book β table of contents; chapter β its pages; shelf β its books. Long pages are cut at |
| New page from Markdown, in a chapter or directly in a book |
| Replace content, append/prepend ( |
| Exact find-and-replace on a page's Markdown source β no need to resend the whole page |
| New book (optionally placed on a shelf) |
| New chapter in a book |
| New shelf with books on it |
| Rename / describe / tag a shelf, book or chapter; move a chapter; add or remove books on a shelf |
| Move to BookStack's recycle bin (Settings β Maintenance β Recycle Bin) |
Every item in a response is shown as [page:12] Name β those ids are what you pass back to the
tools.
Markdown vs. WYSIWYG
BookStack has two editors: WYSIWYG (visual, stores HTML) and Markdown (stores Markdown source). This server works in Markdown and preserves each page's own editor:
Markdown page | WYSIWYG page | |
Read ( | source as-is | converted to Markdown via BookStack's own export |
| writes Markdown | Markdown β HTML, page stays WYSIWYG; |
| exact match-and-replace on the source | unavailable (no Markdown source) β use |
New pages are always created in Markdown. Beyond standard GFM (tables, task lists, fenced code),
BookStack understands callout blocks: <p class="callout info">Text</p> (info, success,
warning, danger).
Configuration
Variable | |
| Your BookStack address, e.g. |
| Token ID |
| Token Secret |
|
|
Permissions are entirely the token owner's: the server sees and can change exactly what that user can in the web UI β nothing more.
What's here and what isn't
Covers: shelves, books, chapters and pages β reading, full-text search, creating, editing (whole-page replace, append/prepend, and exact find-and-replace), renaming, tagging, moving between books/chapters, adding/removing books on a shelf, and soft-delete to the recycle bin.
Not (yet) covered, because most people setting this up for Claude Code don't need it day one:
Images, drawings and file attachments (BookStack's image gallery / attachments API)
Comments on pages
Users, roles and content permissions
The recycle bin itself (restoring or permanently deleting) β only sending items to it
Page templates
Audit log
Exporting to PDF / plain HTML (Markdown export is used internally for reading WYSIWYG pages)
Talking to more than one BookStack instance from a single server process
If you need any of these, they're reasonably contained additions to src/tools.ts and
src/bookstack.ts β issues and PRs welcome. See Development below.
Troubleshooting
Errors come back straight into the conversation, so Claude will show them. Common ones:
"isn't configured" β environment variables aren't set. Run
npm run setup(Docker: check bothenvand the-eflags inargs).401 β wrong Token ID / Secret, or the token expired.
403 β the role is missing Access System API, or lacks permission on that specific book/page.
"redirects to https://β¦" β use
https://in the URL.Self-signed certificate β add
NODE_EXTRA_CA_CERTS=/path/to/ca.pemto the server'senv. Docker: mount the file too β"-v", "/path/to/ca.pem:/ca.pem:ro", "-e", "NODE_EXTRA_CA_CERTS=/ca.pem".Docker: BookStack on
localhostβ inside the containerlocalhostis the container itself; usehttp://host.docker.internal:PORTinstead (on Linux also add"--add-host=host.docker.internal:host-gateway"toargs).Moved the project folder β run
npm run setupagain; the server's path is stored in the config.Rate limited β BookStack defaults to 180 requests/minute. The server waits and retries on its own when the wait is short (up to 30 seconds in total); past that it reports the error.
HTTP mode:
Connector fails right away / "Unexpected token '<'" β the root
.well-knownURLs return the main site's HTML; add the twolocation = /.well-known/β¦blocks from the nginx example."Redirects to β¦ aren't allowed" β the client's callback host isn't in
MCP_ALLOWED_REDIRECT_HOSTS.Everyone has to reconnect after a restart β
MCP_AUTH_SECRETisn't set, so a random one is used.Sign-in page says the token was refused β same causes as 401/403 above, for that user's token.
Development
npm run build
npm testThe tests need Node 22.18+ (they are TypeScript that Node runs directly). They need no BookStack:
test/fake-bookstack.ts stands in for its API.
src/bookstack.tsβ HTTP client for the BookStack API and human-readable errorssrc/tools.tsβ the MCP tools and thedocumentpromptsrc/excerpt.tsβ reading long pages in parts: by section or by offsetsrc/server.tsβ the MCP server and the model instructions, shared by both transportssrc/index.tsβ stdio entry pointsrc/http.tsβ HTTP entry point: Streamable HTTP, routing under a sub-pathsrc/oauth.tsβ OAuth sign-in with a BookStack API token, stateless encrypted tokenssrc/setup.tsβ the setup wizard
Releasing. npm version minor (or patch / major) bumps package.json and creates the tag;
git push --follow-tags then publishes it: CI runs the tests, publishes the package to npm, creates a
GitHub release with generated notes, and builds the Docker image tagged with the version. Publishing
to npm uses trusted publishing: the package's settings on
npmjs.com name this repository and release.yml as its publisher, so there's no token to keep.
License
Available Tools
11 toolscreate_bookCreate bookC
Create a book, optionally placing it on a shelf.
Inputs: name (required), tags, shelf_id, description.
create_chapterCreate chapterC
Create a chapter in a book. Chapters group pages and can't be nested.
Inputs: name (required), book_id (required), tags, description.
create_pageCreate pageA
Create a page from Markdown, inside a chapter (chapter_id) or directly in a book (book_id). Check first that a page on this topic doesn't already exist β updating beats duplicating.
Inputs: name (required), markdown (required), tags, book_id, +1 more.
create_shelfCreate shelfC
Create a shelf (a group of books), optionally with books on it.
Inputs: name (required), tags, book_ids, description.
deleteDelete itemADestructive
Move a page, chapter, book or shelf to the BookStack recycle bin (restorable by an admin). Deleting a book or chapter deletes everything inside it; deleting a shelf keeps its books. Only delete when the user explicitly asked for it.
Inputs: id (required), type (required).
edit_pageEdit page textA
Exact find-and-replace in a page's Markdown source β the cheap way to fix or extend part of a page without resending all of it. old_text must match the source exactly (read the page with get first). Only for Markdown-editor pages; for WYSIWYG pages use update_page.
Inputs: id (required), new_text (required), old_text (required), replace_all.
getGet BookStack itemARead-only
Open one item by id. page β full content as Markdown plus its location. book β table of contents (chapters and pages). chapter β its pages. shelf β its books.
Inputs: id (required), type (required).
listList BookStack itemsARead-only
List shelves, books, chapters or pages. Use it to see what exists (e.g. all books) or to find recently updated pages (sort=updated). To see what's inside a book, use get on the book instead.
Inputs: type (required), sort, count, offset, +2 more.
searchSearch BookStackARead-only
Full-text search across shelves, books, chapters and pages. Returns matches with [type:id] refs, their location and a text snippet. BookStack search syntax works in query: "exact phrase", [tag] or [tag=value], {in_name:word}, {updated_by:me}, {created_by:me}.
Inputs: query (required), page, type, count.
updateUpdate shelf, book or chapterA
Rename a shelf/book/chapter or change its description or tags; move a chapter (with its pages) to another book; add or remove books on a shelf. For pages use update_page / edit_page.
Inputs: id (required), type (required), name, tags, +4 more.
update_pageUpdate pageA
Replace a page's content, add to its end/start (mode), rename it, retag it or move it. For a small change inside an existing page prefer edit_page. WYSIWYG pages stay WYSIWYG (the Markdown is converted to HTML).
Inputs: id (required), mode, name, tags, +3 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
TDQS
Scored across 11 tools
Most tools have clearly distinct purposes: search, list, and get cover different retrieval modes, and create_* are resource-specific. The main ambiguity is between edit_page and update_page, plus the generic 'update' versus 'update_page', though the descriptions explicitly clarify when to use each.
Page and creation tools follow a clean verb_noun pattern (create_page, update_page, edit_page, create_book, create_chapter, create_shelf), but read/update/delete tools are bare verbs (search, list, get, update, delete). This mixes conventions within the same set.
11 tools is well-scoped for a BookStack integration, covering the four entity types (shelf, book, chapter, page) without bloat. Each tool earns its place in the workflow.
Full lifecycle coverage exists: create for all four entity types, read via get/list/search, update via update_page/edit_page/update, and delete across types. Minor gaps like attachments or user/role management are outside the core wiki scope and unlikely to block agents.
Related MCP Connectors
Search, read and edit your team's docs-as-code documentation, synced with Git.
Read and write your team's shared, AI-readable wiki from any MCP client.
Hosted markdown project wikis your team's AI assistants read, search, and update over MCP.
Shared markdown docs for people and AI agents, kept as plain files in your team's GitHub repo.
1
Related MCP Servers
- AlicenseBqualityBmaintenanceEnables interaction with BookStack knowledge management systems through the BookStack API. Supports searching, reading, creating, and updating documentation content with secure authentication and dual transport modes for flexible deployment.17408 npm60MIT
- AlicenseBqualityDmaintenanceEnables AI models to interact with BookStack wiki instances through a comprehensive API interface. Supports content management (books, chapters, pages), user administration, search functionality, and content export in multiple formats.4110 npmMIT
- AlicenseBqualityBmaintenanceConnects BookStack knowledge bases to Claude through 47+ tools covering complete CRUD operations for books, pages, chapters, shelves, users, search, attachments, and permissions. Enables full management of BookStack content and configuration through natural language.56528 npm106MIT
- AlicenseBqualityDmaintenanceEnables AI assistants to manage BookStack knowledge bases with tools for creating, reading, updating, and deleting pages, books, and shelves, as well as searching content.244MIT