Hardcover OAuth MCP
io.github.benjuntilla由 GitHub 账号 benjuntilla 发布v0.1.0更新于 Nov 4, 2026
Read and update your Hardcover library, progress, lists, and goals. Sign in with Hardcover OAuth.
概览
远程 MCP 服务器,通过 OAuth 登录让助手读取和更新你在 Hardcover 的书库、阅读进度、书评、日记、书单和阅读目标。
- 可以做什么
- 搜索目录并查询书籍、版本、作者、系列和热门图书
- 读取你的书库、在读清单、书评、阅读记录和个人资料
- 修改阅读状态、页码进度、评分、书评、拥有的版本和书库条目
- 管理日记条目、排序书单、阅读目标、关注和通知
- 执行原始 GraphQL 查询、变更和删除,并提供操作与类型查找工具
- 适用场景
- 适合在 Hardcover 上记录阅读的人:想通过网页、手机或桌面助手以对话方式记录进度、标记读完、写书评、整理书单或设定目标,而不必手动操作网站。
- 运行要求
- 需要 Hardcover 账号,以及支持远程 Streamable HTTP 与 OAuth 的客户端,无需粘贴 API 密钥。可直接连接托管端点;自建则需 mise、Cloudflare 账号和注册的 Hardcover 开发者应用(HARDCOVER_CLIENT_ID、HARDCOVER_CLIENT_SECRET)。
安装
在 SourceWeft 中
- 打开 控制台中的 Hardcover OAuth MCP,将其添加到工作区。
- 连接 所需的 凭据。它们会被私密存储,绝不会在公开页面上展示。
- 为需要使用其工具的对话启用该服务。
Web executable,通过 Streamable HTTP。 远程服务在工作区中配置后即可从网页运行时运行。
交给智能体安装
把这段提示词粘贴到 Claude Code、Codex、Cursor 等智能体,或 SourceWeft 对话中。智能体会读取该服务器的安装指南,先向你展示发布者、端点和登录方式,经你同意后再把它添加到你的客户端。密钥不会写进任何命令。
阅读 https://sourceweft.com/mcp/io.github.benjuntilla%2Fhardcover-oauth-mcp/install.md,并按其中说明把这个 MCP 服务器接入我的客户端。修改任何配置之前,先告诉我它的发布者、端点和登录方式,等我确认。不要把 API 密钥写进命令或我会提交的文件;问我密钥应从哪里获取。其他 MCP 客户端
把它添加到你客户端的 mcpServers 配置中。 客户端会在首次连接时完成 OAuth 登录。
{
"mcpServers": {
"hardcover-oauth": {
"type": "http",
"url": "https://hardcover.benjuntilla.com/mcp"
}
}
}README
hardcover-oauth-mcp
Manage your Hardcover library, reading progress, reviews, lists, and goals from Claude, ChatGPT, and other AI assistants with this remote Model Context Protocol (MCP) server. Connect to the public instance at https://hardcover.benjuntilla.com/mcp (quick start) or deploy your own.
- Works in web and mobile clients. The public instance is a hosted remote server, so Claude on the web and on phones, ChatGPT, and other remote clients can connect to it. Other Hardcover MCP servers run on your own computer, where only desktop clients can reach them.
- Sign in with Hardcover (OAuth). No pasting unsafe API keys. Each person connects their own account through Hardcover's OAuth and picks which permissions to grant.
- 53 read/write tools. 47 custom task-oriented tools cover the library, progress, reviews, journal, lists, goals, follows, notifications, and vibes. Six raw GraphQL and schema-discovery tools reach anything else in the Hardcover API.
Example workflows
Track a book
- "I'm on page 212 of Piranesi." The book moves to Currently Reading and the page goes on its reading session.
- "Finished it today, 4.5 stars." The book moves to Read, finished today, with a 4.5-star rating.
Plan what's next
- "Add Kindred and The Dispossessed to my want-to-read."
- "Make a ranked list called Summer with both, Kindred first."
- "Move The Dispossessed to the top."
Set a reading goal
- "Set a goal of 30 books this year."
- "How am I doing on my goal?"
Keep a journal
- "Save this quote from Piranesi: 'The Beauty of the House is immeasurable; its Kindness infinite.'"
- "Show my notes on Piranesi."
Pick an edition
- "Which audiobook editions of Dune are there, and how long are they?"
- "Switch my copy to the shortest one."
Ask anything else
- "Which of the books I read last year had the most pages?" With no tool for that, the client looks up the API with
hardcover_find_operationsand runs a read-onlyhardcover_query. - "Answer the prompt 'What book made you cry uncontrollably?' with Kindred." The client finds the prompt with
hardcover_search, looks up the mutation withhardcover_find_operations, and runshardcover_mutate.
Quick start
Anyone with a Hardcover account can use the public instance. Add this URL to your MCP client as a remote server:
- Claude (web, desktop, mobile): Settings → Connectors → Add custom connector, then paste the URL.
- Claude Code:
claude mcp add --transport http hardcover https://hardcover.benjuntilla.com/mcp, then run/mcpto sign in. - ChatGPT (web, desktop, mobile): on chatgpt.com, open Plugins, select + → Add custom MCP server, paste the URL, keep OAuth as the authentication, and create it. Type
@in a chat to use it. - Cursor and others: add a remote (Streamable HTTP) server with that URL. The client discovers OAuth by itself.
- MCP Inspector:
bunx @modelcontextprotocol/inspector, choose Streamable HTTP, and enter the URL.
Your client opens a consent page where you pick permissions, then Hardcover asks you to sign in.
[The consent page, where you choose which Hardcover permissions the client gets]
Revoke access any time from Hardcover's Authorized apps page. See the privacy notice and terms, or deploy your own.
Report an issue
Something not working? Open an issue on GitHub, or email [email protected]. For security problems, follow the security policy instead.
How it works
It runs on the Cloudflare Developer Platform (Workers, Durable Objects, and KV), chosen for its convenient developer experience and cost efficiency. A Durable Object per connection holds the tokens and serves MCP; KV holds OAuth state. Alchemy deploys it in one command, and alchemy dev runs the same code locally. It's built with Effect 4 (including Effect's own MCP server), TypeScript 7, Bun, mise, and Astro.
The Worker is an OAuth authorization server for MCP clients, built on @cloudflare/workers-oauth-provider. It supports dynamic client registration and Client ID Metadata Documents.
The Worker checks each /mcp request (token, allowlist, the server's own rate limit, scopes) and forwards it to the connection's Durable Object. The object runs Effect's MCP server. It speaks the sessionless 2026-07-28 revision as well as 2025-11-25, 2025-06-18, and 2025-03-26. Sessions for the 2025 revisions live in the object's memory. When Cloudflare evicts an idle object, its sessions end: the client gets a 404 and, as the protocol requires, starts a new session.
Tools
Kinds: read, write (adds or changes data), and delete. A tool appears only if you chose its scopes for your connection.
All 53 tools
Supporter is a paid Hardcover membership and Librarian a Hardcover librarian role. Hardcover enforces both; a tool that always needs one says so in its title and description. Sign-in drops write:catalog:edit and write:catalog:map from accounts without the role, but anyone can add catalog records with write:catalog:append.
The raw tools check each document's operation kind, root fields, needed scopes, and size (at most 10 top-level fields) before sending it. They also reject text operators Hardcover has disabled, such as _like and _regex. Mistakes come back as clear errors instead of using up your Hardcover rate limit. hardcover_find_operations and hardcover_describe_type search an index built from Hardcover's API docs. hardcover_find_operations ranks operations by how well their names and return types match, so a phrase like "add a book to a list" works. For a type name that doesn't exist, hardcover_describe_type suggests the closest ones, so UserBook points to user_books.
Hardcover's rate limits are per user, and every app shares them. Each user gets 60 requests a minute (bursts of 10, or 15 for Supporters) and 5,000 a day (50,000 for Supporters). Each top-level field costs one request.
Deploy your own
You need mise, a Cloudflare account, and a Hardcover account. A custom domain is optional; without one, the server lives at https://hardcover-oauth-mcp.<your-subdomain>.workers.dev.
1. Install
2. Register a Hardcover app
Create one at hardcover.app/account/developer-apps/new:
- Application type: Web app (server-side). You can't change this later.
- Redirect URIs:
https://<your-domain>/callback, plushttp://localhost:1337/callbackfor local runs. - Scopes this app may request:
read:me:content read:me:roles read:catalog read:library write:library write:reviews read:journal read:lists write:lists read:goals write:goals read:users read:social write:social read:notifications write:notifications read:prompts write:prompts read:vibes write:vibes read:account write:catalog:append write:catalog:edit write:catalog:map openid offline_access. Leaveallunticked, since it would also cover scopes Hardcover adds later. - Device Authorization Grant: off.
Put the client id and secret into .env as HARDCOVER_CLIENT_ID and HARDCOVER_CLIENT_SECRET. Hardcover shows the secret only once.
3. Configure
In alchemy.run.ts, edit DEPLOYMENTS. Each key is a stage: mise run deploy --stage prod uses prod, and mise run dev uses local.
allowedUsers: your Hardcover username (or several, or numeric ids). Use"*"to let anyone connect, as the public instance does. Every person uses their own account and Hardcover rate limit.domain: a hostname on a zone in your Cloudflare account. Leave it out to use the auto-assigned workers.dev URL.
4. Sign Alchemy in to Cloudflare
5. Deploy
This builds the site, creates the Cloudflare resources, and prints the URL. Run it again after changes. mise run logs --stage prod tails logs. mise run destroy --stage prod removes everything.
Deploys keep Alchemy's state in your Cloudflare account, so any machine signed in with Alchemy can redeploy or destroy. The first deploy sets up the state store there. mise run dev and the tests keep theirs in .alchemy/.
Pushes to main deploy prod once mise run check and mise run test:e2e pass. This needs a main-only production environment with a CLOUDFLARE_ACCOUNT_ID variable and CLOUDFLARE_API_TOKEN, HARDCOVER_CLIENT_ID, and HARDCOVER_CLIENT_SECRET secrets. The token needs Account Settings and Zone read, plus Workers Scripts, Workers KV Storage, Secrets Store, Workers Routes, and SSL and Certificates edit.
- Plan: use Workers Paid. A connection's Durable Object builds its MCP server when it wakes. That takes about 100 ms of CPU, ten times the Free plan's per-request limit. After that, a call takes about 5 ms.
- The server's own rate limits: 10 registrations, 30 sign-in steps, and 60 token requests a minute per client IP. Each Hardcover account gets 120 MCP requests a minute.
- Observability: Workers Logs, Traces, and Issues are on. Cloudflare's request logs record each request's path, status, headers, and client IP, but not its query string or body. Cloudflare redacts the authorization and cookie headers. Leaving out query strings keeps Hardcover's one-time sign-in code out of logs and traces. What the token grants reaches the Durable Object as a method argument rather than a header, so it stays out of the logs. The OAuth provider files grants under a keyed pseudonym of the Hardcover user id, so the storage keys in traces don't reveal it. The Worker logs unexpected failures (defects) without tokens or request data, and Issues groups them. Expected ones, such as Hardcover rate limits, revoked access, or bad queries, go back to the agent as tool errors.
6. Connect a client
Connect the same way as the public instance, with https://<your-domain>/mcp as the URL.
Run locally
With the app and .env from steps 1 and 2 above, the whole flow works on your machine:
- Run
mise run dev. It serves the Worker in workerd athttp://localhost:1337, with local KV and Durable Objects, and reloads on code changes. It builds the static pages (README.md,PRIVACY.md,TERMS.md,SECURITY.md, andsite/) once at start, so restart it to see changes to them. You don't need a Cloudflare account. - Connect a client on the same machine to
http://localhost:1337/mcp, for exampleclaude mcp add --transport http hardcover-local http://localhost:1337/mcp.
来源:README.md,提交 553052d
工具
0版本历史
1- v0.1.0最新Oct 21, 2026
评分
已满足适用检查项的 85%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通必需25 分
- 已声明认证方式必需10 分
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分