The Technology Behind ESQ CoPilot

An MCP server that gives ChatGPT, Claude and other AI apps a rule-bound connection to more than 1 million licensed U.S. lawyers from official state licensing records. Consent is bound to the exact words, every status means one thing, and the core listing rules are proven in Lean 4 and re-checked on every change.

Protocol
Model Context Protocol, streamable HTTP
Registry
com.esqcopilot/matching-engine
Published tools
26, including older names kept for compatibility
Intake standard
OLIP 1.0, open, works with MCP
Formal proofs
44 theorems, Lean 4, kernel-checked in CI
Differential check
1,500 production cases compared to the proven model

01 · Architecture

Five Layers, Six Guarantees That Cross All of Them

People work where they already are: inside ChatGPT, Claude, other MCP apps, our website or a firm’s own AI. Instructions shape how the AI behaves, open protocols carry each request, the ESQ Matching Engine applies the rules, and the data layer keeps every fact tied to its source. The guarantees on the right hold at every layer.

Five layers: where people work, instructions, protocols, the ESQ Matching Engine, and data and assurance. Six guarantees apply across every layer.1 WHERE PEOPLE WORKChatGPTClaudeOther MCP appsesqcopilot.comLawyer DirectoryFirm's own AI2 INSTRUCTIONSSkillsServer instructionsTool descriptionsListing-service rules3 PROTOCOLSMCP, streamable HTTPREST API, OpenAPIOLIP 1.0 bindingsServer card, llms.txt4 ESQ Matching EnginePlain-language readerEligibility gateFilters, person's sortEvidence labelsPreview, yes, send onceStatus ledger5 DATA AND ASSURANCEOfficial license recordsLawyer facts, labeledPostgreSQLLean 4 proofs in CIACROSS EVERY LAYERThe personpicksNo paid orderExact-wordsyesSource anddateUnknown staysunknownEvery steprecordedFive layers: where people work, instructions, protocols, the ESQ Matching Engine, and data and assurance. Six guarantees apply across every layer.1 WHERE PEOPLE WORKChatGPTClaudeOther MCP appsesqcopilot.comLawyer DirectoryFirm's own AI2 INSTRUCTIONSSkillsServer instructionsTool descriptionsListing-service rules3 PROTOCOLSMCP, streamable HTTPREST API, OpenAPIOLIP 1.0 bindingsServer card, llms.txt4 ESQ Matching EnginePlain-language readerEligibility gateFilters, person's sortEvidence labelsPreview, yes, send onceStatus ledger5 DATA AND ASSURANCEOfficial license recordsLawyer facts, labeledPostgreSQLLean 4 proofs in CIACROSS EVERY LAYERThe person picksNo paid orderExact-words yesSource and dateUnknown stays unknownEvery step recorded
Figure 1. System architecture. The engine is one implementation shared by the REST API and the MCP server, so every surface answers the same way.

02 · Request Lifecycle

From a Plain Question to One Approved Message

A full journey takes sixteen steps between five parties. The AI app does the talking; the engine does the deciding about what is eligible and what may be sent. The step in red is the only one that unlocks sending, and only the person can take it.

Sequence of a search and an approved message between the person, the AI app, the ESQ Matching Engine, the listing data and the lawyer the person picked.The personAI app + skillESQ Matching EngineListing dataLawyer picked1Describes the problem in plain words2get_search_filters3Missing: state, type of matter4Confirms the filters5search_attorneys (filters + sort)6Eligible, licensed lawyers only7Facts with source and date8Listings in the person's order, labeled9Picks a lawyer, writes a message10preview_client_message11Exact text, recipient, shared details12Shows the preview13Says yes to that exact version14send_client_message15One message, sent once16Status: sent only after it went out
  1. The person to AI app + skillDescribes the problem in plain words
  2. AI app + skill to ESQ Matching Engineget_search_filters
  3. ESQ Matching Engine to AI app + skillMissing: state, type of matter
  4. AI app + skill to The personConfirms the filters
  5. AI app + skill to ESQ Matching Enginesearch_attorneys (filters + sort)
  6. ESQ Matching Engine to Listing dataEligible, licensed lawyers only
  7. Listing data to ESQ Matching EngineFacts with source and date
  8. ESQ Matching Engine to AI app + skillListings in the person's order, labeled
  9. The person to AI app + skillPicks a lawyer, writes a message
  10. AI app + skill to ESQ Matching Enginepreview_client_message
  11. ESQ Matching Engine to AI app + skillExact text, recipient, shared details
  12. AI app + skill to The personShows the preview
  13. The person to AI app + skillSays yes to that exact version
  14. AI app + skill to ESQ Matching Enginesend_client_message
  15. ESQ Matching Engine to Lawyer pickedOne message, sent once
  16. ESQ Matching Engine to AI app + skillStatus: sent only after it went out
Figure 2. Sequence of a search and an approved message. Tool names are the MCP calls the AI app makes.

03 · Inside the Engine

A Deterministic Pipeline, Not a Black Box

