pergamos
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@pergamossearch my library for books about distributed systems"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Pergamos
Pergamos is a read-only MCP server that lets Claude Desktop search and inspect a Calibre library through the Calibre Content Server.
Requirements
macOS with Python 3.10 or newer
Calibre with the Content Server running
The official MCP Python SDK, installed by the project setup below
Start the Calibre Content Server from Connect/share > Start Content server. The default address is http://127.0.0.1:8080.
Related MCP server: calibre-mcp
Install
cd /path/to/pergamos
python3 -m venv .venv
.venv/bin/python -m pip install -e .Configure Claude Desktop
Add a server entry to Claude Desktop's configuration file, usually ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"pergamos-calibre": {
"command": "/path/to/pergamos/.venv/bin/pergamos",
"env": {
"CALIBRE_SERVER_URL": "http://127.0.0.1:8080"
}
}
}
}For a Content Server with authentication, add CALIBRE_USERNAME and CALIBRE_PASSWORD to the same env object. CALIBRE_REQUEST_TIMEOUT may be set to a positive number of seconds. A URL prefix such as http://127.0.0.1:8080/calibre is supported.
Restart Claude Desktop after changing its configuration.
For the optional RAG tools, add the PERGAMOS_RAG_DIR environment variable if you want the vector store to live somewhere other than the default .pergamos_index directory:
{
"mcpServers": {
"pergamos-calibre": {
"command": "/path/to/pergamos/.venv/bin/pergamos",
"env": {
"CALIBRE_SERVER_URL": "http://127.0.0.1:8080",
"PERGAMOS_RAG_DIR": "/path/to/pergamos/.pergamos_index"
}
}
}
}Tools
list_libraries: checks the server and returns the root OPDS feed.search_books: performs a Calibre library-wide search across the metadata fields indexed by Calibre, including titles, authors, tags, comments, and identifiers. It acceptsquery,limit(1-100), andoffset, and follows OPDS pagination up to the requested limit.get_book_details: returns metadata and available format links for a Calibre book identifier.index_book_content: downloads a selected book file, extracts the text, splits it into chunks, and stores the embeddings for semantic retrieval.search_book_content: searches the indexed text chunks for one or more book IDs using a semantic query.
The server does not change the library or download files. Format URLs are returned as metadata so Claude can identify available editions.
Calibre's Content Server search is metadata search. It does not search the full body text of EPUB, PDF, or other book files.
Example workflow
This is the recommended pattern for doing RAG with a Calibre library:
# 1) Discover likely books by metadata
search = {
"query": "distributed systems",
"limit": 5,
"offset": 0,
}
# 2) Inspect the chosen book and pick the format to index
book = {
"id": "42",
"title": "Distributed Systems",
"formats": [
{"format": "epub", "url": "http://127.0.0.1:8080/get/42/epub"},
],
}
# 3) Index the full text of the selected book
index_book_content(
book_id="42",
title="Distributed Systems",
download_url="http://127.0.0.1:8080/get/42/epub",
format_name="epub",
)
# 4) Run semantic search over the indexed text for that book
search_book_content(
query="What does the book say about consensus?",
book_ids=["42"],
k=5,
)In practice, Claude Desktop can call the tools in that order:
search_booksto find candidate booksget_book_detailsto fetch the exact metadata and format URLsindex_book_contentto add the book contents to the RAG indexsearch_book_contentto answer question-style queries over the indexed text
This gives you metadata retrieval plus semantic content retrieval without replacing the Calibre search layer.
Dual-layer RAG pattern
For true RAG, keep Pergamos as the metadata/discovery layer and add a separate content indexer for the actual book files. The metadata server should answer questions like "which books match this topic?" while the content layer downloads the selected EPUB/PDF, extracts the text, chunks it, embeds it, and stores the vectors for semantic search.
A minimal starter implementation is included under src/pergamos/rag/:
extractors.pyhandles text extraction and chunkingindexer.pydownloads a book, extracts text, and indexes embeddingssearch.pyexposes a simple semantic search wrapper
Install the optional RAG extras with:
python3 -m pip install -e '.[rag]'This keeps the library browsing layer read-only while enabling a full-text retrieval pipeline on top of the same book metadata.
Runnable examples
The repo includes a few ready-to-run examples under examples/:
examples/rag_example.py: full orchestration example using the metadata + content tools in sequence.examples/one_book_index.py: indexes a single book into the local vector store.
Run them with:
.venv/bin/python examples/rag_example.py
.venv/bin/python examples/one_book_index.pyDocker Compose
A minimal stack can be started with Docker Compose for local development:
docker compose up --buildThis starts:
pergamos: the MCP servercalibre: the Calibre web content server
The stack uses a named volume for the local vector index and binds the Calibre content server to port 8080.
You can customize the runtime variables by copying the example environment file:
cp .env.example .envThen edit .env with your local Calibre URL and credentials. The Compose file can also be pointed at http://calibre:8080 if you want the containerized service name instead of a host-bound URL.
Common commands
Use the included Makefile for the main project tasks:
make install
make test
make run
make docker-up
make docker-downManual run
Claude Desktop communicates with the server over stdio. To run it directly for diagnostics:
CALIBRE_SERVER_URL=http://127.0.0.1:8080 .venv/bin/pergamosDo not print diagnostic messages to stdout because stdout is reserved for MCP protocol traffic.
Security
Prefer a local Calibre server bound to 127.0.0.1. If the server is reachable over a network, enable Calibre authentication and HTTPS. Keep credentials in Claude Desktop's environment configuration and do not commit that file.
Security checklist for commits
Before creating an initial commit or submitting a PR, confirm that:
.env,.env.local, and any credential file are excluded from gitgenerated data such as
.pergamos_index/and local caches are ignoreddocumentation uses neutral examples like
/path/to/pergamosinstead of machine-specific pathsreal Calibre URLs, usernames, and passwords are never hard-coded into the repository
example config files are safe placeholders, not live local configuration
A quick review command is:
git status --short
git ls-files .env .pergamos_index .venv .pytest_cacheDevelopment
.venv/bin/python -m pip install pytest
.venv/bin/python -m pytest -qAvailable Tools
5 toolsget_book_detailsA
Return detailed metadata and available format links for one Calibre book.
| Name | Required | Description | Default |
|---|---|---|---|
| identifier | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It describes the observable behavior—returning metadata and format links—but does not mention side effects, authentication needs, or failure behavior. For an apparently read-only 'get' tool this is acceptable, though not fully transparent.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single well-structured sentence that conveys the action, resource, and scope with no wasted words. It is front-loaded and easy to scan.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool is simple, has an output schema, and the description covers the core behavior. However, it omits guidance on how to obtain the identifier and does not connect to sibling tools like search_books. These gaps reduce completeness for an agent that needs to invoke the tool correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema provides only a parameter named 'identifier' with no description, and schema description coverage is 0%. The description says 'for one Calibre book,' slightly clarifying that identifier refers to a book, but it does not explain what kind of identifier to use or where it might come from. The description does not adequately compensate for the low schema coverage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb ('Return') and clearly identifies the resource ('detailed metadata and available format links') and scope ('one Calibre book'). This makes the purpose distinct from sibling tools like search_books, which return search results rather than details for a single known book.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies the use case: obtaining metadata for a specific, already-identified book. However, it does not explicitly state when to prefer this tool over siblings, when not to use it, or that the identifier should likely come from search_books.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
index_book_contentA
Download a book file, extract text, split it into chunks, and index the content for semantic search.
| Name | Required | Description | Default |
|---|---|---|---|
| title | Yes | ||
| book_id | Yes | ||
| format_name | Yes | ||
| download_url | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It usefully reveals that the tool will download, extract, split, and index content, but it does not disclose important side effects such as whether existing index entries are overwritten, whether duplicate indexing is handled, or whether network access or special permissions are required.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, front-loaded sentence with no filler. Each phrase adds meaning, and the sequence of actions is easy to scan.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Even though an output schema exists and covers return values, the definition is incomplete for a tool with four required parameters and no annotations. It lacks parameter-level explanation, sibling differentiation, and any warning about side effects or prerequisites. An agent would struggle to know the exact meaning of format_name or what indexing does to prior indexed content.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must compensate for the schema's lack of parameter documentation. It only loosely supports download_url via 'Download a book file' and gives no specific meaning for format_name, book_id, or title. The critical format_name parameter is entirely unexplained, including what values are accepted or how it relates to the download URL.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a clear, specific multi-step action: download a book file, extract text, split it into chunks, and index the content for semantic search. This clearly distinguishes it from sibling tools like search_book_content, which would query rather than build the index, and get_book_details, which would not perform chunking or indexing.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The phrase 'for semantic search' implies the tool is used to prepare book content for semantic search, but the description does not explicitly state when to use this tool versus alternatives. It does not name sibling tools such as search_book_content as the appropriate choice for actually searching the indexed content.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_librariesA
List the libraries exposed by the configured Calibre Content Server.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
There are no annotations, so the description carries the behavioral burden. It accurately states a read-only listing operation, which is non-destructive, but it does not disclose potential output behaviors such as empty results, pagination, or connectivity requirements. The output schema covers return format, leaving some gaps in broader behavioral context.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is one concise sentence that immediately states the verb and the target resource. There is no wasted wording or redundant information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a zero-parameter list operation with an output schema available, the description is complete. It gives the necessary context about the Calibre Content Server and leaves return-value details to the output schema. Nothing essential is missing for correct invocation.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has zero parameters and the schema coverage is 100%, so there is nothing for the description to add. The baseline for a parameterless tool is 4, and the description adequately introduces the operation without needing parameter details.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb ('List') and a clear resource ('libraries exposed by the configured Calibre Content Server'). It is easily distinguishable from sibling tools like search_books or get_book_details, which have different purposes.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies when to use the tool: to enumerate available libraries. However, it does not explicitly mention alternatives or conditions when this tool should be avoided. For a zero-parameter listing tool this is acceptable but not fully explicit.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
search_book_contentB
Search the indexed text for relevant chunks within one or more Calibre books.
| Name | Required | Description | Default |
|---|---|---|---|
| k | No | ||
| query | Yes | ||
| book_ids | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the burden of behavior. It discloses that the operation is a read-style search over indexed content and that results are chunks, but it does not explain what happens if books aren't indexed, whether content is ranked, or how book_ids scoping behaves in edge cases.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single front-loaded sentence with no filler; every component (verb, indexed source, chunk output, scope) earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The output schema covers return shape, but with no annotations and no usage guidance or parameter semantics, the definition is not complete enough for an agent to confidently decide when to use it or how to set k. It is a minimum-viable description at best.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must compensate. 'Within one or more Calibre books' clarifies book_ids, but query is only implied and k is not explained at all, leaving an important parameter undocumented.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb ('Search'), a precise resource ('indexed text ... within one or more Calibre books'), and an output granularity ('relevant chunks'). This clearly differentiates it from search_books and index_book_content even without naming them.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is given about when to choose this tool over search_books or when to run index_book_content first. The phrase 'indexed text' implies a prerequisite, but the description never states it explicitly or lists alternatives.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
search_booksB
Search Calibre books by full text and return metadata plus available formats.
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| query | Yes | ||
| offset | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations exist, so the description carries the burden. It discloses the operation is a read-oriented search and that it returns metadata and available formats, but it does not mention whether content must be indexed first, what scope of books is searched, or any pagination or side-effect behavior. Some transparency is present, but significant behavioral context is missing.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, tight sentence that front-loads the action, target, mode, and return payload. There is no filler or repetition; every part of the sentence contributes useful information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
An output schema exists, so return-value details do not need to be repeated, but the description still lacks guidance for choosing between this and similar sibling tools, parameter semantics, and any prerequisites. It supports a basic invocation with defaults but is not complete enough for reliable tool selection in a context with 'search_book_content' and 'index_book_content' as siblings.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must compensate. It only implies that 'query' is a full-text search string, and says nothing about 'limit' or 'offset' pagination behavior or defaults. The parameter names are self-explanatory, but the description does not add enough meaning to make up for the missing schema documentation.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description gives a clear verb and resource: 'Search Calibre books by full text,' and states the output payload ('metadata plus available formats'). However, it does not explicitly distinguish this from the sibling 'search_book_content', so an agent cannot tell whether this searches across the library or within a single book's content without inferring from the names.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies this tool is for finding books by matching full-text content, but it gives no explicit guidance on when to prefer it over 'search_book_content' or 'get_book_details', and no exclusions. The usage signal is only implied by the phrase 'by full text.'
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
Most tools have clearly distinct purposes: list_libraries, search_books, get_book_details, index_book_content, and search_book_content are all separate operations in the workflow. The only potential confusion is between search_books (full-text metadata search) and search_book_content (semantic search over indexed chunks), but the descriptions make the distinction clear enough.
All tool names follow a consistent verb_noun snake_case pattern: list_, search_, get_, index_, search_. The verbs and object nouns match their operations, making the naming predictable and easy to navigate.
Five tools is a well-scoped size for a Calibre Content Server integration. Each tool covers a distinct stage of the library browsing and content-search workflow without unnecessary redundancy or bloat.
The toolset covers the main library discovery path (list, search, details), plus the custom indexing and semantic search pipeline. However, there is no way to delete indexed content or check indexing status, which is a minor lifecycle gap.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Agentic search over your Dewey document collections from any MCP-compatible client.
Academic literature search, retrieval, and private library management on top of OpenAlex.
Personal knowledge base MCP server with semantic search, auto-categorization, metadata extraction
Read-only MCP server for the OrchestKit docs: full-text search + Markdown fetch. No auth.
Related MCP Servers
- AlicenseNot gradedqualityAmaintenanceEnables semantic search over local Calibre libraries via MCP, allowing AI assistants to query books, annotations, and export bibliographies while keeping data private.8MIT
- AlicenseNot gradedqualityBmaintenanceEnables read-only search, browsing, and metadata retrieval from a local Calibre e-book library using natural language queries.MIT
- AlicenseNot gradedqualityBmaintenanceEnables conversational management of a Calibre ebook library via MCP, including search, metadata editing, adding, converting, deduplicating, removing, and emailing books with human-in-the-loop safety.1MIT
- AlicenseAqualityAmaintenanceConnects MCP clients to a Calibre ebook library for semantic search, metadata curation, and library management via natural language.1422112MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/gonzalochief/pergamos'
If you have feedback or need assistance with the MCP directory API, please join our Discord server