Ashfords Law Firm MCP Server
Click on "Install 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., "@Ashfords Law Firm MCP ServerCheck conflicts for new client John Doe in 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.
Ashfords & Kane Law Firm — Intelligent Case Intake & Assignment System
A secure, audited intake workflow for legal case intake and assignment, built around a Model Context Protocol (MCP) server. The server exposes a small set of guarded tools so an AI assistant can help intake staff without gaining direct, unrestricted access to sensitive firm data.
Table of Contents
Related MCP server: Security Guard MCP
Overview
This repository contains:
A Python-based MCP server (core logic, tools, memory & retrieval subsystems).
A LangGraph-driven Conflict Clearance workflow with human-in-the-loop partner sign-off, crash-safe checkpointing, and a ticketing path for external service failures.
A context-evaluation harness to compare and benchmark context strategies and RAG configurations.
A small Next.js demo UI (
lawfirm-ui) for interactive experiments.DB schema and seed scripts to reproduce demo datasets.
Quick Start
Prerequisites
Python 3.10+
pip
Node.js (optional — only for the demo UI)
Setup
Windows (PowerShell):
python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -r requirements.txtmacOS / Linux:
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtInitialize the demo database (optional)
python db/init_db.pyRun the MCP server
python -m mcp_server.serverRun the context evaluation (produces CSV results)
python -m context_eval.run_evalRun the demo UI (optional)
cd lawfirm-ui
npm install
npm run dev
# open http://localhost:3000Run tests
pytestArchitecture
The system is built from a few distinct layers:
MCP tool layer — a small, audited interface of read-only and guarded write tools (see MCP Tools). Tools that need information not yet provided use MCP's elicitation mechanism to ask for it interactively, rather than failing outright.
Conflict Clearance graph — a LangGraph state machine that runs every new case through search, risk evaluation, policy retrieval, and partner sign-off before it's cleared or rejected. See Conflict Clearance Workflow for details.
Memory pipeline — short-term buffers routed through decision logging into consolidated semantic and history stores.
Retrieval layer — multiple interchangeable strategies (Naive, Hybrid, Agentic, Graph) for pulling relevant context.
Conversation flow (conceptual):
User / agent turn → RollingBuffer (short-term)
│
▼
MemoryRouter → (forget | episodic_store.json)
│ (decisions logged)
▼
MemoryConsolidator → semantic_store.json + history_store.jsonRetrieval flow (conceptual):
Agent query → Retrieval strategy (Naive | Hybrid | Agentic | Graph)
→ VectorStore / BM25 / Graph → returned chunks → summarizer/decisionMCP Tools
All tools live in mcp_server/tools.py and are registered against the single shared mcp instance in mcp_server/mcp_instance.py.
Tool | Purpose |
| Confirms the DB connection is live and returns row counts per table. |
| Looks up a client by |
| Looks up full case detail, joined with client name and case type. |
| Looks up a lawyer's profile and caseload. |
| Returns conflict-check results for a case. |
| Accepts a case; unlocks |
| Rejects a case with a recorded reason. |
| Assigns an accepted case to a lawyer, enforcing status and caseload limits. |
Several tools (accept_case, reject_case, assign_case_to_lawyer) use an elicitation pattern via require_fields(ctx, ...): if a required argument is missing, the tool prompts the calling agent/UI for it through ctx.elicit(...) instead of erroring out.
Conflict Clearance Workflow
The core case-review process is a LangGraph graph (state_graph/conflict_clearance/graph.py):
intake → decompose_conflict_check → search → evaluate → retrieve_policy → draft_memo → partner_signoff → cleared / rejectedHuman-in-the-loop sign-off: when
evaluateproduces a risk score above threshold,partner_signoffraises a LangGraphinterrupt(), pausing the run until a partner records anapprove/rejectdecision.Crash safety: every step is checkpointed to SQLite via a custom
DBCheckpointSaver. If the process dies mid-run, restarting and resuming with the samethread_idcontinues exactly where it left off — no re-run of completed steps.External service failures: the
searchnode calls an external conflict-search service. A timeout or malformed response is not treated as a HITL decision — it's caught, logged as an open row in theticketstable (with the last-good checkpoint ID attached), and the run halts. Resolving the ticket viaresume_from_ticket()resumes the graph from that checkpoint, re-enteringsearchrather than restarting fromintake.
Configuration & Environment
Common environment variables used by the project (no secrets in source):
DATABASE_URL— path or connection string for the DB (e.g.sqlite:///./db/lawfirm.db).ENV— runtime environment (development,testing,production).LOG_LEVEL—DEBUG,INFO,WARN,ERROR.NEXT_PUBLIC_API_URL— URL the demo UI uses for API calls when running locally.
If additional environment variables are required by a specific integration, they're documented near the integration code (search for os.environ usages).
Tests & Benchmarks
Full suite:
pytestCheckpointer + Conflict Clearance graph:
pytest tests/test_checkpointer.py tests/test_conflict_clearance.py -vMCP elicitation flow (accept/reject/assign, interactive):
python tests/mcp_server_elicitation_test.pyMCP tool registration smoke test:
python smoke_test.pyMemory routing tests:
pytest mcp_server/memory/tests/test_router.pyConsolidation tests:
pytest mcp_server/memory/tests/test_consolidation.pyContext evaluation:
python -m context_eval.run_eval→ results incontext_eval/results/
Troubleshooting & Common Pitfalls
Missing DB: run
python db/init_db.pyand inspectdb/schema.sql.Router appears not to write: this is by design — router decisions are logged, and consolidation is responsible for promotions.
Retrieval problems when
hnswlibis missing:VectorStorefalls back to a NumPy-based exact search. Installhnswlibif you need large-vector performance.Smoke test reports 0/N tools registered: check
mcp_server/tools.pyfor a straymcp = FastMCP(...)re-assignment after thefrom .mcp_instance import mcpimport — this silently creates a second, orphaned MCP instance that decorators register against instead of the shared one.A tool call fails with a signature error it shouldn't have (e.g. unexpected keyword argument, or "multiple values for argument"): search for a duplicate
defof that tool name elsewhere intools.py. Python silently keeps the last definition in the file, so an old placeholder further down can shadow — and un-register — the real, decorated implementation above it.
Important Files
Contributing
Keep changes small and focused. Add tests, and update the context evaluation if behavior changes affect context strategies or retrieval.
Preserve audit logs when changing routing or consolidation behavior.
Before adding a new tool or graph node, check for existing definitions of the same name — see Common Pitfalls.
License & Contact
This repository uses the MIT license (see LICENSE). For questions about the project or design decisions, open an issue or contact the maintainers listed in the repository metadata.
This README targets developers running, modifying, and extending the MCP server. If a shorter, non-technical README for stakeholders, or a longer step-by-step guide with API call examples, would be more useful, say which audience and which sections to expand.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Law firm management MCP: manage cases, clients, tasks, calendar and documents via Claude AI.
Connect AI to millions of laws and court cases with the Lawstronaut MCP.
AI legal compliance: contract review, risk scoring, EU/CN AI act, watermark check. 8 MCP tools.
Dispatch litigation work to legal-services vendors from any MCP-compatible AI workflow.
Related MCP Servers
- AlicenseCqualityDmaintenanceEnables secure, zero-trust access to MCP tools through short-lived, signed capability leases that bind tool execution to specific sessions, intents, and constraints. Prevents prompt injection attacks and privilege escalation with dynamic risk scoring, policy enforcement, and tamper-evident audit logging.41MIT
- FlicenseNot gradedqualityBmaintenanceEnables secure interaction between LLMs and MCP tools by applying zero-trust security controls, including sensitive data masking, file system protection, and policy enforcement.
- FlicenseAqualityBmaintenanceEnables LLMs to ingest and analyze legal agreements, compute risk scores, and monitor non-compliant clauses through MCP tools like ingest, fetch_contracts, and run_analysis.4
- AlicenseNot gradedqualityBmaintenanceA local-first MCP server that connects to legal case-management systems like ActaPort, letting AI agents read and prepare work for lawyer approval by replaying saved browser sessions.AGPL 3.0
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/youssefelgamel/LawFirm_MCPServer_Extended'
If you have feedback or need assistance with the MCP directory API, please join our Discord server