Skip to content

Connect Lawmatics to Claude: Track client intake and billing data

Learn how to connect Lawmatics to Claude using a managed MCP server. Automate client intake, audit billing data, and orchestrate legal workflows with AI.

Yuvraj Muley Yuvraj Muley · · 10 min read
Connect Lawmatics to Claude: Track client intake and billing data

If your team needs to connect Lawmatics to Claude to automate legal client intake, matter management, or billing reconciliation, you need a Model Context Protocol (MCP) server. This server acts as the critical translation layer between Claude's LLM tool calls and the Lawmatics REST APIs. You can either build and maintain this integration infrastructure yourself, or use a managed integration platform like Truto to dynamically generate a secure, authenticated MCP server URL in seconds.

If your team uses ChatGPT, check out our sibling guide on connecting Lawmatics to ChatGPT. For a broader architectural perspective on building autonomous systems, explore our overview on connecting Lawmatics to AI Agents.

Giving a Large Language Model (LLM) read and write access to a sprawling legal practice management ecosystem like Lawmatics is an engineering challenge. You have to handle OAuth 2.0 token lifecycles, map massive nested JSON schemas to MCP tool definitions, and deal with Lawmatics' specific data models around matters, contacts, and custom forms. Every time an endpoint changes, you have to update your server code, redeploy, and test the integration.

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

The Engineering Reality of the Lawmatics 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, the reality of implementing it against specialized B2B APIs is painful. Lawmatics is built to manage complex legal workflows, custom intake forms, polymorphic entity relationships, and strict billing structures. Its API reflects that exact domain complexity.

If you decide to build a custom Lawmatics MCP server, here are the specific integration challenges you will face:

Polymorphic Relationships and Document Attachments Lawmatics uses polymorphic data models for several key endpoints. For example, when creating a file, folder, or expense, you must specify the documentable_type or contactable_type - which can be a firm, client, matter, or contact - along with the corresponding ID. An LLM has no inherent context on how to construct these polymorphic relationships. If the MCP tool schema is not explicitly designed with strong descriptions and required enum values, Claude will hallucinate the foreign keys, resulting in 400 Bad Request errors. A managed MCP server derives these tool schemas directly from curated API documentation, explicitly guiding the LLM to provide the correct payload structure.

Custom Forms and Dynamic Field Workflows Lawmatics heavily relies on custom forms for client intake. Retrieving form entries requires hitting specific UUID-based endpoints, and the data returned is often highly unstructured, with keys mapping to dynamically generated custom field IDs rather than human-readable names. Your MCP server must act as a normalization layer so that Claude can actually understand the submitted intake data. Truto handles this by exposing strictly typed schemas for custom forms, allowing the model to accurately parse intake responses.

Handling Strict API Rate Limits Lawmatics enforces strict API quotas to protect their infrastructure. When building an integration, it is tempting to implement automatic retry queues and backoff logic directly inside your proxy or MCP server. However, masking rate limits from the LLM is an anti-pattern for agentic workflows. Truto does not retry, throttle, or apply backoff on rate limit errors. When Lawmatics returns an HTTP 429, Truto passes that error directly to the caller. Truto normalizes the upstream rate limit information into standardized headers (ratelimit-limit, ratelimit-remaining, ratelimit-reset) per the IETF specification. This guarantees that the caller - your AI agent framework - retains full context and is responsible for its own retry and backoff logic based on the user's immediate needs.

Generating the Lawmatics MCP Server

To connect Claude to Lawmatics, you first need to generate a self-contained MCP server endpoint. Truto handles the heavy lifting of mapping the Lawmatics REST API into JSON-RPC 2.0 tools. You can create this server through the Truto UI or programmatically via the API.

Method 1: Via the Truto UI

For teams who want a zero-code setup, you can generate the MCP server URL directly from your Truto dashboard:

  1. Log into your Truto account and navigate to the Integrated Accounts page.
  2. Select your connected Lawmatics account.
  3. Click the MCP Servers tab.
  4. Click the Create MCP Server button.
  5. Configure your server settings. You can name the server, filter by specific methods (like read-only operations), or filter by specific tool tags to limit the LLM's scope.
  6. Click Create, and copy the generated MCP server URL (e.g., https://api.truto.one/mcp/a1b2c3d4e5f6...).

Method 2: Via the Truto API

If you are building dynamic agentic experiences into your own SaaS product, you can generate MCP servers programmatically for your users. Truto validates the configuration, stores a secure hashed token, and returns a ready-to-use URL.

Make a POST request to /integrated-account/:id/mcp with your desired configuration:

curl -X POST https://api.truto.one/admin/integrated-accounts/{integrated_account_id}/mcp \
  -H "Authorization: Bearer YOUR_TRUTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Lawmatics Billing & Intake Agent",
    "config": {
      "methods": ["read", "write"],
      "tags": ["matters", "contacts", "invoices"]
    }
  }'

The API returns a securely generated MCP server URL scoped exclusively to that specific Lawmatics tenant:

{
  "id": "mcp_8a9b0c1d2e",
  "name": "Lawmatics Billing & Intake Agent",
  "url": "https://api.truto.one/mcp/f8e7d6c5b4a3...",
  "config": {
    "methods": ["read", "write"],
    "tags": ["matters", "contacts", "invoices"]
  },
  "expires_at": null
}

Connecting the MCP Server to Claude

Once you have your Truto MCP server URL, you can connect it to Claude. Depending on your environment, you can use the Claude UI or configure the server manually for local development and agent frameworks.

Method 1: Via the Claude UI (Claude for Work / Desktop)

If you are using the official Claude desktop application or web interface (for eligible workspace plans), connecting the managed URL takes seconds:

  1. Open Claude and navigate to Settings.
  2. Select Integrations or Connectors (depending on your specific app version).
  3. Click Add MCP Server or Add custom connector.
  4. Paste the Truto MCP server URL you generated earlier.
  5. Click Add.

Claude will immediately perform the initialization handshake, pull down the tool definitions, and make them available for natural language queries.

Method 2: Via Manual Configuration File (claude_desktop_config.json)

If you are running Claude Desktop locally for development, you can register the server using the configuration file. Truto's remote MCP servers communicate via Server-Sent Events (SSE). You can bridge this using the official MCP SSE transport utility.

Locate your claude_desktop_config.json file (typically in ~/Library/Application Support/Claude/ on macOS or %APPDATA%\Claude\ on Windows) and add the following configuration:

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

Restart Claude Desktop. The application will execute the npx command to establish the SSE bridge with Truto, enabling full bi-directional tool calling.

Lawmatics Hero Tools

Truto automatically derives MCP tools from the Lawmatics API documentation and schemas. Below are the most powerful "hero tools" available for automating legal intake and billing workflows.

list_all_lawmatics_matters

Description: Retrieves a paginated list of all Matters in the Lawmatics account. Matters are the core unit of work in Lawmatics, representing a specific legal case or engagement. Context: Use this tool when Claude needs to audit active caseloads, find a specific client's matter ID, or summarize the current pipeline of legal work.

"Claude, list all the current matters in our Lawmatics account and summarize the ones created in the last 7 days."

create_a_lawmatics_matter

Description: Creates a new Matter in Lawmatics. A Matter always requires a linked Contact or Company. Context: Highly useful for intake automation. Claude can extract details from an email or form, create a contact, and then immediately create a matter linked to that contact.

"Claude, create a new matter for the contact ID 4592. The matter name should be 'Smith - Real Estate Closing' and set the initial status to prospect."

get_single_lawmatics_invoice_by_id

Description: Retrieves a specific Invoice by its ID, returning detailed line items, totals, and payment status. Context: Essential for billing audits and client inquiries. When a client asks about their outstanding balance, Claude can retrieve the exact invoice details.

"Claude, pull the details for Lawmatics invoice ID 10452. What is the total amount due, and what are the specific line items being billed?"

list_all_lawmatics_form_entries

Description: Retrieves a paginated list of all entries submitted for a specific Custom Form, requiring the form_uuid. Context: This is how you automate client intake processing. Claude can read the raw form submissions, parse the custom fields, and use the data to populate CRM records.

"Claude, check the custom form entries for form UUID 'abc-123-xyz'. Extract the name and legal issue from the most recent submission."

create_a_lawmatics_contact

Description: Creates a new Contact in Lawmatics. Requires basic details like first_name. Context: The foundational tool for CRM automation. Always use this before attempting to create a matter for a net-new client.

"Claude, create a new Lawmatics contact for John Doe. His email is john.doe@example.com and his phone number is 555-0199."

create_a_lawmatics_task

Description: Creates a new Task and optionally links it to a matter, contact, or specific user. Context: Crucial for agentic workflows. After Claude creates a new matter or processes a form, it can automatically assign a follow-up task to a paralegal or attorney.

"Claude, create a task in Lawmatics to 'Review initial intake documents' for matter ID 8901. Set the due date for tomorrow."

list_all_lawmatics_time_entries

Description: Retrieves a paginated list of all Time Entries in Lawmatics. Context: Use this for productivity reporting and billing reconciliation. Claude can analyze time entries to find unbilled hours or summarize work performed on a specific matter.

"Claude, list the recent time entries in Lawmatics. Calculate the total hours billed by user ID 42 over the past week."

Note: This is only a curated selection of high-leverage tools. For the complete tool inventory, required parameters, and JSON schemas, visit the Lawmatics integration page.

Workflows in Action

By chaining these tools together, Claude can execute multi-step legal operations that traditionally require heavy manual data entry. Here are two concrete workflows.

Workflow 1: Automated Client Intake and Triage

When a new lead submits a contact form on a law firm's website, the data needs to be processed, validated, and triaged into Lawmatics. Claude can completely automate this.

