Skip to main content

MCP server for the Hardcover GraphQL API — library tracking and list management.

Project description

hardcover-mcp

MCP server for the Hardcover GraphQL API — personal library tracking and list management.

Requirements

Installation

git clone <repo-url>
cd hardcover-mcp

Usage

Create a .env file with your token:

HARDCOVER_API_TOKEN=<your token>

Then run:

uv run python -m hardcover_mcp.server

uv run automatically installs dependencies on first use.

MCP client config

VS Code (.vscode/mcp.json):

{
  "servers": {
    "hardcover": {
      "command": "uv",
      "args": ["run", "--directory", "/path/to/hardcover-mcp", "python", "-m", "hardcover_mcp.server"]
    }
  }
}

Claude Desktop (claude_desktop_config.json):

{
  "mcpServers": {
    "hardcover": {
      "command": "uv",
      "args": ["run", "--directory", "/path/to/hardcover-mcp", "python", "-m", "hardcover_mcp.server"]
    }
  }
}

Tools

Read

Tool Description
me Get authenticated user info (id, username, name, books count)
search_books Search for books by title, author, or ISBN
get_book Get book details by Hardcover ID or slug
get_user_library Get books from your library, optionally filtered by status
get_user_book Get your library entry for a specific book (status, rating, reading dates)
get_my_lists Get all of your Hardcover lists
get_list Get a specific list with its books

Write

Tool Description
set_user_book Add a book to your library or update its status/rating (merge-safe)
add_user_book_read Add or update a reading date entry (updates active reads instead of duplicating)
update_user_book_read Update an existing reading date entry (merge-safe)
delete_user_book_read Delete a reading date entry
delete_user_book Remove a book from your library
create_list Create a new list
update_list Update a list's name, description, or privacy
delete_list Delete a list
add_book_to_list Add a book to a list
remove_book_from_list Remove a book from a list

Scope

This server focuses on library tracking and list management. Features like social (followers, feed), recommendations, and edition management are not currently supported.

Development

Lint and format checks (using Ruff):

uv run ruff check src/
uv run ruff format --check src/

Run tests:

uv run pytest tests/ -v

Contributing

Contributions are welcome! Please:

  1. Open an issue first to discuss the change.
  2. Fork the repo and create a branch (feature/short-description or fix/short-description).
  3. Run lint and tests before submitting:
    uv run ruff check src/
    uv run ruff format --check src/
    uv run pytest tests/ -v
    
  4. Keep PRs focused — one change per PR.
  5. Use conventional commit prefixes: feat:, fix:, chore:, docs:.

Rate Limiting

The Hardcover API allows 60 requests per minute with a max query depth of 3. The client includes a sliding-window rate limiter and automatic retry with exponential backoff on 429 responses.

Troubleshooting

Problem Solution
HARDCOVER_API_TOKEN is not set Create a .env file in the project root or set the env var directly
Access is denied on Windows Use python -m hardcover_mcp.server instead of the script entry point (OneDrive .exe sync issue)
Rate limited / 429 errors The client retries automatically up to 3 times. If persistent, reduce concurrent tool calls
GraphQL error: field not found The Hardcover API may have changed. Check for updates to this server

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hardcover_mcp-0.1.1.tar.gz (13.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hardcover_mcp-0.1.1-py3-none-any.whl (18.5 kB view details)

Uploaded Python 3

File details

Details for the file hardcover_mcp-0.1.1.tar.gz.

File metadata

  • Download URL: hardcover_mcp-0.1.1.tar.gz
  • Upload date:
  • Size: 13.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for hardcover_mcp-0.1.1.tar.gz
Algorithm Hash digest
SHA256 7099408dd705f63a74ff7e7f0d8d6f7d94a526ddc0582061e9c5bad1d3d18579
MD5 1a1700082a1a2a7bcf732ae402732320
BLAKE2b-256 f511824086c9a80e517f0439504af5a90d23ceae6045c8e28f89162505ac969f

See more details on using hashes here.

File details

Details for the file hardcover_mcp-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: hardcover_mcp-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 18.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for hardcover_mcp-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4ae59d2032dfcc732f4f2c4e950cbbd25da3ab1894595d255fc87f8fdc2dce51
MD5 03228bcdfeb035929d0ba2e116b0b0c7
BLAKE2b-256 9cc945b96135b09a2cc123342533f5e6ef9d57d93c3d75735322e7b251af30d4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page