Skip to content

Elaichifrom the team behind Truto

Connect CasePeer to ChatGPT: Manage Legal Cases and Documents

Roopendra Talekar Roopendra Talekar 10 min read

The best way to connect CasePeer to ChatGPT is Elaichi: connect CasePeer to Elaichi once, then add Elaichi to ChatGPT as a connector. Two steps, about a minute, with a 14‑day free trial and no credit card required.

  1. Start your free trial

    14 days free, no credit card required.

  2. Connect CasePeer

    Once, in Elaichi. ChatGPT never gets more access than you have.

  3. Add Elaichi to ChatGPT

    In ChatGPT, open Plugins, press +, and paste the URL into Server URL. Sign in and approve.

    https://api.elaichi.ai/mcp

Building CasePeer into your own product? The guide below is for you. Read the guide Start free on Truto

The developer guide

Learn how to connect CasePeer to ChatGPT using a managed MCP server. Automate legal case management, document retrieval, and client intake with AI agents.

If you need to connect CasePeer to ChatGPT to automate legal intake workflows, track case progression, or orchestrate document downloads, you need a Model Context Protocol (MCP) server. This server acts as the translation layer between ChatGPT's tool calls and CasePeer's complex legal practice management APIs. You can either spend weeks building, hosting, and maintaining a custom MCP server to map JSON-RPC requests to CasePeer's specific payloads, or use a managed integration platform like Truto to dynamically generate a secure, authenticated MCP server URL.

If your team uses Claude, check out our guide on connecting CasePeer to Claude or explore our broader architectural overview on connecting CasePeer to AI Agents.

Giving a Large Language Model (LLM) read and write access to a legal practice management system is a significant engineering challenge. You must handle strictly typed relational payloads, navigate asynchronous document delivery endpoints, and manage dual-API architectures for transactional versus analytical data.

This guide breaks down exactly how to use Truto to generate a secure, managed MCP server for CasePeer, connect it natively to ChatGPT, and execute complex legal workflows using natural language.

The Engineering Reality of the CasePeer API

A custom MCP server is a self-hosted integration layer. While the open MCP standard provides a predictable way for models to discover tools, implementing it against CasePeer's highly specific API is exceptionally painful for engineering teams.

If you decide to build a custom MCP server for CasePeer, you own the entire API lifecycle. Here are the specific integration challenges that break standard REST CRUD assumptions when working with CasePeer:

The Dual-API Architecture (Transactional vs Data Sync)

CasePeer exposes two fundamentally different APIs. Standard transactional operations live under /api/v1/ and are designed for single-record CRUD. However, if an LLM needs to query bulk relational data - like generating a report of all health liens or damages - it must use the Data Sync API (/data-sync-api/v1/). A custom MCP server must programmatically expose both sets of endpoints and explicitly train the LLM on which one to use via detailed JSON Schema descriptions. If you map this poorly, ChatGPT will attempt to run heavy analytical queries against rate-limited transactional endpoints.

Asynchronous Document Downloads via 204 Location Headers

When an LLM attempts to download a Case Document, the API does not simply return a binary payload or a static S3 link. The /api/v1/case-documents/{id}/data endpoint triggers an asynchronous process. The document file is only available once its download_status reaches Completed (documents that are Pending/Processing or Failed return 410 Gone). Once ready, the API responds with a 204 No Content and places a highly temporary (20-minute) URL in the Location header. Your MCP server must catch this header, intercept the redirect, and surface the temporary link cleanly back to the LLM context.

Polymorphic Contact Shapes

Legal cases involve highly varied contact types (clients, defendants, expert witnesses, adjusters). CasePeer handles this via polymorphic contact shapes. The /api/v1/contacts/{id} response serializes differently depending on the contact's subtype. Address, phone, email, and website attributes are often nested arrays requiring specific tag parsing. If you attempt to feed a generic contact schema to an LLM, the model will hallucinate field paths when attempting to update a contact record.

Generating the CasePeer MCP Server

Truto handles the schema translation, pagination normalization, and authentication lifecycle automatically. You can generate a CasePeer MCP server scoped to a specific law firm's account using either the Truto UI or the API.