Each search runs through the same fixed stages. The reader that turns plain words into filters uses fixed word rules, with no AI model and no per-request cost, so the same words always give the same reading.

  1. Plain-language readerEvery field is marked STATED in the person’s words or DEDUCED from them. Deductions go back to the person to confirm.
  2. Eligibility gateOnly an active license in the matter’s state qualifies. Lawyers whose employer is a court, government agency or the military are left out by default.
  3. FiltersPractice area, place, language and the lawyer’s own stated limits, such as sides they do not represent.
  4. Person’s sortThe person picks the order. Ties keep a fixed shuffle seeded by the lawyer and the filters, so no one gets a standing advantage.
  5. Evidence labelsEvery fact carries its basis, source and date, plus a confidence level with the share of facts that are known.

The six orders a person can pick

Nearest officeLast nameYears licensedFree consultation firstPublished fees firstAvailability reported first

Every answer states the order it uses and that the order is not a judgment that any lawyer is better. Fees and availability older than a freshness window drop back to unknown instead of being shown as current.

04 · Evidence Model

Evidence Is Labeled, Never Upgraded

Every fact the engine returns says where it came from. A copied record is never presented as a fresh check, and a lawyer’s own description is never presented as official.

BasisMeaning
OfficialCopied from the state licensing authority named on the profile, with its load date.
Self-reportedStated by the lawyer, for example practice areas the lawyer edited.
Lawyer-providedSupplied by the lawyer’s firm, such as fees or intake limits.
Person-providedWhat the person said about the matter.
EstimatedA published range, labeled as an estimate.
UnknownNot on file. Shown as unknown, never guessed.

Simplified, fictional example of how one listing is labeled

// fictional lawyer, fictional data
{
  "name": "Jordan Example",
  "license": {
    "status": "active",
    "basis": "official",
    "source": "State licensing authority",
    "last_official_check": "unknown"
  },
  "practice_areas": {
    "value": ["Landlord-tenant"],
    "basis": "self_reported"
  },
  "fees": { "basis": "unknown" },
  "data_confidence": {
    "level": "medium",
    "evidence_coverage_percent": 60
  }
}

05 · Skills

Packaged Know-How That Keeps the AI on the Rules

MCP gives an AI app tools. Skills tell it how to use them. A skill is a short package of instructions that the AI app loads only when a question needs it, so the rules arrive exactly when they matter. Our skills ship inside the ESQ CoPilot apps for ChatGPT and Claude.

Trigger

When to load

A one-line description the AI app reads to decide whether this skill fits the question.

Procedure

Steps in order

Confirm filters, search, show every listing in the person’s order, then offer next steps.

Tool map

Which call, when

Names the MCP tool for each step, so the app never improvises a send.

Guardrails

What never happens

Never pick or rank a lawyer, never say sent before it was, one send per yes.

Data rules

What to ask for

No government ID numbers, card numbers or health details in a message.

Examples

Worked cases

Short sample conversations that show the expected behavior.

Skills in the ESQ CoPilot apps

Find a lawyerMessage a listed lawyerWork in my law officeAI Practice Risk Check (Claude)

07 · Status Machine

Each Status Means One Thing, and Only the Right Party Can Set It

OLIP defines fifteen states and every allowed move between them. A move is accepted only from the party named for it, carrying the required evidence. An AI app can never mark a message delivered, and an automatic reply never counts as a person reading it.

OLIP status machine: draft, approved, recorded, queued, then sent, delivered, acknowledged, responded, consultation requested, consultation confirmed, completed; end states cancelled, expired, failed, declined. Each state can be entered only by a named actor.NOTHING HAS LEFT THE HOSTHAS LEFT THE HOSTdraftapprovedrecordedqueuedsentdeliveredacknowledgedrespondedconsultation_requestedconsultation_confirmedcompletedEND STATEScancelledPerson or app withdraws, fromdraft through sentexpiredApproval or hold window endedfailedDelivery attempts used updeclinedRecipient will not take thematterMoved by: The personMoved by: Host systemMoved by: Email or delivery channelMoved by: Firm's intake system, signed receiptMoved by: A person at the firmMoved by: AI app
  1. draftAI app
  2. approvedThe person
  3. recordedHost system
  4. queuedHost system
  5. sentEmail or delivery channel
  6. deliveredFirm's intake system, signed receipt
  7. acknowledgedA person at the firm
  8. respondedA person at the firm
  9. consultation_requestedA person at the firm
  10. consultation_confirmedA person at the firm
  11. completedA person at the firm
  12. cancelledPerson or app withdraws, from draft through sent
  13. expiredApproval or hold window ended
  14. failedDelivery attempts used up
  15. declinedRecipient will not take the matter
Figure 3. The OLIP status machine, main path. The specification also lists direct moves, for example a firm system confirming delivery straight from queued. Any move not listed is refused.

08 · Formal Verification

The Core Rules Are Proven, Not Just Tested

