JSONPad docs MCP server
A Model Context Protocol server that gives
AI agents the JSONPad documentation, and checkers for the
things JSONPad asks you to write: write rules, flows, schema sync documents and
token permissions.
It's read-only and needs no account: it can't see anyone's data or call the
API, and nothing it does costs a request. For working with your own lists and
items, use the JSONPad API MCP server.
Installing
It's hosted at https://mcp.jsonpad.io/docs (Streamable HTTP), which is
always up to date. In Claude Code:
claude mcp add --transport http jsonpad-docs https://mcp.jsonpad.io/docs
Or run this package locally, over stdio. In Claude Code:
claude mcp add jsonpad-docs -- npx -y @basementuniverse/jsonpad-docs-mcp
Other hosts (Claude Desktop, Cursor, ...):
{
"mcpServers": {
"jsonpad-docs": {
"command": "npx",
"args": ["-y", "@basementuniverse/jsonpad-docs-mcp"]
}
}
}
Node 22.12 or later.
Tools
search_docs | Search the docs, the SDK references and the CLI reference |
read_doc | Read a page, or one section of it, as markdown |
list_docs | The table of contents |
list_api_endpoints | Every REST endpoint an API token can call |
get_api_endpoint | One endpoint's full contract, and the SDK method that calls it |
get_sdk_method | A JavaScript SDK method's signature and example |
get_cli_command | A jsonpad command's usage and options |
lookup_error | What an error code means, and where to read more |
get_plan_limits | Each plan's limits |
check_write_rules | Compile write rules and run their tests |
eval_write_rule | Try one write against some rules, and see why it came out that way |
check_flow | Compile a flow and run its tests against in-memory data |
validate_sync_document | Check a schema sync document, and every rule set and flow in it |
validate_token_permissions | Check token permission rules, and warn about surprising ones |
The checkers use the same rules and flows engines as the API, at the same
versions. When the API upgrades its engines, this package warns on every
checker result until it's updated too (set JSONPAD_DOCS_VERSION_CHECK=0 to
skip the check).
There are also resources (every page, the SDK READMEs, the JSON schemas,
llms.txt) and prompts (jsonpad-quickstart, design-schema-document,
write-rules, write-flow, explain-jsonpad-error,
plan-token-permissions, recover-lost-data).
Developing
The server lives in the JSONPad repository, in mcp/docs. It never imports
from server/src: everything it knows is in corpus/corpus.json, built from
the pre-rendered documentation.
npm run build && npm run prerender && npm run generate-seo
npm run build:corpus
npm test
node src/cli.ts
node src/cli.ts --http
--http is how it's hosted: stateless, one server per request, with the
checkers in a worker thread with a time limit and a per-IP rate limit. Its
options and environment variables are at the top of src/cli.ts, and the
hosting (nginx, PM2, the deploy) is in docs/mcp-servers.md in the JSONPad
repository.
The corpus build is also a docs lint
npm run build:corpus reads:
- the markdown twins in
client/build/docs/, the pre-render manifest and
client/scripts/prerender.config.js (pages and sections);
- the READMEs of the SDK and realtime SDK, and the CLI's
REFERENCE.md, from
this package's node_modules (so the corpus describes the published
versions this package depends on);
- the JSON schemas from
server/src/data/ and the engine packages;
server/src/data/subscription-plans.json, the settings seed (reserved index
path names) and server/src/errors/error-codes.ts.
It fails, without writing the corpus, when the documentation is wrong in a way
that would mislead an agent: a page with no markdown twin, an API reference page
whose endpoint or parameters don't parse, JSON examples that aren't JSON, rules
examples that don't compile, links to pages that don't exist, heading ids that
aren't lowercase-with-hyphens, an error name that doesn't match the API's, or
engine versions that aren't the API's. Smaller problems (missing sections on an
endpoint page, undocumented error codes, links to missing anchors) are printed
as warnings.
The tests include drift checks: every route an API token can call has an API
reference page (and the other way round), every SDK method in the corpus exists
in the installed SDK, and the engines match the server's.
Upgrading an engine
The server pins @basementuniverse/jsonpad-rules and
@basementuniverse/jsonpad-flows exactly; so does this package, and the corpus
build fails until they agree. Bump both in the same release, and publish this
package with it.
Releasing
From a checkout with a fresh pre-render, run npm run release:check (build,
corpus build, tests, and a dry-run pack), then npm publish --access public,
then publish server.json to the MCP Registry (see docs/mcp-servers.md). There are no
npm lifecycle hooks, so publishing never builds anything by itself. Bump the
SDK and CLI devDependencies first if they've been released, so the corpus
describes them.