Method 1: Via the Truto UI

If you are setting up an internal tool or testing workflows manually, the UI is the fastest path:

  1. Log into your Truto dashboard and navigate to Integrated Accounts.
  2. Select your connected CasePeer account.
  3. Click the MCP Servers tab.
  4. Click Create MCP Server.
  5. Select your desired configuration (e.g., restrict to read methods or specific tags like cases and documents).
  6. Copy the generated MCP server URL (it will look like https://api.truto.one/mcp/a1b2c3d4...).

Method 2: Via the Truto API

For production deployments where you are dynamically provisioning AI agents for your end-users, you should generate the MCP server programmatically.

Make a POST request to /integrated-account/:id/mcp. You can use method and tag filters to restrict exactly what the generated server can touch.

curl -X POST https://api.truto.one/integrated-account/$INTEGRATED_ACCOUNT_ID/mcp \
  -H "Authorization: Bearer $TRUTO_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "CasePeer Intake Agent",
    "config": {
      "methods": ["read", "write"],
      "tags": ["cases", "clients", "case_documents", "case_notes"]
    }
  }'

The API responds with a secure URL payload. This URL contains a cryptographic token that securely routes requests to the specific CasePeer account.

{
  "id": "mcp_8a9b0c1d2e",
  "name": "CasePeer Intake Agent",
  "config": {
    "methods": ["read", "write"],
    "tags": ["cases", "clients", "case_documents", "case_notes"]
  },
  "expires_at": null,
  "url": "https://api.truto.one/mcp/a1b2c3d4e5f67890"
}

Connecting the MCP Server to ChatGPT

Once you have your Truto MCP URL, you can plug it into ChatGPT using either the native desktop UI or a manual configuration file for programmatic use.

Method A: Via the ChatGPT UI (Desktop/Web)

If you have a ChatGPT Pro, Plus, Business, Enterprise, or Education account, you can add custom connectors directly in the interface:

  1. Open ChatGPT and go to Settings -> Apps -> Advanced settings.
  2. Enable Developer mode (custom MCP support requires this flag).
  3. Under MCP servers / Custom connectors, click Add new server.
  4. Name: CasePeer (Truto)
  5. Server URL: Paste the URL generated in the previous step.
  6. Save the configuration. ChatGPT will immediately perform a handshake and pull in the available CasePeer tools.

Method B: Via Manual Config File (SSE)

If you are running local agents, custom wrapper UIs, or testing the protocol via the CLI, you can connect to the Truto endpoint using Server-Sent Events (SSE).

Create or update your mcp_config.json file to use the official SSE transport package. This forces the MCP client to route JSON-RPC messages over HTTP POST to Truto.

{
  "mcpServers": {
    "casepeer-production": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-sse",
        "--url",
        "https://api.truto.one/mcp/a1b2c3d4e5f67890"
      ]
    }
  }
}

Hero Tools for CasePeer

Truto automatically derives tool definitions from the CasePeer API documentation. Here are the highest-leverage tools your AI agent should use for legal operations.

create_a_case_peer_case

This tool handles the complex transaction of creating a new case and its primary client simultaneously. CasePeer requires a Date of Incident (doi) and a client payload object.

Contextual Usage Notes: Use this during initial legal intake. You must provide attributes.caseclient to create a new client, including firstname and lastname.

"A new client, Sarah Jenkins, called in regarding an auto accident that happened on October 12, 2024. Create a new case file for her and set the incident type to MVA."

get_single_case_peer_case_document_datum_by_id

This tool executes the asynchronous document download request. It hits /api/v1/case-documents/{id}/data.

Contextual Usage Notes: Instruct your agent that it must first verify the download_status is Completed. The tool will return a 204 response with a temporary S3 file URL in the Location header. The agent can then use a standard HTTP GET or a secondary document parsing tool to read the file.

"Fetch the raw file data for the police report document ID 884723. Extract the location URL from the headers and summarize the officer's narrative."

create_a_case_peer_case_note

Notes are the lifeblood of a CasePeer file. This tool appends chronological updates to a case.

