Developer API · Model Context Protocol

Submit WhatsApp documents to Legal Reviewer.

Javis connects to this app as an MCP server and calls the submit_document tool when a user sends a file over WhatsApp. The document is stored, reviewed, and the result is delivered back to the originating WhatsApp group automatically.

POST https://legal.dev.ssf.studio/legal-reviewer/mcp JSON-RPC 2.0 Bearer auth
The Try It console below makes real calls against this server. tools/list and ping are read-only, but submit_document ingests an actual document and queues a review.

Authentication

Every request must carry the shared bearer token configured on the server (LEGAL_REVIEWER_MCP_TOKEN) — the same token registered on the Javis side. Requests without it get 401.

HeaderValue
AuthorizationBearer <token>
Content-Typeapplication/json
Acceptapplication/json, text/event-stream
curl -s https://legal.dev.ssf.studio/legal-reviewer/mcp \
  -H "Authorization: Bearer $MCP_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'

submit_document

Hand a user's file to the reviewer. Provide a downloadable media_url (the app fetches the bytes server-side) and the WhatsApp group_external_id to reply to. Called via the JSON-RPC tools/call method.

ArgumentRequiredDescription
media_urlrequiredDownloadable URL of the file (PDF, DOC, DOCX, HTML).
filenamerequiredOriginal filename incl. extension, e.g. lease.pdf — determines the file type.
group_external_idrequiredWhatsApp group external id (LID) the review result is sent back to.
sender_nameoptionalDisplay name of the person who sent the document.
document_typeoptionalOne of auto, commercial, employment, tenancy, privacy, corporate, ip, other. Defaults to auto.
noteoptionalShort note or title for the document.

Try it

Calls run against https://legal.dev.ssf.studio/legal-reviewer/mcp from your browser.

Stays in your browser — sent only as the Authorization header.

This creates a real document and queues a review. Use a test file and a test group id.
// Send a request to see the response here.

Example: submit a document

The tool returns a confirmation; findings are not returned here — the review runs asynchronously and the result is pushed back to the WhatsApp group when ready (with a no-login triage link).

curl -s https://legal.dev.ssf.studio/legal-reviewer/mcp \
  -H "Authorization: Bearer $MCP_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "tools/call",
    "params": {
      "name": "submit_document",
      "arguments": {
        "media_url": "https://files.example.com/lease.pdf",
        "filename": "lease.pdf",
        "group_external_id": "120363001234567890",
        "sender_name": "Aisyah",
        "document_type": "tenancy"
      }
    }
  }'

Response shape

A successful tools/call returns text content. Validation or fetch problems come back with isError: true and a message safe to relay to the user.

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "Received \"lease.pdf\" (ID 42). Legal review has been queued — I'll send the result to this chat when it's ready."
      }
    ],
    "isError": false
  }
}