lawruler-mcp
This MCP server lets an AI assistant create, retrieve, and update leads/intakes in the LawRuler Legal CRM through 15 tools.
Create leads/intakes —
create_lead(core fields),create_lead_full(address, DOB, contact preferences, business info), andcreate_lead_obo(on-behalf-of, skips duplicate check)Retrieve a lead —
get_leadby LeadID, returning contact info, status, case type, and all stored fieldsUpdate status and assignment —
update_lead_status,update_lead_assignee,update_lead_owner,update_lead_case_typeUpdate content —
update_lead_summary,add_conversation_note,add_tags_to_lead,update_lead_languageUpdate contact info —
update_lead_contact_info(phone, email, address)Manage custom fields —
set_custom_fieldfor a single field by API name, andupdate_lead_fieldsfor bulk standard + custom field updates via JSONTypical flow — intake capture, then driving a lead through the pipeline (New Lead → Retainer → Converted to Case) with assignment, notes, tags, and firm-specific custom data
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@lawruler-mcp create a new lead for a personal injury case"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
LawRuler MCP server
Connect Claude and other MCP clients to LawRuler to create leads, track intake status, assign owners, add notes and tags, and update custom fields.
LawRuler MCP server is a Model Context Protocol server for LawRuler, the legal CRM and intake platform. It registers 15 tools that read and write LawRuler leads. It runs over stdio by default, for desktop clients such as Claude Desktop, and offers an opt-in stateless Streamable HTTP mode that implements MCP specification 2026-07-28. LawRuler credentials stay on the machine that runs the server: they come from the setup command and your operating system's keyring, never from the client.
Features
Create leads: create a lead with core fields, with the full field set (address, date of birth, contact preferences), or on behalf of another party without the duplicate check.
Retrieve leads: look up a lead by LeadID.
Status and assignment: update a lead's status, assignee, owner and case type.
Notes and tags: update the case summary, add conversation notes and tags, and set the preferred language.
Contact details: update phone, email and address.
Custom fields: set one custom field, or update several standard and custom fields at once.
Related MCP server: LACRM MCP Server
Tools
The server registers 15 tools.
Tool | What it does |
| Create a lead with core fields: name, phone, email and case type. |
| Create a lead with the full field set, including address, date of birth and contact preferences. |
| Create a lead on behalf of another party, with the duplicate check disabled. |
| Retrieve a lead by LeadID. |
| Update a lead's status. |
| Assign a lead to a staff member. |
| Set the lead's owner, the attorney or partner who owns the matter. |
| Update a lead's case type. |
| Update the case summary. |
| Add a conversation note or chat transcript. |
| Add one or more comma-separated tags. |
| Update the preferred language. |
| Update phone, email and address. |
| Set one custom field by its API field name. |
| Update several standard and custom fields at once, with custom fields as a JSON object. |
Prompts and resources
The server also registers three prompts and three resources.
Prompt | What it does |
| Step-by-step intake creation for a contact name, phone, email and case type. |
| Moves one lead ( |
| Triages a set of known LeadIDs by priority. |
Resource | What it provides |
| Common lead status values. |
| Reference guide to LawRuler lead field names and usage. |
| Security notes for the server. |
Requirements
Python 3.12+.
A LawRuler portal and API key (in LawRuler: Setup → 3rd Party Integrations).
An MCP client such as Claude Desktop.
Installation
Install uv, then clone the repository and install its locked dependencies:
git clone https://github.com/RosenAdvertising/lawruler-mcp.git
cd lawruler-mcp
uv sync --lockedReleases are also published to PyPI: pip install lawruler-mcp installs version 0.1.2, which predates the HTTP mode described below. Install from source to use HTTP mode.
Configuration
Run the setup command once. It prompts for your portal URL and API key, tests the connection, and saves both values (see Credential storage). Find your API key in LawRuler under Setup → 3rd Party Integrations.
uv run lawruler-mcp-setupCheck the connection at any time:
uv run lawruler-mcp-verifyServer messages that say to run lawruler-mcp-setup mean uv run lawruler-mcp-setup from your clone. The server reads its credentials once at startup, so restart the MCP server after changing them.
The server reads these variables, which you can also set in its environment:
Variable | Required | Default | Purpose |
| Yes (saved by setup) | Keyring, then | LawRuler API key. |
| Yes (saved by setup) | Keyring, then | Portal origin, for example |
| No |
| Set to |
Credential storage
By default both values are stored in your operating system's native secret store via the cross-platform keyring library:
OS | Backend |
macOS | Keychain |
Windows | Credential Manager |
Linux | Secret Service (GNOME Keyring / KWallet) |
Secrets are saved under the service name lawruler-mcp when a keyring backend is available. The file fallback described below stores values on disk.
File fallback. On a host with no keyring backend (for example a headless Linux box without Secret Service), or if you set LAWRULER_MCP_USE_KEYRING=0, the values fall back to a ~/.lawruler-mcp/.env file with 0600 permissions:
LAWRULER_BASE_URL=https://yourfirm.lawruler.com
LAWRULER_API_KEY=your_api_keyOn Windows, the file is stored in the user's profile and protected by Windows' default per-user access rules. On POSIX, files are created with 0600 permissions and writes fail closed if private permissions cannot be established.
Read order. A value set in the process environment is used as is. When a variable is not set, the server reads the OS keyring, then the ~/.lawruler-mcp/.env file. A key exported in your shell therefore overrides the keyring and the file, and the keyring entry written by setup is used only while the variable is unset.
Pluggable backend. keyring lets you point at any secret store. For example, install keyrings.cryptfile for an encrypted file backend, or a cloud backend, then select it with the standard PYTHON_KEYRING_BACKEND environment variable or a keyringrc.cfg. See the keyring configuration docs.
Usage with Claude Desktop
Add the server to Claude Desktop's configuration file (~/Library/Application Support/Claude/claude_desktop_config.json on macOS, %APPDATA%\Claude\claude_desktop_config.json on Windows):
{
"mcpServers": {
"lawruler": {
"command": "uv",
"args": ["run", "--locked", "--directory", "/absolute/path/to/lawruler-mcp", "lawruler-mcp"]
}
}
}Replace /absolute/path/to/lawruler-mcp with the path of your clone, then restart Claude Desktop. Any other stdio MCP client uses the same command and arguments.
HTTP mode
Stdio is the default. Set LAWRULER_MCP_TRANSPORT=streamable-http to serve the stateless Streamable HTTP transport from MCP specification 2026-07-28 at /mcp. Each request stands alone: no initialization handshake and no Mcp-Session-Id. Clients on earlier protocol versions are served on the same endpoint.
Security: this endpoint has no authentication and no TLS. Anyone who can reach the port can run every tool, including write tools, with this server's vendor credentials. Keep the default loopback bind (
127.0.0.1), or put the server behind an authenticating TLS proxy on a private network.LAWRULER_MCP_ALLOWED_HOSTSandLAWRULER_MCP_ALLOWED_ORIGINSprotect against browser DNS rebinding, not against direct callers. A proxy in front of it needs connection and idle timeouts: a legacy-styleGET /mcpwithAccept: text/event-streamholds a stream open until the client disconnects.
Variable | Default | Purpose |
|
|
|
|
| Bind address. An empty value selects |
|
| Port; must be an integer. |
| unset | Comma-separated |
| unset | Comma-separated |
LawRuler credentials come from the same configuration as stdio (see Configuration), never from the request.
LAWRULER_MCP_TRANSPORT=streamable-http PORT=8080 uv run --locked lawruler-mcpPoint the MCP client at http://127.0.0.1:8080/mcp.
Error handling
A failed tool call returns an MCP error result (isError) with a fixed message. The server never passes a LawRuler response body, a request URL or a credential back to the client.
Situation | What the tool returns |
Credentials missing | "LawRuler credentials are missing. Run |
Authentication rejected (HTTP 401) | "LawRuler authentication was rejected. Reauthorize with |
Access denied (HTTP 403) | "LawRuler access denied: the connected account lacks permission for this action (or the authorization expired; re-run lawruler-mcp-setup if so)." |
Endpoint not found (HTTP 404) | "LawRuler endpoint was not found (HTTP 404). Check the configured portal URL and API endpoint." |
Rate limited (HTTP 429) | After the retries below: "LawRuler rate limit reached. Retry after N seconds." |
Any other HTTP error | "LawRuler request failed (HTTP 500): request_rejected." The status varies, and the reason is a fixed code such as |
HTTP 200 that carries a failure (JSON | "LawRuler request failed (HTTP 200): request_rejected." (or |
Timeout or connection failure | "LawRuler request timed out. The outcome is unknown; check whether the action completed before retrying." or "Could not connect to LawRuler. The outcome is unknown; check whether the action completed before retrying." |
Invalid arguments | A message such as "Invalid argument 'lead_id': expected integer." or "Invalid argument 'LAWRULER_BASE_URL': expected an HTTPS portal URL on lawruler.com or its subdomains, without userinfo, query, fragment, or a path; run lawruler-mcp-setup." |
Anything else | "LawRuler tool execution failed." |
Each request has a connect timeout of 3.05 seconds and a read timeout of 30 seconds, and redirects are never followed. On HTTP 429 the server waits for the Retry-After interval (10 seconds when the header is missing or unreadable) and retries, for up to three attempts in all and 60 seconds of total waiting; if the next wait would exceed what is left, the tool returns the rate-limit message at once. The server does not retry timeouts, connection failures or 5xx responses. A failed resource read returns "Requested LawRuler resource was not found." or "Unable to read the requested LawRuler resource."
At startup the server exits with a message on stderr and a non-zero status when LAWRULER_BASE_URL is set but is not a valid LawRuler portal origin, when LAWRULER_MCP_TRANSPORT is neither stdio nor streamable-http, when PORT is not an integer, or when a non-loopback LAWRULER_MCP_HOST is set without LAWRULER_MCP_ALLOWED_HOSTS.
Portal URL and write validation
LAWRULER_BASE_URL must be an HTTPS origin on lawruler.com or a subdomain,
for example https://yourfirm.lawruler.com. Startup, setup and verify share
the same validator. IP addresses, unrelated domains, userinfo, query strings,
fragments, paths other than /, and ports other than 443 are rejected before
requests or setup credential storage. Redirects are disabled on every request.
LawRuler's public API guide
uses https://sample.lawruler.com/api-legalcrmapp.aspx.
All three create tools require a nonblank full_name, or both first_name
and last_name. They also require cell_phone and primary email, which
the API guide's Available Fields table marks required. The existing tool
schemas are unchanged; missing data is rejected locally. All update paths require
at least one meaningful changed value; explicit custom values 0 and false
remain valid. For presence checks, text is normalized with Unicode NFKC and
whitespace and Unicode categories Cc/Cf/Zs/Zl/Zp are removed. NUL anywhere and
unpaired surrogate characters are rejected outright. Meaningful original values
(including non-ASCII names such as José García) are preserved in the request.
Custom API field names must match [A-Za-z_][A-Za-z0-9_]* after NFKC
normalization. Empty names, whitespace anywhere (including wrapped names),
control/format characters, surrogates and other punctuation are rejected.
Normalized, case-folded key, operation, leadid, overridelead, returnjson
and returnxml are reserved. Names are validated before empty values are omitted;
any invalid name rejects the call. Accepted names are sent in normalized form.
This applies to single custom-field writes and multi-field updates.
Verify prints a fixed success message without displaying the returned lead record.
Testing
The test suite runs offline and needs no LawRuler account: every LawRuler API call is answered by a test double for the requests session. It covers tool requests and responses, input and custom-field-name validation (including Unicode edge cases), portal URL checks, error handling and rate-limit retries, credential file handling, the setup and verify commands, the stdio server, and the Streamable HTTP transport including the 2026-07-28 wire format, Host and Origin checks and stateless requests.
uv sync --locked
uv run --locked pytest -qCI runs the suite on every push and pull request to main.
License
MIT. See LICENSE.
Available Tools
15 toolsadd_conversation_noteB
Add a conversation note or chat transcript to a lead.
Inputs: lead_id (required), conversation (required). Returns: result
add_tags_to_leadA
Add tags to a lead. For multiple tags, separate with commas: 'New, Level 1, High Value'.
Inputs: lead_id (required), tags (required). Returns: result
create_leadB
Create a new lead/intake. FirstName+LastName or FullName required. CellPhone and Email strongly recommended.
Inputs: first_name, last_name, full_name, cell_phone, +10 more. Returns: result
create_lead_fullC
Create a new lead/intake with full field set including address, DOB, and contact preferences.
Inputs: first_name, last_name, full_name, cell_phone, +26 more. Returns: result
create_lead_oboA
Create a lead with duplicate checking disabled (for On-Behalf-Of cases where the same contact has multiple matters).
Inputs: first_name, last_name, full_name, cell_phone, +5 more. Returns: result
get_leadA
Retrieve a lead/intake by LeadID. Returns contact info, status, case type, and all stored fields.
Inputs: lead_id (required). Returns: result
set_custom_fieldA
Set a custom field on a lead. field_name is the API parameter name (e.g., custom2413). Custom field names are found in the LawRuler Intake Form Builder.
Inputs: lead_id (required), field_name (required), value (required). Returns: result
update_lead_assigneeC
Assign a lead/intake to a staff member (LeadAssignee — the user managing the lead).
Inputs: lead_id (required), assignee (required). Returns: result
update_lead_case_typeB
Update the case type of a lead/intake (e.g., Auto Accident, Workers Compensation, Divorce).
Inputs: lead_id (required), case_type (required). Returns: result
update_lead_contact_infoB
Update contact information fields on a lead (phone, email, address).
Inputs: lead_id (required), cell_phone, home_phone, email, +4 more. Returns: result
update_lead_fieldsC
Update multiple fields on an existing lead at once. custom_fields_json accepts a JSON object of field_name:value pairs for custom fields.
Inputs: lead_id (required), status, case_type, lead_provider, +10 more. Returns: result
update_lead_languageB
Update the preferred language for a lead (e.g., Spanish, French, Mandarin).
Inputs: lead_id (required), language (required). Returns: result
update_lead_ownerB
Set the owner of a lead/intake (LeadOwner — the attorney or partner who owns the matter).
Inputs: lead_id (required), owner (required). Returns: result
update_lead_statusC
Update the status of a lead/intake. Common values: New Lead, Emailed Intake Questionnaire, Sent Retainer Contract, Signed Retainer Contract, Converted to Case, Approved.
Inputs: lead_id (required), status (required). Returns: result
update_lead_summaryC
Update the case description/summary for a lead.
Inputs: lead_id (required), summary (required). Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 15 tools
Each tool targets a distinct aspect of leads (creation, retrieval, field updates, tags, notes). The multiple update tools are all specific to different fields, preventing any ambiguity.
All tools follow a consistent verb_noun pattern (create_lead*, get_lead, set_custom_field, update_lead_*, add_*), making them predictable and easy to navigate.
With 15 tools covering creation, retrieval, and fine-grained updates, the count is well-suited to the domain of legal lead management without being excessive.
The set covers all major CRUD operations except delete, which is often omitted in practice. Adding a search/list tool would enhance completeness, but the current surface is robust.
Maintenance
Related MCP Connectors
Unofficial remote MCP server for Less Annoying CRM: OAuth 2.1, read-only grants, 10 tools.
B2B, GovCon & LegalTech MCP server for live RFPs, contract parsing, compliance & proposal tools.
MCP server for Getfly CRM — customers, opportunities, orders, tickets and tasks.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceA deterministic MCP server for legal intake triage that provides practice-area lookup, conflict screening, matter validation, follow-up drafting, and triage logging with a hard conflicts gate.Apache 2.0
- AlicenseAqualityCmaintenanceA comprehensive MCP server for Less Annoying CRM providing 87 tools for contacts, pipelines, tasks, events, notes, emails, files, and more.88881 npmMIT
- AlicenseBqualityDmaintenanceMCP server for PracticePanther legal practice management software. Enables reading and creating matters, contacts, time entries, invoices, and more via natural language.261MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that exposes Filevine matter management and Lead Docket intake APIs as natural-language-callable tools, enabling legal teams to query, update, and create projects and leads directly from Claude.Apache 2.0