Grimmory MCP Server

Grimmory MCP Server

Enables AI assistants to manage a Grimmory book library through 53 specialized tools for books, authors, shelves, reading progress, metadata, and more.

Category
访问服务器

README

Grimmory MCP Server

A Model Context Protocol (MCP) server for the Grimmory book management application. This server enables AI assistants like Claude to interact with your Grimmory library through 53 specialized tools.

GitHub

Features

  • 53 MCP Tools for comprehensive book library management
  • JWT Authentication with automatic token refresh
  • Dual Response Formats - JSON for data, Markdown for readability
  • Stdio Transport - Full MCP compatibility with Claude Desktop and other clients
  • SSE Support - Streaming endpoints for long-running operations
  • Type-Safe - Built with TypeScript for reliability

Installation

Prerequisites

  • Bun runtime (recommended) or Node.js 18+
  • A running Grimmory instance (v2.3.0+)
  • GitHub CLI (gh) - optional, for repository operations

Setup

# Clone the repository
git clone https://github.com/bannert1337/grimmory-mcp.git
cd grimmory-mcp

# Install dependencies
bun install

# Build the project
bun run build

Configuration

Set the following environment variables:

export GRIMMORY_URL="https://your-grimmory-instance.com"
export GRIMMORY_EMAIL="your-email@example.com"
export GRIMMORY_PASSWORD="your-password"

You can also create a .env file in the project root:

GRIMMORY_URL=https://your-grimmory-instance.com
GRIMMORY_EMAIL=your-email@example.com
GRIMMORY_PASSWORD=your-password

Usage

With Claude Desktop

Add the following to your claude_desktop_config.json:

{
  "mcpServers": {
    "grimmory": {
      "command": "bun",
      "args": ["run", "start"],
      "env": {
        "GRIMMORY_URL": "https://your-grimmory-instance.com",
        "GRIMMORY_EMAIL": "your-email@example.com",
        "GRIMMORY_PASSWORD": "your-password"
      }
    }
  }
}

Location:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%/Claude/claude_desktop_config.json

With Other MCP Clients

The server uses stdio transport, making it compatible with any MCP client:

bun run start

Available Tools (53 Total)

Book Management (2 tools)

Tool Description
grimmory_list_books List books with pagination, library filtering, and search
grimmory_get_book Get detailed information about a specific book

Library Management (2 tools)

Tool Description
grimmory_list_libraries List all libraries in the Grimmory instance
grimmory_get_library Get details for a specific library by UUID

Shelf Management (3 tools)

Tool Description
grimmory_list_shelves List all shelves with optional library filter
grimmory_get_shelf Get details for a specific shelf
grimmory_get_shelf_books Get books in a specific shelf with pagination

Author Management (13 tools)

Tool Description
grimmory_list_authors List authors with pagination and search
grimmory_get_author Get detailed information about an author
grimmory_find_author_by_name Search for an author by name
grimmory_get_book_authors Get all authors associated with a book
grimmory_update_author Update author name and description
grimmory_search_author_metadata Search external sources for author metadata
grimmory_match_author Link author to a specific metadata provider
grimmory_quick_match_author Automatically find best metadata match
grimmory_auto_match_authors Trigger auto-matching for all unmatched authors
grimmory_unmatch_authors Remove metadata provider associations
grimmory_search_author_photos Search for author photos from providers
grimmory_set_author_photo_url Set author photo via URL
grimmory_delete_authors Delete one or more authors

Reading Progress (3 tools)

Tool Description
grimmory_update_read_status Update read status (UNREAD, READING, READ, ABANDONED, etc.)
grimmory_update_rating Update personal rating (1-5 stars)
grimmory_update_progress Update reading progress (0-100%)

Notes (3 tools)

Tool Description
grimmory_list_notes List notes for a book with pagination
grimmory_create_note Create a new note for a book
grimmory_delete_note Delete a note from a book

Reviews (4 tools)

Tool Description
grimmory_list_reviews List reviews for a specific book
grimmory_refresh_reviews Refresh reviews from external sources
grimmory_delete_review Delete a specific review by ID
grimmory_delete_all_book_reviews Delete all reviews for a book

Metadata Management (13 tools)

