Skip to main content

BookStack MCP Integration with Claude

BookStack MCP Integration with Claude

Overview

BookStack supports integration with Claude AI through the Model Context Protocol (MCP), allowing Claude to read, create, update, and search your BookStack knowledge base directly from a conversation. This enables you to use Claude as an intelligent interface to your documentation — asking questions, creating pages, and managing content without leaving the chat.


What is MCP?

Model Context Protocol (MCP) is an open standard developed by Anthropic that allows AI models like Claude to connect to external tools and data sources. MCP servers act as bridges between Claude and external services, exposing capabilities (tools) that Claude can invoke during a conversation.

With the BookStack MCP server, Claude can:

  • List, search, and read pages, chapters, books, and shelves
  • Create and update pages with Markdown or HTML content
  • Export pages in various formats (PDF, HTML, Markdown)
  • Manage attachments
  • Retrieve recently changed content

Prerequisites

  • A running BookStack instance (self-hosted)
  • BookStack API access enabled
  • A BookStack API Token ID and Token Secret
  • Claude with MCP support (Claude.ai with integrations, or Claude Desktop)
  • Node.js 18+ (if running the MCP server locally)

Setup

1. Generate a BookStack API Token

  1. Log into BookStack as an admin
  2. Navigate to Your Profile → API Tokens
  3. Click Create Token
  4. Give it a name (e.g., Claude MCP)
  5. Copy the Token ID and Token Secret — you will not be able to retrieve the secret again

2. Configure the MCP Server

The BookStack MCP server can be configured in your Claude Desktop claude_desktop_config.json or equivalent MCP host configuration file.

{
  "mcpServers": {
    "bookstack": {
      "command": "npx",
      "args": ["-y", "bookstack-mcp"],
      "env": {
        "BOOKSTACK_BASE_URL": "https://your-bookstack-instance.example.com",
        "BOOKSTACK_TOKEN_ID": "your-token-id",
        "BOOKSTACK_TOKEN_SECRET": "your-token-secret"
      }
    }
  }
}

Replace BOOKSTACK_BASE_URL, BOOKSTACK_TOKEN_ID, and BOOKSTACK_TOKEN_SECRET with your actual values.

3. Restart Claude Desktop

After saving the config, restart Claude Desktop. You should see the BookStack tools available in the integrations panel.


Available Tools

Tool Description
get_capabilities Lists available MCP capabilities and configuration
get_books Lists all books with filtering and sorting
get_book Gets details of a specific book
get_shelves / get_shelf Lists or retrieves book shelves
get_chapters / get_chapter Lists or retrieves chapters
get_pages / get_page Lists or retrieves pages with content
search_content Full-text search across all BookStack content
search_pages Search specifically within pages
create_page Creates a new page in a book or chapter
update_page Updates an existing page's content or name
export_page Exports a page as HTML, PDF, Markdown, or plain text
get_attachments / get_attachment Lists or retrieves file/link attachments
create_attachment Creates a new link attachment on a page
update_attachment Updates an existing attachment
delete_attachment Deletes an attachment
get_recent_changes Lists recently updated content
export_book Exports an entire book
export_chapter Exports a chapter
create_shelf Creates a new book shelf
update_shelf Updates an existing shelf
delete_shelf Deletes a shelf

Example Use Cases

Ask Claude to document a process

"Create a page in the Windows book titled 'How to Join a Domain' and write step-by-step instructions."

Claude will invoke create_page with the appropriate book_id and generated Markdown content.

Search your knowledge base

"Search BookStack for anything related to SSL certificates."

Claude will use search_content and summarize relevant pages it finds.

Update existing documentation

"Update the Active Directory page on AdminSDHolder to include a note about the SDProp interval."

Claude will find the page with search_pages, then call update_page with the revised content.

Export a page for sharing

"Export the VMware vSphere hardening page as a PDF."

Claude will call export_page with format: pdf and return a download link.


Security Considerations

  • Least privilege: Create a dedicated BookStack user for the MCP token with only the permissions Claude needs (e.g., read-only if you don't want Claude writing content).
  • Token storage: Store your Token ID and Secret securely. Do not commit them to version control.
  • Audit logs: BookStack logs API activity. Periodically review API usage under Settings → Audit Log.
  • Network access: If your BookStack instance is internal, ensure the MCP server process has network access to it (VPN, split DNS, etc.).

Troubleshooting

Issue Resolution
Claude doesn't see BookStack tools Verify the MCP config file is valid JSON and restart Claude Desktop
Authentication errors (401) Double-check Token ID and Token Secret; regenerate if needed
Connection refused Confirm BOOKSTACK_BASE_URL is reachable from where Claude is running
Pages created with wrong formatting Use Markdown content; avoid mixing HTML and Markdown in the same page
Search returns no results Ensure BookStack search index is up to date (php artisan bookstack:regenerate-search)

References