Shelf-MCP
Manage a personal library of books, movies, TV shows, and games via Claude, with the ability to add items by photographing a shelf.
README
shelf-mcp
A personal library MCP server for books, movies, TV shows and games. Runs as a remote MCP server so the same library is reachable from Claude on desktop and mobile, and adds items from a photo of a shelf.
Runs entirely on free tiers: Prefect Horizon for hosting and OAuth, Neon for Postgres, Open Library and Google Books for metadata.
How the photo scan works
There is no OCR or vision service in this server, on purpose. When you attach a
shelf photo in the Claude app, the model reads the spines itself and calls
stage_scan with structured candidates. The server resolves each against Open
Library and Google Books, checks for duplicates by ISBN and title similarity,
scores its confidence, and returns the batch for review. Nothing enters the
library until you approve it and confirm_import runs.
That staging step is not ceremony. Spine reading fails in predictable ways — vertical text, occluded spines, publisher logos read as authors — and the resolver corrects most of it, but not all.
Layout
server.py MCP tools. Thin wrappers, no logic.
shelf/
config.py Environment settings
db.py asyncpg pool (PgBouncer-safe)
models.py Shared types and input models
enrich/ Open Library + Google Books, confidence scoring
repo/ SQL only
service/ Business logic — the REST API will import this
migrations/ Schema
The service layer never imports FastMCP. When the web app arrives it sits beside
server.py and calls the same functions.
Setup
Requires Python 3.11+.
git clone <your-repo> && cd shelf-mcp
pip install -e .
# Neon console -> Connect -> Pooled connection string
export DATABASE_URL="postgresql://...-pooler.../neondb?sslmode=require"
psql "$DATABASE_URL" -f migrations/001_generalize_schema.sql
fastmcp inspect server.py:mcp # shows what Horizon will see
python server.py # local stdio run
Deploying to Horizon
- Push to GitHub.
- At horizon.prefect.io, sign in with GitHub and pick the repo.
- Entrypoint
server.py:mcp. Turn Authentication on. - Add
DATABASE_URLas a secret. - Deploy. Test each tool in the Inspector before connecting anything.
- In Claude: Settings → Connectors → Add custom connector → paste
https://<name>.fastmcp.app/mcp.
Connectors are account-level, so it appears on your phone with no separate
mobile setup. Pushes to main redeploy automatically.
The data model, briefly
Three ideas do most of the work:
Ownership and progress are separate. Ownership belongs to the object
(owned, wishlist, lent, borrowed, sold, gone); progress belongs to
you (unstarted, in_progress, finished, abandoned). You can finish a book
and lend it out, and both facts survive.
Progress is a history. One row per read-through, watch-through or
playthrough, each with its own dates and rating. Rereading appends rather than
overwriting, so your 2019 opinion is still there. A partial unique index allows
only one in_progress record per item.
Copies are separate from items. One canonical set of metadata, many things you own. The paperback and the audiobook of the same book are one item with two copies.
Kinds and statuses are text with CHECK constraints rather than Postgres
enums, so adding boardgame or podcast later is a constraint swap instead of
an ALTER TYPE dance.
Enrichment coverage
Books resolve well. Movies, TV and games do not resolve at all — TMDB and IGDB
both require credentials, and wiring them in would cost this server its
"free, no signup" property. Add them in shelf/enrich/ behind an optional key
when you want them; nothing else has to change.
Backups
Neon's free plan keeps a 6-hour restore window and has no scheduled backups. This is your canonical data, so dump it somewhere periodically:
pg_dump "$DATABASE_URL" --no-owner --no-acl -Fc -f "shelf-$(date +%F).dump"
Not done yet
- Movies, TV and games work as data but have no enrichment.
- No REST API yet; the service layer is shaped for one.
- Covers are stored as URLs pointing at Open Library and Google, not copied.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。
mcp-server-qdrant
这个仓库展示了如何为向量搜索引擎 Qdrant 创建一个 MCP (Managed Control Plane) 服务器的示例。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。