Tool Description
grimmory_lookup_isbn Look up book metadata by ISBN-10 or ISBN-13
grimmory_batch_isbn_lookup Look up multiple ISBNs at once
grimmory_update_book_metadata Update metadata fields for a book
grimmory_get_file_metadata Retrieve file-level metadata
grimmory_get_comic_info Get ComicInfo XML for CBX books
grimmory_bulk_edit_metadata Apply metadata changes to multiple books
grimmory_toggle_all_locks Lock/unlock all metadata fields globally
grimmory_toggle_field_locks Lock/unlock specific metadata fields
grimmory_get_metadata_lock_fields List fields that support locking
grimmory_recalculate_match_scores Recalculate metadata match scores
grimmory_consolidate_metadata Merge metadata from multiple providers
grimmory_delete_metadata_values Delete specific metadata field values
grimmory_get_prospective_metadata Preview potential metadata matches

Sidecar Files (6 tools)

Tool Description
grimmory_get_sidecar Get sidecar metadata file content
grimmory_get_sidecar_status Check sidecar file sync status
grimmory_export_sidecar Export sidecar for a specific book
grimmory_import_sidecar Import sidecar metadata for a book
grimmory_bulk_export_sidecar Export sidecars for all books in a library
grimmory_bulk_import_sidecar Import sidecars for all books in a library

Statistics & Insights (3 tools)

Tool Description
grimmory_get_stats Get dashboard statistics (book counts, ratings, status distribution)
grimmory_get_recommendations Get personalized book recommendations
grimmory_get_notebook Get notebook entries (books with notes/highlights)

Example Usage with Claude

Once configured, you can ask Claude to interact with your Grimmory library:

"Show me all books I'm currently reading"
"List my favorite authors"
"Update the rating for 'Dune' to 5 stars"
"Search for books by Isaac Asimov"
"Get statistics about my book collection"
"Create a note for book 123 about the main character"
"List books in my 'Favorites' shelf"

Development

# Development mode with watch
bun run dev

# Run tests
bun test

# Build for production
bun run build

# Type checking
bun run typecheck

# Linting
bun run lint

Project Structure

src/
├── index.ts                    # Entry point
├── constants.ts                # API endpoints and constants
├── types.ts                    # TypeScript type definitions
├── schemas/
│   └── index.ts               # Zod validation schemas
├── services/
│   ├── grimmory-client.ts     # API client with auth
│   └── response-formatter.ts  # Output formatting
└── tools/
    ├── books.ts               # Book management tools
    ├── libraries.ts           # Library management tools
    ├── shelves.ts             # Shelf management tools
    ├── authors.ts             # Author management tools
    ├── reading.ts             # Reading progress tools
    ├── notes.ts               # Notes management tools
    ├── reviews.ts             # Reviews management tools
    ├── metadata.ts            # Metadata management tools
    ├── sidecar.ts             # Sidecar file tools
    └── stats.ts               # Statistics and insights tools

tests/                         # Test suite

API Compatibility

This MCP server is compatible with Grimmory v2.3.0+ and uses the following API endpoints:

  • /api/v1/auth/* - Authentication
  • /api/v1/books/* - Book management
  • /api/v1/libraries/* - Library management
  • /api/v1/shelves/* - Shelf management
  • /api/v1/authors/* - Author management
  • /api/v1/book-notes/* - Notes management
  • /api/v1/reviews/* - Reviews management
  • /api/v1/user-stats/* - Statistics
  • /api/v1/notebook/* - Notebook entries
  • /api/v1/recommendations/* - Recommendations

Troubleshooting

Authentication Issues

If you see "Authentication failed" errors:

  1. Verify your GRIMMORY_URL, GRIMMORY_EMAIL, and GRIMMORY_PASSWORD are correct
  2. Ensure your Grimmory instance is accessible
  3. Check that the user account has appropriate permissions

Connection Issues

If the server fails to connect:

  1. Verify the Grimmory URL includes the protocol (https://)
  2. Check network connectivity to your Grimmory instance
  3. Ensure no firewall rules are blocking the connection

Empty Responses

Some endpoints return 204 No Content when no data exists (e.g., books without reviews). This is normal behavior.

Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/my-feature
  3. Make your changes
  4. Run tests: bun test
  5. Commit with semantic messages: feat:, fix:, refactor:, etc.
  6. Push and create a pull request

License

GPL-3.0 License - See LICENSE for details.

Acknowledgments

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选