We wrote the listing rules as mathematics in Lean 4, a proof assistant used for machine-checked mathematics, and proved them. Then we run the real production code on the same cases as the proven model and require identical answers. This runs on every proposed change and daily.

44theorems, kernel-checked, no unfinished proofs allowed
1,500cases where production and the model must agree, with 0 mismatches
4deliberate rule breaks the checks must catch, every run
3databases with different ad data must give identical lists and order
  1. Written rulesPlain policy: who is eligible, how labels work, what may never affect order.
  2. Lean 4 modelThe rules as definitions a computer can check.
  3. ProofsTheorems about the model, checked by the Lean kernel. An audit rejects shortcuts.
  4. Production runThe real engine answers the same 1,500 cases.
  5. CompareAny difference fails the build.
What is provenPlain meaning
Ads never change the orderChanging any advertising or billing data, for any lawyer, never changes the listing or its order.
The rule has teethA version that adds a payment to the score provably breaks that rule, so the rule is not empty.
Only eligible lawyers returnEvery lawyer returned has an active license in the person’s state. Inactive, suspended, pending and unknown statuses never qualify, and a license in another state never counts.
Dates are never inventedThe last official check date is only ever the recorded date, never today and never a copy date.
Labels stay honestPractice areas are never labeled official, lawyer-edited ones stay self-reported, and a missing practice area always means low confidence.
Consent modelNo receipt means no disclosure; wrong recipient, extra fields, expired, forged, withdrawn or reused receipts are denied; at most one delivery.

Proofs cover the model of the rules; the 1,500-case comparison ties the model to production. The consent model is proven ahead of the receipt-based sending it describes.

09 · Threat Model

Built Against the Ways AI Systems Fail

OLIP ships with a published threat model. These are the risks that matter most when an AI app sits between a person and a lawyer, and the control for each.

RiskControl
An AI app approves for the personApproval only on the host’s own page with a code sent to the person; the MCP adapter has no approve tool.
Silent edit after approvalThe consent fingerprint covers the text, recipient, fields, purpose and notices, and is recomputed at submit.
Replay or duplicate sendsRequired idempotency key and single-use approval.
Fake “the lawyer confirmed”Recipient events only from authenticated firm credentials; receipts and events signed with Ed25519.
Prompt injection in case textCase text is marked untrusted user data and never executed; state changes only through typed operations.
Overstated verificationFixed evidence levels and display wording; a copied record must say it was not checked.
Case data in logsLogs keep the route and status only; analytics keep coarse codes, never case facts.

10 · For Law Firms

EsqHarness: The Firm’s Side of the Same System

EsqHarness connects a firm’s own Claude or ChatGPT to ESQ CoPilot. New client messages arrive as clean OLIP files, and the firm’s AI gets work tools whose output always stops at a lawyer’s approval.

  1. Client messageApproved by the person, with a receipt for each step.
  2. OLIP fileSummary and draft timeline, unclear dates flagged for the lawyer.
  3. Today pageEvery open matter in one list; documents become dated timelines linked to their source lines.
  4. DraftsClient email, cited chronology, missing-documents list, research questions.
  5. Lawyer approvesNothing reaches a client until a lawyer approves the exact words.

Citation check

Every cited case is looked up before filing

Citations the AI writes are checked against CourtListener, a public case-law database. Anything not found is clearly marked not verified for the lawyer to review.

Boundaries

Prepared for attorney review

Everything is a draft for the lawyer. ESQ CoPilot never calculates court or filing deadlines, and every listed lawyer is reachable the same way, with or without EsqHarness.

$149 per lawyer per month after 14 days.

11 · Stack

Technical Specification

ServerTypeScript on Node.js, built on the official MCP TypeScript SDK; PostgreSQL database.
InterfacesMCP over streamable HTTP at match.esqcopilot.com/mcp, no sign-in; REST API described in OpenAPI; both share one implementation.
DiscoveryOfficial MCP Registry entry com.esqcopilot/matching-engine; server card at /.well-known/mcp.json; llms.txt guides for AI agents.
AI appsESQ CoPilot app in ChatGPT with skills; custom connector in Claude; any app that supports remote MCP servers.
DataOfficial state licensing records as copied by the ESQ CoPilot Lawyer Directory, with load dates per state; lawyer-provided facts kept separate and labeled.
Intake standardOLIP 1.0: JSON Schemas, OpenAPI 3.1 binding, MCP and A2A bindings, Ed25519 receipts over canonical JSON, a conformance suite.
AssuranceLean 4 proofs with an axiom audit, differential testing against production, negative controls, and a copy check that blocks wording a listing service may not use.
Also on MCPThe AI Practice Risk Score runs as its own MCP server and as a Claude plugin, so lawyers can take it inside their AI app.

Notice. ESQ CoPilot is a listing service, not a lawyer referral service, and it does not give legal advice. OLIP 1.0 was published on November 10, 2026 by its initial sponsor, Digital Crossings Inc, and is open to independent contributors. ChatGPT, Claude, Lean and CourtListener are names of their owners; their mention does not mean endorsement.