Contextual Usage Notes: Notes require a type and relationships to the specific case ID. This should be utilized heavily by agents acting as paralegals or intake coordinators to log phone calls and summarizations.

"Log a case note on case 19482 stating that we received the medical records from Memorial Hospital and I have placed them in the review queue."

create_a_case_peer_cost

This tool creates a cost request on a case file.

Contextual Usage Notes: Creating a cost in CasePeer is not a silent operation - it triggers internal notifications to firm accountants and automatically creates an associated case note. Agents should ensure cost amounts are verified before executing this tool to avoid spamming the accounting team.

"Log a cost request for $150.00 on case 33921 for the medical records retrieval fee from Dr. Smith's office."

list_all_case_peer_sync_health_liens

This tool utilizes the specialized Data Sync API (/data-sync-api/v1/health-liens) to pull bulk relational data for reporting.

Contextual Usage Notes: Use this tool when the user asks for cross-case reporting or financial aggregations rather than looking up a single case file. It supports limits up to 1000 records.

"Pull a list of all active health liens across the firm so I can cross-reference outstanding settlement demands."

list_all_case_peer_case_tasks

Retrieves the task list for the firm.

Contextual Usage Notes: Highly useful for agentic task orchestration. Agents can pull tasks, filter for overdue items, and alert the assigned caseworkers.

"Check the task list for case 10583. Are there any outstanding tasks related to filing the complaint?"

Note: These are just the hero operations. For the complete inventory of available tools, query schemas, and body schemas, view the CasePeer integration page.

Workflows in Action

Below are real-world examples of how ChatGPT can orchestrate multi-step legal workflows using the CasePeer MCP server.

1. Automated New Client Intake

When a law firm receives a new lead via phone or email, an intake coordinator typically has to manually create the contact, open the case, and assign an initial review task. An AI agent can handle this entire chain.

"We just signed a new client, Michael Vance. He was involved in a slip and fall on November 3rd, 2024. Open a case, log a note that the retainer agreement is signed, and assign a task to the intake team to request medical records."

Execution Steps:

  1. The agent calls create_a_case_peer_case with attributes.caseclient.firstname = "Michael", lastname = "Vance", and attributes.doi = "2024-11-03".
  2. CasePeer returns the new Case ID (e.g., 45001).
  3. The agent calls create_a_case_peer_case_note using Case ID 45001 with the text "Retainer agreement is signed."
  4. The agent calls create_a_case_peer_case_task to generate a "Request Medical Records" task linked to the new case.
sequenceDiagram
    participant User as User
    participant GPT as ChatGPT
    participant Truto as Truto MCP
    participant API as CasePeer API
    
    User->>GPT: "Open case for Michael Vance..."
    GPT->>Truto: Call create_a_case_peer_case
    Truto->>API: POST /api/v1/cases
    API-->>Truto: Case ID 45001
    Truto-->>GPT: Return Case ID
    GPT->>Truto: Call create_a_case_peer_case_note
    Truto->>API: POST /api/v1/case-notes
    API-->>Truto: Note created
    Truto-->>GPT: Return success
    GPT->>Truto: Call create_a_case_peer_case_task
    Truto->>API: POST /api/v1/case-tasks
    API-->>Truto: Task created
    Truto-->>GPT: Return success
    GPT-->>User: "Case 45001 opened, note logged, task assigned."

2. Document Processing and Accounting Sync

Paralegals often spend hours pulling down requested records and logging the associated costs for those records on the client's ledger.

"Check case 38221 for any recently uploaded police reports. If you find one, download it, summarize it, and log a $25 cost request for the police department fee."

Execution Steps:

  1. The agent calls list_all_case_peer_case_documents filtered by Case ID 38221 and identifies the document ID for the police report.
  2. The agent calls get_single_case_peer_case_document_datum_by_id. The MCP server returns the temporary Location header URL.
  3. The agent accesses the temporary URL, reads the PDF text, and summarizes the narrative.
  4. The agent calls create_a_case_peer_cost on Case ID 38221 for $25.00.
