# mervext-mcp MCP server for **Mervext** — documents in, structured JSON out, for AI agents (Claude, Claude Code, Codex, Cursor, Hermes, Gemini CLI, …). Thin wrapper over the deployed Mervext engine (`https://api.vstudiodigital.com`). Standalone: no changes to the engine repo, no state, no stored secrets. ## Hosted endpoint (live) `https://mcp.vstudiodigital.com/mcp` — Streamable HTTP, stateless, on Cloudflare Workers (scale-to-zero). Health: `GET /healthz`. Client config (any MCP client that supports HTTP + headers): ```json { "mcpServers": { "mervext": { "type": "http", "url": "https://mcp.vstudiodigital.com/mcp", "headers": { "X-API-Key": "fw_…your key…" } } } } ``` The API key is supplied **per request by the client** — the worker stores nothing, keeps no sessions, and holds no secrets. Get a key with free trial credits at https://mervext.com, or mint a device key: `POST /v1/keys/device`. ## Tools | Tool | What it does | |---|---| | `extract_document` | One document (PDF / photo / text) → structured JSON with per-field confidence. Built-in schema id or your own `schema_json`. | | `classify_document` | Detect document type without extracting fields. | | `list_schemas` | The built-in schemas (id + what each extracts). | | `check_balance` | Plan, remaining credits, usage. | | `delete_document` | Explicit zero-retention delete by document id. | ## Auth The **MCP client supplies the Mervext API key**; the server never stores it: - stdio: `MERVEKT_API_KEY=fw_live_…` - HTTP: `X-API-Key: fw_…` or `Authorization: Bearer fw_…` header per request ## Run locally ```bash npm install npm run build # stdio (local clients) MERVEKT_API_KEY=fw_live_… node dist/stdio.js # HTTP (local / testing) node dist/http.js # :8787 — POST /mcp, GET /healthz ``` Engine base URL override: `MERVEKT_API_URL` (default `https://api.vstudiodigital.com`). ## Deploy (Cloudflare Workers) ```bash npx wrangler deploy ``` - `wrangler.toml`: worker `mervext-mcp`, route `mcp.vstudiodigital.com/*` (zone vstudiodigital.com). `workers_dev` is off — route only (no workers.dev subdomain on the account). - Run from WSL — wrangler OAuth lives there (skill: `cloudflare-pages-deploys`). ## Smoke tests ```bash # stdio, against the live engine (1–2 credits) node scripts/mcp-smoke.ts [--image path.jpg] [--schema invoice] # hosted worker, real Streamable-HTTP client MERVEKT_API_KEY=… node scripts/mcp-http-smoke.ts [https://…/mcp] ``` ## Status - [x] v0 — five tools, stateless HTTP + stdio, tested against the live engine - [x] Hosted on Cloudflare Workers — live at `mcp.vstudiodigital.com`, verified end-to-end through the hosted stack: text invoice **2.1 s** (confidence 1.0, source-grounded); scanned receipt without a text layer (vision path) 7.6 s; clean 422 naming valid schemas for raw images. - [x] Official MCP registry: `com.vstudiodigital/mervext` (DNS-verified publisher) - [x] Static server card at `/.well-known/mcp/server-card.json` (metadata for registries/scanning) - [x] Smithery: `contact-3yen/mervext` — published - [ ] mcp.so / Glama (public-repo listings) ## License MIT — see [LICENSE](LICENSE). _Not in the Mervext product repo on purpose — that repo runs its own deploy pipeline._