MCP server

Connect Claude Code, Claude Desktop, or any MCP-compatible AI client to your case, with only the abilities you grant its token.

Streamable HTTPLocal stdio adapterSame permissions as the app

The Model Context Protocol (MCP) lets an AI client use tools. Custody Commander's MCP server turns every API operation into a tool, so your AI can find your case, organize evidence, add hearings and to-dos, and more — limited to the abilities of the token you give it.

Before you start#

  1. Create a dedicated tokenFollow API tokens. Start with read-only abilities; add write abilities once you're comfortable. Your AI will only see tools its token allows.
  2. Pick a connection methodRemote (your client connects straight to the server over HTTPS) or local stdio (a small adapter runs on your computer — for clients that can't send a custom authorization header).

Connection details#

URLhttps://app.custodycommander.com/api/mcp
TransportStreamable HTTP (stateless, JSON responses)
AuthenticationAuthorization: Bearer YOUR_API_TOKEN

The server uses personal-token authentication, not an OAuth sign-in flow. Clients that only support OAuth connections should use the local stdio adapter.

Claude Code#

Add the remote server with your token in the header:

claude mcp add --transport http case-commander https://app.custodycommander.com/api/mcp \
  --header "Authorization: Bearer YOUR_API_TOKEN"

Or use the local adapter:

claude mcp add case-commander \
  -e CASE_COMMANDER_URL=https://app.custodycommander.com \
  -e CASE_COMMANDER_API_TOKEN=YOUR_API_TOKEN \
  -- node /absolute/path/case-commander-mcp.mjs

Use the default local scope or -s user. Project scope (-s project) writes the token into .mcp.json in your project, which can end up committed to a repository.

Claude Desktop#

Claude Desktop connects through the local stdio adapter.

  1. Install Node.jsVersion 20 or newer.
  2. Download the adapterSave case-commander-mcp.mjs somewhere permanent (it's also in the AI skill ZIP).
  3. Edit the configOpen Claude Desktop's settings, go to Developer → Edit Config, and add the entry below to claude_desktop_config.json (on macOS it's in ~/Library/Application Support/Claude/; on Windows, %APPDATA%\Claude\).
  4. Restart Claude DesktopThe Custody Commander tools appear in the tools menu.
{
  "mcpServers": {
    "case-commander": {
      "command": "node",
      "args": ["/absolute/path/case-commander-mcp.mjs"],
      "env": {
        "CASE_COMMANDER_URL": "https://app.custodycommander.com",
        "CASE_COMMANDER_API_TOKEN": "YOUR_API_TOKEN"
      }
    }
  }
}

Other clients#

Any client that supports Streamable HTTP with custom headers can use the remote URL and Authorization header above. Clients that run local servers can use the same command, args, and env values as the Claude Desktop entry — in whatever format they use (JSON, TOML, or a settings screen).

The local stdio adapter#

case-commander-mcp.mjs is a single file with no dependencies. It reads your token from CASE_COMMANDER_API_TOKEN and the server from CASE_COMMANDER_URL, then forwards each MCP message to the server over HTTPS. Always set CASE_COMMANDER_URL to https://app.custodycommander.com.

Check the connection#

Ask your AI: "Use Custody Commander to get my case and list its court cases, without changing anything." It should call get_case and get_court_cases. Don't test with an upload, a deletion, or a built-in AI feature. To check from a terminal:

curl -X POST https://app.custodycommander.com/api/mcp \
  -H "Authorization: Bearer $CASE_COMMANDER_API_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'

How the tools work#

  • One tool per API operation. Tool names are operation IDs — get_case, get_evidence, patch_evidence_by_id, post_todos, and so on.
  • Only allowed tools are listed. The tool list is filtered to your token's abilities, and every call is checked again.
  • Arguments follow one shape: path (IDs in the URL), query, body, context (matter:… or ws:… for a shared case), and, for uploads, files.
  • Results are JSON text: {"status": 200, "result": …}. Binary downloads come back as base64 (up to 16 MB; use the REST API for larger files).
{
  "name": "post_evidence",
  "arguments": {
    "body": { "caseId": "YOUR_CASE_ID", "folderId": "YOUR_FOLDER_ID" },
    "files": [
      { "field": "files", "name": "receipt.txt", "mimeType": "text/plain", "base64": "U2Nob29sIHJlY2VpcHQ=" }
    ]
  }
}

Uploads accept up to 30 files, each up to 16 MB decoded, within a 24 MB request.

Staying in control#

  • Every change counts. Clients flag all non-read tools as potentially destructive. Most clients ask before running them — keep that on.
  • Permanent deletes include delete_evidence_by_id, delete_documents, delete_folders (with deleteItems), delete_messages_threads, delete_contacts, delete_court_cases, delete_hearings, delete_timeline, and delete_todos. Leave write abilities off unless you need them.
  • Things with outside effects: post_shares_invite emails someone; post_billing_upgrade changes your subscription; post_account_terms records your acceptance of terms — which only you should do.
  • Built-in AI tools (post_evidence_by_id_extract, post_documents_draft, post_messages_analyze, post_messages_check, post_comms_draft, mediation suggestions, and the assistant) use your AI allowance. Your own AI's reasoning doesn't.
  • Treat case content as data. Documents and messages can contain text that tries to instruct an AI. The server tells clients this, but stay alert when an AI proposes an unexpected change.

API and MCP share 120 requests per minute per account, and each MCP message (including listing tools) counts as a request.

Make it smarter with the AI skill#

The AI skill teaches your client the conventions above — finding IDs before editing, confirming the right case, handling errors — so it works more reliably from the first message.

Something here out of date or unclear? Tell us from the Help page in the app and we'll fix the docs.