{
  "markdown": "# @parserelay/mcp\n\nParseRelay's `scan` operation as an [MCP](https://modelcontextprotocol.io) tool — so any\nMCP host (Claude Desktop, Cursor, …) can parse a document into structured, confidence-scored\nfields. Same contract as the REST API and the `<DeadSimpleMicroScanner>` component; one tool,\n`scan`.\n\n## The `scan` tool\n\nInput mirrors the sync [`ScanRequest`](https://github.com/parserelay/core) — `image` (required), plus\n`schema`, `doc_type`, `engine`, `ocr`, `dry_run`, `model`, `model_key`. (`relay` webhooks are\nomitted: a tool call is synchronous, so you get the envelope back inline.) The result is the\nfull [`ScanEnvelope`](https://github.com/parserelay/core) as JSON: `fields`, per-field `confidence`,\n`needs_review`, `field_source`, and `meta` (engine, credits, tokens).\n\nSet `dry_run: true` to preview which fields would trigger a paid rescue — and the estimated\ncredits — without spending anything.\n\n## Run it\n\n### stdio (Claude Desktop, Cursor)\n\n```jsonc\n{\n  \"mcpServers\": {\n    \"parserelay\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@parserelay/mcp\"],\n      \"env\": {\n        \"PARSERELAY_API_KEY\": \"your-key\",\n        \"PARSERELAY_BASE_URL\": \"https://api.parserelay.app\" // optional\n      }\n    }\n  }\n}\n```\n\n### streamable-HTTP (remote / hosted)\n\n```bash\nPARSERELAY_API_KEY=your-key PORT=8080 node node_modules/@parserelay/mcp/dist/http.js\n# → POST http://localhost:8080/mcp\n```\n\nStateless: a fresh server per request, so it scales horizontally. Auth per request via\n`Authorization: Bearer <key>`, falling back to `PARSERELAY_API_KEY` for single-tenant setups.\n\n## Programmatic\n\n```ts\nimport { createMcpServer } from \"@parserelay/mcp\";\nimport { ParseRelayClient } from \"@parserelay/client\";\n\nconst server = createMcpServer(new ParseRelayClient({ apiKey }));\n// then wire your own transport: await server.connect(transport)\n```\n\n## Config\n\n| Env var | Required | Default | Notes |\n| --- | --- | --- | --- |\n| `PARSERELAY_API_KEY` | stdio: yes | — | HTTP can override per request via `Authorization: Bearer`. |\n| `PARSERELAY_BASE_URL` | no | `https://api.parserelay.app` | Point at a local worker for testing. |\n| `PORT` | no | `8080` | HTTP transport only. |\n",
  "bytes": 2180,
  "sha": "e7973838388af02873ce94c291363afd93ce13595edd5684be7a67560d13d7c4",
  "repo_slug": "parserelay/mcp",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_parserelay_mcp_5cf92341/readme"
}