Skip to main content
Glama

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 / get cover every read; six tools cover every write.

  • Markdown-native. Pages come back as Markdown; new pages are written as Markdown; a targeted edit_page tool does find-and-replace on a page's source instead of resending the whole thing.

  • One setup command. npm run setup asks 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-setup

This 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 setup

setup 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_SECRET and 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 -d

To 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

BOOKSTACK_URL

Your BookStack, e.g. https://wiki.example.com

MCP_PUBLIC_URL

This server's public address including the sub-path, e.g. https://tools.example.com/bookstack-mcp. The MCP endpoint is this + /mcp

MCP_AUTH_SECRET

Encrypts the tokens given to Claude: openssl rand -base64 32. Keep it secret; changing it signs everyone out

MCP_ALLOWED_REDIRECT_HOSTS

Where sign-in may redirect back to. Default claude.ai,claude.com,localhost,127.0.0.1,[::1] β€” enough for Claude; add hosts for other MCP clients, * allows any

MCP_HOST, MCP_PORT

Listen address, default 127.0.0.1:3000 (0.0.0.0 in Docker)

BOOKSTACK_READ_ONLY

true β€” read tools only

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/mcp

Then 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__document

Claude 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

search

Full-text search, with BookStack's own syntax: "exact phrase", [tag=value], {in_name:...}

list

List shelves / books / chapters / pages; filter by name or book, sort by last updated

get

Page β†’ its content as Markdown; book β†’ table of contents; chapter β†’ its pages; shelf β†’ its books. Long pages are cut at max_chars with their outline β€” read on by offset or one section at a time

create_page

New page from Markdown, in a chapter or directly in a book

update_page

Replace content, append/prepend (mode), rename, retag, move. expected_revision refuses the update if the page was saved since it was read

edit_page

Exact find-and-replace on a page's Markdown source β€” no need to resend the whole page

create_book

New book (optionally placed on a shelf)

create_chapter

New chapter in a book

create_shelf

New shelf with books on it

update

Rename / describe / tag a shelf, book or chapter; move a chapter; add or remove books on a shelf

delete

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 (get)

source as-is

converted to Markdown via BookStack's own export

update_page

writes Markdown

Markdown β†’ HTML, page stays WYSIWYG; append/prepend leave the existing HTML alone

edit_page

exact match-and-replace on the source

unavailable (no Markdown source) β€” use update_page

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

BOOKSTACK_URL

Your BookStack address, e.g. https://wiki.example.com

BOOKSTACK_TOKEN_ID

Token ID

BOOKSTACK_TOKEN_SECRET

Token Secret

BOOKSTACK_READ_ONLY

true β€” read-only: write tools aren't registered at all

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 both env and the -e flags in args).

  • 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.pem to the server's env. 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 container localhost is the container itself; use http://host.docker.internal:PORT instead (on Linux also add "--add-host=host.docker.internal:host-gateway" to args).

  • Moved the project folder β€” run npm run setup again; 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-known URLs return the main site's HTML; add the two location = /.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_SECRET isn'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 test

The 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 errors

  • src/tools.ts β€” the MCP tools and the document prompt

  • src/excerpt.ts β€” reading long pages in parts: by section or by offset

  • src/server.ts β€” the MCP server and the model instructions, shared by both transports

  • src/index.ts β€” stdio entry point

  • src/http.ts β€” HTTP entry point: Streamable HTTP, routing under a sub-path

  • src/oauth.ts β€” OAuth sign-in with a BookStack API token, stateless encrypted tokens

  • src/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

MIT

Available Tools

11 tools
create_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 itemA
Destructive

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 itemA
Read-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 itemsA
Read-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.

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

    A3.6/5.0

    Scored across 11 tools

    Disambiguation4/5

    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.

    Naming Consistency3/5

    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.

    Tool Count5/5

    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.

    Completeness4/5

    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

    Related MCP Servers

    • A
      license
      B
      quality
      B
      maintenance
      Enables 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.
      17
      408 npm
      60
      MIT
    • A
      license
      B
      quality
      D
      maintenance
      Enables 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.
      41
      10 npm
      MIT
    • A
      license
      B
      quality
      B
      maintenance
      Connects 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.
      56
      528 npm
      106
      MIT