BookStack MCP Server

BookStack MCP Server

Enables AI assistants to manage BookStack documentation through natural language, supporting content browsing, search, and CRUD operations for books, chapters, and pages.

Category
访问服务器

README

BookStack MCP Server for Cursor

A minimal Python MCP (Model Context Protocol) server that allows Cursor AI to manage your BookStack documentation.

Features

This server provides essential BookStack management tools:

  • List Content: Browse books, bookshelves, chapters, and pages
  • Search: Full-text search across all content
  • Page Management: Create, read, update, and delete pages
  • Book Management: Create new books
  • Chapter Management: Create new chapters

Prerequisites

  • Python 3.8 or higher
  • BookStack instance with API access
  • BookStack API token (ID and Secret)

Setup

1. Install Dependencies

pip install -r requirements.txt

2. Configure Environment

First, you need to create an API token in BookStack:

  1. Log in to your BookStack instance at http://192.168.1.193:6875
  2. Go to your profile → API Tokens
  3. Create a new token with appropriate permissions
  4. Copy the Token ID and Token Secret

Then create a .env file:

cp .env.example .env

Edit .env and add your BookStack credentials:

BS_URL=http://192.168.1.193:6875
BS_TOKEN_ID=your_actual_token_id
BS_TOKEN_SECRET=your_actual_token_secret

3. Test the Server

Run the server directly to test:

python server.py

The server will start and listen for MCP protocol messages via stdio.

Cursor Integration

To use this MCP server with Cursor, add it to your Cursor MCP settings:

  1. Open Cursor Settings (Cmd/Ctrl + ,)
  2. Navigate to FeaturesModel Context Protocol
  3. Add a new server configuration:
{
  "mcpServers": {
    "bookstack": {
      "command": "python",
      "args": ["/home/borjigin/dev/bookstack-mcp/server.py"],
      "env": {
        "BS_URL": "http://192.168.1.193:6875",
        "BS_TOKEN_ID": "your_token_id",
        "BS_TOKEN_SECRET": "your_token_secret"
      }
    }
  }
}

Or use a script wrapper:

{
  "mcpServers": {
    "bookstack": {
      "command": "/home/borjigin/dev/bookstack-mcp/run_server.sh"
    }
  }
}
  1. Restart Cursor

Available Tools

Once configured, you can ask Cursor to interact with BookStack:

Listing Content

  • "List all books in BookStack"
  • "Show me the chapters in book 5"
  • "Find pages with 'API' in the name"

Searching

  • "Search for 'authentication' in BookStack"
  • "Find documentation about Docker"

Reading Content

  • "Get the content of page 42"
  • "Show me what's in page ID 10"

Creating Content

  • "Create a new book called 'API Documentation'"
  • "Create a chapter named 'Getting Started' in book 5"
  • "Create a page in book 3 with markdown content..."

Updating Content

  • "Update page 15 to change the title to 'New Title'"
  • "Modify page 20's content with this markdown..."

Deleting Content

  • "Delete page 99"

Tools Reference

bookstack_list_content

List content entities (books, bookshelves, chapters, pages)

  • entity_type: "books" | "bookshelves" | "chapters" | "pages"
  • count: Number of items (default 20)
  • offset: Pagination offset (default 0)
  • filter_name: Filter by name substring

bookstack_search

Search across all content

  • query: Search query string
  • page: Page number (default 1)
  • count: Results per page (default 20)

bookstack_get_page

Get page details and content

  • page_id: Page ID

bookstack_create_page

Create a new page

  • book_id: Book ID (required)
  • name: Page title (required)
  • html or markdown: Content (one required)
  • chapter_id: Optional chapter ID
  • tags: Optional tags (format: "tag1=value1,tag2=value2")

bookstack_update_page

Update an existing page

  • page_id: Page ID (required)
  • name: New title (optional)
  • html or markdown: New content (optional)
  • tags: Optional tags

bookstack_delete_page

Delete a page

  • page_id: Page ID (required)

bookstack_create_book

Create a new book

  • name: Book name (required)
  • description: Optional description
  • tags: Optional tags

bookstack_create_chapter

Create a new chapter

  • book_id: Book ID (required)
  • name: Chapter name (required)
  • description: Optional description
  • tags: Optional tags

Troubleshooting

Connection Issues

If Cursor can't connect to BookStack:

  1. Verify BookStack is running: curl http://192.168.1.193:6875
  2. Check your API tokens are correct
  3. Ensure the token has sufficient permissions

Permission Issues

If you get 403 errors:

  • Your API token may lack necessary permissions
  • Create a new token with admin or appropriate role permissions

Server Not Starting

If the Python server won't start:

  • Check Python version: python --version (must be 3.8+)
  • Verify dependencies: pip list | grep fastmcp
  • Check for errors in the .env file

Development

To extend this server with more tools:

  1. Add new functions decorated with @mcp.tool()
  2. Use the BookStackClient for API calls
  3. Follow the pattern of existing tools

Example:

@mcp.tool()
async def bookstack_custom_operation(param: str) -> str:
    """Your custom tool description"""
    client = get_client()
    result = await client.request("GET", f"endpoint/{param}")
    return str(result)

API Reference

BookStack API documentation: https://www.bookstackapp.com/docs/api/

License

This project is open source and available for modification and use.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选