"Claude, check our website intake form in Lawmatics. If there is a new submission today, extract the person's details, create a new contact for them, open a new matter called ' [Last Name] - Initial Consult', and assign a task to review the file."

  1. Read Intake Data: Claude calls list_all_lawmatics_form_entries using the known intake form UUID.
  2. Create the Client Record: Parsing the returned JSON, Claude calls create_a_lawmatics_contact using the extracted first name, last name, and email address.
  3. Open the Case: Using the ID returned from the contact creation, Claude calls create_a_lawmatics_matter, linking the new matter directly to the contact.
  4. Assign the Work: Finally, Claude calls create_a_lawmatics_task and associates it with the newly created matter ID, ensuring the legal team is notified.
sequenceDiagram
    participant Claude as Claude Desktop
    participant MCP as Truto MCP Server
    participant Lawmatics as Lawmatics API

    Claude->>MCP: Call list_all_lawmatics_form_entries
    MCP->>Lawmatics: GET /v1/forms/{uuid}/entries
    Lawmatics-->>MCP: Returns raw form JSON
    MCP-->>Claude: Tool response (form data)
    
    Claude->>MCP: Call create_a_lawmatics_contact
    MCP->>Lawmatics: POST /v1/contacts
    Lawmatics-->>MCP: Returns new Contact ID
    MCP-->>Claude: Tool response (Contact ID: 882)
    
    Claude->>MCP: Call create_a_lawmatics_matter
    MCP->>Lawmatics: POST /v1/matters (contact_id: 882)
    Lawmatics-->>MCP: Returns new Matter ID
    MCP-->>Claude: Tool response (Matter ID: 994)

Workflow 2: Unbilled Time Audit

Law firms routinely lose revenue when billable time is tracked but never actually invoiced. Claude can act as an automated billing auditor.

"Claude, pull the time entries for matter ID 4052. Compare the total hours logged against the line items on invoice ID 1055. Tell me if there is any unbilled time."

  1. Fetch Logged Time: Claude calls list_all_lawmatics_time_entries and filters the response to isolate records associated with matter ID 4052, summing the total logged hours.
  2. Fetch Billed Time: Claude calls get_single_lawmatics_invoice_by_id for invoice 1055, parsing the line items to calculate the total hours explicitly billed to the client.
  3. Reconcile and Report: The model compares the two datasets entirely within its context window, generating a plain-text report for the billing department detailing exactly how many hours are missing from the invoice.

Security and Access Control

Giving AI agents access to sensitive legal and financial data requires strict governance. Truto MCP servers provide robust security primitives to limit exactly what an LLM can see and do within Lawmatics:

  • Method Filtering: When creating the server via the API or UI, you can enforce strict constraints using the methods array. Passing ["read"] ensures the server will only generate tools for GET and list endpoints, physically preventing Claude from modifying legal records or creating erroneous invoices.
  • Tag Filtering: You can restrict the LLM to specific functional domains. Passing tags: ["billing"] ensures the server only exposes tools related to expenses, time entries, and invoices, keeping the agent entirely walled off from sensitive contact directories.
  • Mandatory API Token Authentication: By enabling require_api_token_auth: true, possession of the MCP URL is no longer enough to invoke tools. The MCP client must pass a valid Truto API token in the Authorization header, preventing unauthorized execution if the URL is leaked.
  • Ephemeral Server Lifecycles: For temporary agentic tasks or short-lived contractor access, you can set the expires_at field. Once the timestamp passes, the server infrastructure is automatically torn down at the database and cache levels, permanently revoking access.

The true power of the Model Context Protocol is that it moves integration logic out of bespoke, brittle point-to-point scripts and into a standardized, model-agnostic interface. By pairing Claude's reasoning capabilities with a managed Truto MCP server, you can transform Lawmatics from a static database into an active, autonomous participant in your legal operations.

Whether you are automating messy client intake forms, reconciling time entries, or orchestrating complex matter pipelines, managed MCP servers eliminate the friction of OAuth management and schema mapping. Your engineers can stop writing API boilerplate and start focusing on the actual agentic workflows that drive firm efficiency.

FAQ

Does Truto automatically retry Lawmatics API rate limits?
No. Truto explicitly passes 429 rate limit errors directly back to the caller and normalizes upstream rate limit information into standardized IETF headers (`ratelimit-limit`, `ratelimit-remaining`, `ratelimit-reset`). The AI agent framework is responsible for handling retry and backoff logic.
How do I ensure Claude doesn't delete matters or contacts?
When generating the MCP server, you can use method filtering by passing `methods: ["read"]`. This limits the generated tools to only GET and list operations, physically preventing the LLM from making destructive changes.
Can I connect this MCP server to ChatGPT instead of Claude?
Yes. While this guide focuses on Claude, the generated Truto MCP server is standard JSON-RPC 2.0. You can paste the same URL into ChatGPT's custom connector settings (requires Developer Mode on eligible plans).
How do I handle custom forms in Lawmatics with MCP?
Truto auto-generates tools like `list_all_lawmatics_form_entries` which expose the structured schema of the API. Claude can use this tool with the specific form UUID to read and parse the dynamic custom field data from intake submissions.

More from our Blog