bookstack-mcp
Read-only MCP adapter for BookStack REST API. Enables listing and searching shelves, books, chapters, and pages while enforcing least-privilege access.
README
BookStack BTD MCP adapter
Read-only local stdio MCP adapter for the BookStack REST API. This project is deliberately separate from the BookStack deployment repository and does not open an HTTP port.
Hermes
→ local stdio subprocess: bookstack-mcp
→ BookStack REST API with Token authentication
→ BookStack BTD pilot / final UGM subpath
Security model
- Use a dedicated BookStack user:
hermes-btd, never an Admin account. - Grant it read access only to the intended
Publikand specificTerbatascontent. - Do not grant
Rahasia / Privataccess. - Create an API token from that account and store its ID and secret only in local
.env. - This adapter registers no create, update, delete, user, role, permission, attachment, export, audit-log, or token-management tools.
- BookStack access permissions are the source-of-truth security boundary. MCP tool scope is defense in depth.
Available MCP tools
list_shelves / get_shelf
list_books / get_book
list_chapters / get_chapter
list_pages / get_page
search_knowledge
BookStack's official REST API does not expose a References/backlinks endpoint. The adapter intentionally does not claim a get_references tool.
Setup after BookStack is deployed
- Ensure the Hermes runtime can reach BookStack. A private NUC LAN IP must be reachable from the machine running Hermes; browser access elsewhere is not enough.
- In BookStack, create
hermes-btdas a non-admin local user. - Apply Shelf/Book permissions first, then enable the user permission Access system API.
- While logged in as
hermes-btd, create a named, expiry-bounded API token. Copy its ID and secret once into local.env. - Create a project-local environment and install the MCP SDK:
cd /Users/wayeien/Documents/bookstack-mcp
python3 -m venv .venv
.venv/bin/python -m pip install --upgrade pip
.venv/bin/python -m pip install -r requirements.txt
cp .env.example .env
chmod 600 .env
- Edit only the local
.env. Use the exact canonical base URL without trailing slash:
# Current LAN pilot: first establish a Mac → NUC SSH tunnel:
# ssh -N -L 127.0.0.1:18603:10.14.7.239:8603 magangbtd@10.14.7.239
# Then keep the API token on the Mac and send it only through that tunnel.
BOOKSTACK_URL=http://127.0.0.1:18603/bookstack
# Later UGM HTTPS example
# BOOKSTACK_URL=https://<host-UGM>/bookstack
- Run local tests before any live probe:
.venv/bin/python -m unittest discover -s tests -v
- Once network reachability and a least-privilege API token are verified, register with Hermes:
hermes mcp add bookstack-btd \
--command /Users/wayeien/Documents/bookstack-mcp/.venv/bin/python \
--args /Users/wayeien/Documents/bookstack-mcp/run_bookstack_mcp.py
hermes mcp test bookstack-btd
Approve only the displayed read-only tools during registration. Start a new Hermes session after successful registration.
Tests
Tests mock the BookStack API and verify:
- canonical base URL and UGM subpath preservation;
- BookStack
Authorization: Token <id>:<secret>header format; - URL encoding/search pagination;
- JSON error payload handling;
- environment placeholder rejection;
- read-only MCP tool delegation.
They do not prove LAN/API reachability or actual BookStack account permissions. Those require a deployed BookStack instance and hermes-btd token.
Source contract
Implemented against BookStack v26.05.3 API routes (/api/shelves, /books, /chapters, /pages, /search) and token format defined in the upstream source. No direct database access is used.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。