LegalQuants MCP
Indexes public GitHub repositories and retrieves exact source excerpts from them, using repository links, commit-pinned snapshots, and optional GitHub API access to support search and citation of LegalQuants community builds.
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., "@LegalQuants MCP Search LegalQuants for clause bank builds and cite the Manus clause schema source"
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.
LegalQuants MCP
A working local MCP pilot for finding LegalQuants community builds and retrieving specific source excerpts to help adapt them. Unofficial prototype; not affiliated with or endorsed by LegalQuants. No community application code is executed.
Quick start
Requires Node.js 22+ and npm. No AI provider key is required.
npm ci
npm run build
npm testThe checked-in catalog has 310 of 310 public builds, synced on September 12, 2026; 140 have GitHub repository links. Search works immediately. Source retrieval requires indexing; source snapshots are local and excluded from Git.
Index a real example (Manus Clause Bank):
npm run index -- 43eff50f-cbd8-4e38-80cf-f1f67feab8daThen start with npm start, or connect through an MCP client below. A stdio server
waits for protocol messages; it is not an interactive terminal prompt.
Related MCP server: ragbox-mcp
Connect your AI client
Merge this into a client that supports mcpServers and stdio. Replace the path
with your absolute checkout path. Use an absolute Node executable if your desktop
client does not inherit your shell's PATH.
{
"mcpServers": {
"legalquants": {
"command": "node",
"args": ["/absolute/path/to/lq/dist/src/server.js"]
}
}
}This server locates its data relative to its installation, independent of the
client's working directory. Set LQ_DATA_DIR to an absolute directory to override.
Try:
I want to build a clause bank. Search LegalQuants for relevant projects, inspect Manus Clause Bank, and retrieve its clause schema and extraction code. Cite the exact source files and tell me what is unavailable or only claimed in the listing.
Tools
Tool | Inputs | Returns |
|
| Ranked builds, matching keywords, catalog coverage |
|
| Listing, builder, source links, indexing status, indexed file inventory |
|
| Ranked source windows with revision, line numbers and GitHub citations |
|
| Exact excerpt at the requested indexed revision |
All tools are local and read-only. Network access occurs only in the explicit index command. Unknown IDs/files are errors; missing indexes are disclosed rather than invented. Source text is untrusted reference data, not agent instructions.
The server guides the AI to start with three keyword matches, inspect promising builds, and search their source only when needed. It requests additional lines only when existing excerpts are insufficient, then stops with concise cited evidence. This guidance does not require calling all four tools for every question.
Refresh data
# Import the bundled snapshot, or pass a compatible Markdown export path.
# This replaces the full catalog with the partial 30-entry export.
npm run import
npm run import -- /absolute/path/to/new-export.md
# Sync the complete public directory, validating every ID against its search index.
npm run sync
# Index selected catalog build IDs, or all entries with GitHub links.
npm run index -- 43eff50f-cbd8-4e38-80cf-f1f67feab8da
npm run index -- --allAn optional GITHUB_TOKEN environment variable increases API availability. It is
sent only to api.github.com. The current raw-file downloader supports public source;
private repository support is not implemented. Never put tokens in committed files.
Run one import/index writer at a time, with the server stopped during catalog import.
Content indexing atomically replaces the snapshot after each project; restart is
unnecessary. API failures retain any previous snapshot and record failure status.
Catalog sync reads the public page and discovers its current loadMoreWorks action
from the published browser bundle. It retrieves the same pages as “Older entries,”
decodes data without executing JavaScript, and checks exact unique-ID coverage before
atomic replacement. This is an undocumented website integration: site changes can
break it. An owner-provided feed remains preferable for long-term maintenance.
The index follows each repository's default branch and pins its commit SHA. Links to subdirectories are currently normalized to the repository; branch/subdirectory restrictions are not preserved. Text/source allowlisting excludes common generated, upload and secret paths. Per repository: at most 100 files, 100 KB per file and 2 MB total. Truncated trees, budgets and file failures produce partial status. These filters are not a secret scanner; only index sources suitable for your users.
Retrieval behavior and limits
Weighted keyword matching; no embeddings, semantic reranker or LLM calls.
Source search returns overlapping 40-line windows, not AST-resolved functions.
Search returns at most five excerpts; exact fetch returns at most 120 lines and 16,000 characters. Returned line boundaries describe the actual excerpt.
Catalog descriptions remain publisher claims. Repository licenses and README maturity statements can be retrieved, but are not automatically adjudicated.
Relative dates from the export are not converted into invented publication dates.
No remote HTTP hosting, accounts, billing, automatic sync or app execution yet.
Development
npm run check
npm run build
npm testTests cover import completeness, six representative top-three retrieval cases, source scoping, line bounds, URL normalization, and all four tools through a real stdio SDK client using an isolated source fixture. These are smoke evaluations, not evidence of broad semantic search quality. GitHub Actions runs build and tests.
src/catalog.ts handles normalization and discovery, src/content.ts handles
source excerpts, scripts/index.ts builds GitHub snapshots, and src/server.ts
exposes the MCP interface. The approved scope is recorded in docs/design.md.
Before a hosted owner pilot, replace the public-page sync with an owner-provided feed, obtain contributor source/reuse metadata, add authenticated remote transport, and evaluate retrieval with real lawyer tasks.
Catalog attribution: LegalQuants Community Builds. Original project authors and source links are preserved in every catalog record.
Available Tools
4 toolsfetch_contentARead-onlyIdempotent
Read a specific indexed file range. Use path and revision from get_build or search_build_content. Lines are 1-based and inclusive; request only what is needed, up to 120 lines / 16,000 characters. A changed revision requires a fresh lookup.
Inputs: path (required), build_id (required), end_line (required), revision (required), +1 more.
get_buildARead-onlyIdempotent
Inspect one build: listing, builder, source links, indexing status and available file paths, revisions and line counts. Use a build ID returned by search.
Inputs: build_id (required).
search_build_contentBRead-onlyIdempotent
Find source excerpts within selected build IDs. Returns keyword-ranked line windows and commit-pinned citations. Check coverage before interpreting empty results. Reuse sufficient excerpts without fetching them again.
Inputs: query (required), build_ids (required), limit.
search_buildsARead-onlyIdempotent
Find projects by keyword. Returns build IDs, listing details, match terms and catalog coverage. Use for discovery; source contents require separate tools.
Inputs: query (required), area, limit, source_only.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool targets a clearly distinct operation: search_builds for discovery, get_build for metadata, search_build_content for keyword search within builds, and fetch_content for exact file range retrieval. The boundaries are well-defined, and descriptions explicitly clarify the differences, eliminating confusion.
All names use snake_case and follow a verb_noun pattern, which is mostly consistent. Minor deviations include plural 'builds' in search_builds versus singular 'build' in get_build, and the use of 'fetch' for content retrieval while 'get' is used for metadata.
Four tools is well within the ideal 3-15 range and each tool serves a distinct, necessary purpose in the discovery-to-retrieval workflow. There is no redundant or missing tool among them.
The surface covers discovery, metadata inspection, content search, and content retrieval, forming a complete read-only pipeline. A minor gap is the lack of a bulk listing or filter-by-owner operation, but agents can work around this using search_builds with appropriate keywords.
Maintenance
Related MCP Connectors
A cited wiki of your GitHub repo: search, read pages, find symbols and ask, with line citations.
Resolve, search and verify legal citations against the official sources, with provenance.
Code intelligence for LLMs. Analyze, search, and retrieve code from any public git repository.
Ask a codebase what calls what: search, blast radius, paths between symbols, and diffs.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceProvides read-only search and context-pack creation over a local source library, letting AI assistants retrieve relevant excerpts and audit cited quotations.20MIT
- AlicenseNot gradedqualityCmaintenanceEnables coding agents to search a locally indexed codebase with hybrid dense, lexical, and symbol-graph retrieval, returning ranked passages with exact file:line-line citations plus graph context and index status. It keeps its index in sync via a file watcher and runs as a local sidecar with no hosted service to deploy.1MIT
- AlicenseNot gradedqualityCmaintenanceEnables coding agents to search a locally indexed repository and get back a token-budgeted deck of ranked code and doc snippets instead of a full-tree grep dump, with lexical, semantic, and prose-answering modes plus index status reporting. Runs fully offline for lexical queries and optionally uses an OpenAI-compatible provider for semantic or ask modes.MIT
- AlicenseNot gradedqualityCmaintenanceEnables token-bounded, read-only hybrid code search across local repositories by fusing literal matches with AST symbol relations to return high-signal snippets, line ranges, and call metadata.1MIT