leanpub-mcp
Provides tools for interacting with the Leanpub author API, enabling management of books, bundles, courses, and tracks, including previewing, publishing, unpublishing, retiring, closing, checking royalties and purchases, managing coupons, reading reader emails, registering interest, and polling job status.
Click on "Deploy 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., "@leanpub-mcppreview my book and tell me when it's ready"
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.
leanpub-mcp
An MCP server for the Leanpub author API — preview, publish, royalties, coupons, readers.
Why this exists
Leanpub documents an official hosted MCP server at
https://leanpub.com/api/mcp. As of 2026-09-14 that endpoint 404s on every
method (GET/POST/HEAD/OPTIONS), despite the docs describing it as live
("very early beta"). This is a local stdio server that talks to the same
documented REST API directly, so preview/publish workflows aren't blocked
on Leanpub finishing their rollout. Drop it once leanpub.com/api/mcp
actually answers.
Related MCP server: moltline-mcp
Setup
npm installAPI key
Requires a Pro plan API key from https://leanpub.com/account/api_key. Resolved fresh on every tool call (never cached), checked in this order:
LEANPUB_API_KEYenv var (literal key)LEANPUB_API_KEY_FILEenv var (path to a file containing the key).leanpub-api-keyin the current working directory~/.config/leanpub/api_key
Writing the key to a file takes effect on the very next tool call — no server restart needed.
Register with Claude Code
As a personal, cross-project tool (recommended — keeps the machine-specific
path out of any repo's committed .mcp.json):
claude mcp add --scope user --transport stdio leanpub -- node /absolute/path/to/leanpub-mcp/bin/leanpub-mcp.jsOr add to a specific project's .mcp.json:
{
"mcpServers": {
"leanpub": {
"command": "node",
"args": ["/absolute/path/to/leanpub-mcp/bin/leanpub-mcp.js"]
}
}
}
### MCP client timeout for `wait_for_job`
`wait_for_job` polls internally for up to `timeoutSeconds` (default 120),
but that's a single MCP tool call the whole time -- most MCP clients kill a
tool call after their own default request timeout (often 30s) regardless of
what the server is doing internally, since this server sends no progress
notifications. Confirmed live: a 180s `wait_for_job` call was killed at 30s
with `Request timeout after 30000ms` even though the underlying Leanpub job
finished fine.
Fix: set a per-server timeout in your MCP client config, comfortably above
whatever `timeoutSeconds` you pass. In Claude Code / OMP's `.mcp.json`:
```json
{
"mcpServers": {
"leanpub": {
"command": "node",
"args": ["/absolute/path/to/leanpub-mcp/bin/leanpub-mcp.js"],
"timeout": 300000
}
}
}Without that, just poll get_job_status directly in a loop (5s between
calls, per Leanpub's own rate-limit guidance) instead of calling
wait_for_job.
Tools
Tool | Leanpub endpoint |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| polls |
|
|
|
|
|
|
|
|
|
|
|
|
Not implemented: file upload to upload-mode books, XML response formats
(JSON only). Add them if you need them — src/client.js follows one
pattern per resource.
Typical workflow
Preview the book, then tell me when it's ready.
Calls preview_book, then wait_for_job, then reports the pdf_preview_url
/ epub_preview_url from a follow-up get_book call.
Testing
npm test # unit tests for URL building, error parsing, key resolutionUnit tests don't hit the network. To confirm the server is wired to the
real API, run verify_api_key with a real (or intentionally wrong) key and
check you get back a 200 with your username, or a clean 401.
This server cannot be deployed
Maintenance
Related MCP Connectors
- KajabiOAuthcom.kajabi
Manage Kajabi from any MCP client — products, pages, contacts, offers, emails, analytics.
MCP server for Lemon Squeezy — stores, products, orders, subscriptions, license keys.
- MoneMeeOAuthcom.monemee
Remote MCP server for creating and selling digital products via MoneMee. It lets AI agents create, publish, and sell digital products such as e-books, AI prompt packs, software, courses without a human touching a dashboard. Docs: https://monemee.com/mcp Sign up on Monemee to get a token.
Read and write Mission Control state via MCP — projects, tasks, subtasks, templates, status updates.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceAn MCP server that exposes FortiCNAPP (formerly Lacework) API 2.0 operations as typed, auth-aware tools generated from the API spec at startup, supporting both local stdio and remote Streamable HTTP transports.MIT
- AlicenseAqualityAmaintenanceZero-dependency stdio bridge to Moltline Studio's fleet of 14 hosted MCP servers covering code review, time operations, data transforms, business ops, education, research, outreach and more. Free tier requires no registration; premium tools unlock with a license. Independently audited, MCPize Verified A.210MIT
- FlicenseAqualityBmaintenanceEnables creating and modifying iKAOS Story prototype content, including reading context, saving content with optimistic revision control, and managing images, through a stdio MCP server that talks to the authenticated iKAOS Story API.7-
- AlicenseAqualityCmaintenanceEnables local MCP access to both Skilljar REST APIs (v1 and v2), reproducing the official 73-tool v2 surface and adding v1-only capabilities such as per-lesson progress, webhooks, asset upload, commerce, learning paths, and instructor-led training. Keeps credentials on your machine via stdio transport.112Apache 2.0