flowchart TD
    A["list_all_case_peer_case_documents<br>(Filter by Case ID)"] --> B["Identify Document ID"]
    B --> C["get_single_case_peer_case_document_datum_by_id"]
    C -->|Returns 204 Location Header| D["Download and parse temporary URL"]
    D --> E["create_a_case_peer_cost<br>(Log $25 expense)"]

Security and Access Control

Providing LLMs with autonomous access to sensitive legal practice management data requires strict governance. Truto's MCP tokens provide robust security controls at the infrastructure level:

  • Method Filtering (config.methods): Restrict an MCP server to strictly read-only access by passing methods: ["read"] during creation. This ensures the LLM can query case data but physically cannot execute create, update, or delete operations.
  • Tag Filtering (config.tags): Scope the server to specific domains. For example, if you only want an agent handling document retrieval, set tags: ["case_documents", "case_document_folders"] to completely hide financial and medical data endpoints.
  • Mandatory API Auth (require_api_token_auth): Enable this flag to require the caller to pass a valid Truto API token in the Authorization header, ensuring possession of the MCP URL alone is not enough to access the API.
  • Ephemeral Servers (expires_at): Set a TTL (Time-To-Live) on the MCP server to automatically destroy the endpoint and revoke access after a temporary workflow or testing session concludes.

Handling Rate Limits and Error Passthrough

It is critical to understand that Truto does not automatically retry, throttle, or apply exponential backoff to rate limit errors. When the upstream CasePeer API returns an HTTP 429 (Too Many Requests), Truto passes that error directly back to the calling client (the LLM or your agent framework).

Truto normalizes the upstream rate limit information into standard IETF headers (ratelimit-limit, ratelimit-remaining, ratelimit-reset). Your agent framework (e.g., LangGraph, AutoGen, or your custom implementation) is entirely responsible for reading these headers and managing retry and backoff logic. Do not build AI agents assuming the MCP server will absorb these errors for you.

Take AI Workflows to Production

Connecting ChatGPT to CasePeer via a custom, hand-coded MCP server requires managing polymorphic schemas, reverse-engineering Data Sync APIs, and building infrastructure to handle asynchronous file retrieval headers.

By leveraging Truto, you bypass this entirely. You get a production-ready, auto-updating JSON-RPC endpoint that guarantees secure, schema-perfect tool generation mapped directly to the reality of the CasePeer API.

FAQ

What is the easiest way to connect CasePeer to ChatGPT?
The best way to connect CasePeer to ChatGPT is Elaichi: connect CasePeer to Elaichi once, then add Elaichi to ChatGPT as a connector. Two steps, about a minute, with a 14-day free trial and no credit card required.
How does an LLM download documents from the CasePeer API?
CasePeer document downloads are asynchronous. The API returns a 204 No Content response with a temporary 20-minute file URL in the Location header. The MCP server relays this URL back to the LLM to access the file.
Can I prevent ChatGPT from modifying financial data in CasePeer?
Yes. When generating the MCP server via Truto, use the config.methods parameter to restrict the server to 'read' only, or use config.tags to exclude financial tools entirely.
What is the difference between CasePeer's standard API and the Data Sync API?
The standard API is built for transactional, single-record CRUD operations (e.g., creating a case note). The Data Sync API is designed for bulk relational data extraction and reporting (e.g., listing all health liens across a firm).
Does Truto automatically retry API calls if CasePeer rate limits are hit?
No. Truto passes HTTP 429 rate limit errors directly to the caller, normalizing the response with standard ratelimit-limit, remaining, and reset headers. Your AI agent framework is responsible for handling retries.

Two ways in

Two ways to put CasePeer to work

Elaichifrom the team behind Truto

For you and your team

Use CasePeer in ChatGPT yourself

Connect CasePeer once, add Elaichi to ChatGPT, and ask. Every call is checked against your own permissions and logged.

Start free, 14 days No credit card required

For product teams

Ship CasePeer to your customers

Your customers connect their own CasePeer accounts. Your product gets one API and MCP tools for CasePeer, through Truto.

CasePeer CasePeer in ChatGPT14 days free Start free

Blog

More from our Blog