Add admin-only BookStack MCP connector #53

Merged
ryan merged 1 commits from feat/bookstack-mcp into main 2026-10-12 16:54:36 -04:00
Owner

Summary

  • Adds BookStack wiki tools to the admin agent via the bookstack-mcp npm stdio server (pinned to 5.6.0 in the Dockerfile).
  • Allowlists 12 of the server's 43 tools. Read: search_content, get_books, get_book, get_chapters, get_pages, get_page, get_recent_changes. Write: create_book, create_chapter, create_page, update_page, create_comment. Deletes, recycle-bin purge/restore, and shelf/attachment/image management are excluded.
  • Same admin gating as Homebox: the tools are compiled only into app.admin_agent, and each call re-checks is_admin.
  • Moves the shared allowlist/rename/admin-guard/stdio-loading code into utils/mcp_tools.py; homebox_mcp.py now builds on it, with its public API unchanged.
  • New env vars BOOKSTACK_BASE_URL, BOOKSTACK_TOKEN_ID, BOOKSTACK_TOKEN_SECRET (added to .env.example and docker-compose.yml). If they're unset, BookStack is skipped.
  • Adds a WIKI section to the system prompt.

Setup

Create an API token in BookStack (Profile → API Tokens; the user needs the "Access System API" permission), set the three env vars, and redeploy. Check make logs for BookStack MCP: loaded 12 tools.

Test plan

  • .venv/bin/pytest tests/ -q: 101 passed (new test_bookstack_mcp.py; Homebox tests unchanged)
  • Loaded the real bookstack-mcp@5.6.0 locally: all 12 tools load (~2k tokens of schema), errors come back as text, and non-admins are refused without calling the server
  • Docker build and a test against the real BookStack instance

🤖 Generated with Claude Code

## Summary - Adds BookStack wiki tools to the admin agent via the [`bookstack-mcp`](https://github.com/ttpears/bookstack-mcp) npm stdio server (pinned to 5.6.0 in the Dockerfile). - Allowlists 12 of the server's 43 tools. **Read:** `search_content`, `get_books`, `get_book`, `get_chapters`, `get_pages`, `get_page`, `get_recent_changes`. **Write:** `create_book`, `create_chapter`, `create_page`, `update_page`, `create_comment`. Deletes, recycle-bin purge/restore, and shelf/attachment/image management are excluded. - Same admin gating as Homebox: the tools are compiled only into `app.admin_agent`, and each call re-checks `is_admin`. - Moves the shared allowlist/rename/admin-guard/stdio-loading code into `utils/mcp_tools.py`; `homebox_mcp.py` now builds on it, with its public API unchanged. - New env vars `BOOKSTACK_BASE_URL`, `BOOKSTACK_TOKEN_ID`, `BOOKSTACK_TOKEN_SECRET` (added to `.env.example` and `docker-compose.yml`). If they're unset, BookStack is skipped. - Adds a WIKI section to the system prompt. ## Setup Create an API token in BookStack (Profile → API Tokens; the user needs the "Access System API" permission), set the three env vars, and redeploy. Check `make logs` for `BookStack MCP: loaded 12 tools`. ## Test plan - [x] `.venv/bin/pytest tests/ -q`: 101 passed (new `test_bookstack_mcp.py`; Homebox tests unchanged) - [x] Loaded the real `bookstack-mcp@5.6.0` locally: all 12 tools load (~2k tokens of schema), errors come back as text, and non-admins are refused without calling the server - [ ] Docker build and a test against the real BookStack instance 🤖 Generated with [Claude Code](https://claude.com/claude-code)
ryan added 1 commit 2026-10-12 16:54:12 -04:00
Load an allowlisted subset of bookstack-mcp tools (search/read plus
create/update books, chapters, pages and comments; no deletes) over stdio
and add them to the admin agent alongside Homebox. Extract the shared
allowlist + is_admin wrapping into utils/mcp_tools.py.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ryan merged commit cdd067fb8e into main 2026-10-12 16:54:36 -04:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ryan/simbarag#53