Library MCP
Topic · Library MCP
ZajLibrary exposes a remote MCP server at /api/mcp (Streamable HTTP). The corpus index is built at deploy time; this route is the only on-demand function on an otherwise static site.
Guides
Section titled “Guides” Use the ZajLibrary MCP Connect Cursor or Claude Code, full tool reference, auth, feedback, admin triage, smoke test, and agent workflow.
Use local ZajLibrary MCP When to use local vs prod, dev setup, index refresh, CodeCanyon walkthrough QA, and feedback dry-run.
Quick reference
Section titled “Quick reference”| Item | Value |
|---|---|
| Production URL | https://library.zajapps.com/api/mcp |
| Local dev | http://localhost:4321/api/mcp (npm run dev from app/ — port 4321 only) |
| Local index refresh | cd app && npm run build:index then restart dev (index loads at server start) |
| Smoke test | cd app && npm run test:mcp |
| Transport | Streamable HTTP (JSON-RPC tools) |
| Server name | zajlibrary (from tenant.config.mjs) |
Tools at a glance
Section titled “Tools at a glance”| Tool | Access | Purpose |
|---|---|---|
list_contents | Public | Taxonomy counts, top tags, index metadata (commitShaShort, indexBuiltAt) |
search_library | Public | Keyword, semantic, or hybrid search — ranked title, URL, topic crumb, snippet |
get_document | Public* | Full Markdown body by id, slug path, or library URL |
submit_feedback | Public | File structured feedback to the same DB queue as the UI form |
list_feedback | Admin | Triage queue (emails redacted) |
review_feedback | Admin | Update review decision, implementation state, and notes on one row |
*Private documents require read-private scope (admin token or signed-in session).
Authentication
Section titled “Authentication”| Caller | Scopes |
|---|---|
| Anonymous | Public read + submit_feedback |
Authorization: Bearer <MCP_ADMIN_TOKEN> | Public + private read + feedback submit + list/review |
| Signed-in Better Auth session | Public + private read + feedback submit; allowlisted admin email also gets list/review |
Every search and list response carries index provenance (commitShaShort, builtAt) so an agent can confirm the MCP index matches the live deploy without guessing.
flowchart LR Agent["MCP client"] --> Endpoint["/api/mcp"] Endpoint --> Read["list_contents · search_library · get_document"] Endpoint --> Write["submit_feedback"] Endpoint --> Admin["list_feedback · review_feedback"] Read --> Index[("Build-time index")]Related
Section titled “Related” Platform architecture Where MCP fits in the fork-and-swap platform (visibility, feedback, admin).
Build an MCP server Implementer guide — index builder, hybrid search, Vercel route (worked example).
Deploy status Tell production, preview, and local apart before you trust index provenance.