
Questlaw Library
io.github.QuestLawv0.5.1更新于 Oct 9, 2026
Access your QuestLaw library in GenAI Tools.
概览
一个只读的本地 MCP 服务器,让 AI 客户端从 .qlvault 导出文件中搜索和阅读解密后的 QuestLaw 研究库。
- 功能
- 它在你的机器上于内存中解密 QuestLaw 库导出文件,建立搜索索引,并通过 stdio 响应工具调用。工具包括 library_overview、list_cases、search_library、search_cases、get_case、search_quotes、list_project_cases、get_source_text、find_citation_mentions 和 reload_snapshot。搜索基于关键词而非语义,结果中会包含抓取的判决书文本以及你自己的笔记。
- 适用场景
- 当你希望 AI 客户端搜索和阅读已保存的 QuestLaw 判例、引文、项目和抓取的来源文本时使用。它读取的是导出时的快照,因此新添加的研究内容在再次导出前不可见。
- 运行要求
- 需要 Node.js 20 或更高版本、来自 QuestLaw 扩展的 .qlvault 导出文件、存放在操作系统密钥库中的 43 位账户密钥,以及支持 stdio 的 MCP 客户端。必须将 QUESTLAW_DISCLOSURE_ACK 设为 i-understand。QUESTLAW_VAULT_FILE 和 QUESTLAW_KEY_ACCOUNT 为可选。ChatGPT 需要 Secure MCP Tunnel。
安装
在 SourceWeft 中
- 打开 控制台中的 Questlaw Library,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
QuestLaw Library MCP
[CI] [License: GPL-3.0-or-later] [Node] [Dependencies]
Overview
A read-only MCP server that lets an AI client search and read your QuestLaw research library.
Project status
QuestLaw MCP is an experimental, open-source project for connecting your QuestLaw library to AI tools.
The server decrypts your library on your own machine, from a .qlvault export generated via the extension. It is read-only and makes no network connections.
Disclaimer
This project is not part of the official, supported QuestLaw product suite.
Using it decrypts your library on your computer and gives the readable contents to the AI client you connect it to. That client sends what it reads to its provider. The server itself sends nothing anywhere, but it cannot control what the client or the provider does with what it receives. Please use it with that in mind, and read SECURITY.md before you connect a library that holds sensitive information.
How it works
- In QuestLaw, use the Export tool to create an encrypted file of your library (
questlaw-backup-<date>.qlvault). - The server looks for the newest export file in the folder you choose.
- It decrypts the file in memory with your account key. Your library is never written to disk unencrypted.
- It builds a search index and answers tool calls.
Quick start
setup shows the disclosure and asks you to accept it, stores your account key in
the OS secret store, finds your newest export, test-decrypts it, and prints the
configuration for your client. To check an install later:
From a clone, run the same commands as node bin/questlaw-library-mcp.js setup and
node bin/questlaw-library-mcp.js doctor. Once doctor passes, choose an install
method below.
Set up and install
Requirements
- Node.js 20 or newer. Version 24 or newer is preferred.
- A QuestLaw library export. See Getting your library out of QuestLaw.
- Your 43-character account key. See Your account key.
- An MCP client. For example, Claude Desktop, Claude Code, Codex, or any client that supports MCP over stdio. ChatGPT requires a Secure MCP Tunnel.
Getting your library out of QuestLaw
In the extension, choose export a backup. An encrypted library produces a file
named questlaw-backup-<date>.qlvault. If you turn on daily backup in the
extension's settings, the extension writes a new file each day, so the AI client
sees recent research without any work from you.
By default, the server reads the newest .qlvault in ~/Downloads. To change that,
set QUESTLAW_VAULT_FILE to a specific file or to a different folder.
The server reads a copy of your library from the time of the export, not your live library. If you add research after the export, the model can't see it until you export again.
Word add-in users: this server reads only the
.qlvaultexport. It has no access to your Word documents, and using it with Microsoft Copilot does not change that.
Your account key
An export's vault key is wrapped with your 43-character account key, so the server needs that key to open an export. Get it from the extension, under Settings, Encrypted library, Show account key, and then store it:
Where the key is kept
On macOS and Linux, the key is passed to the store on stdin. On Windows, it is passed through the child process environment. It never appears in a command line.
The account key opens every export of your library, so treat it like a
password. You can supply it through QUESTLAW_RECOVERY_CODE instead, but the
server ignores that variable unless you also set QUESTLAW_ALLOW_ENV_KEY=1.
Install
Claude Code plugin
The plugin includes the server and a skill that explains to the model how search
works. Download questlaw-mcp-claude-plugin-<version>.zip from
Releases, or build it
with npm run plugin.
Upload the ZIP through Claude's Plugins, Upload plugin control (under Customize or Settings, depending on the client). The same ZIP works for Claude Desktop plugin uploads, Cowork, and Claude Code. The local MCP server runs in Cowork and Claude Code, and plugin skills also work in chat. See Anthropic's plugin guide.
The plugin takes no configuration. It reads the newest .qlvault in ~/Downloads,
the key from the default account in the secret store, and the consent that
setup recorded. Run setup before you upload it.
To replace an installed copy, uninstall it before you upload the new archive:
Claude Desktop
- Plugin upload: use
questlaw-mcp-claude-plugin-<version>.zip, as described above. - Desktop extension: use
questlaw-mcp-claude-desktop-<version>.mcpbfrom Releases, or build it withnpm run bundle. Install it through Desktop's extension installer, and typei-understandin the required disclosure field.
Either way, store your key first with setup.
Claude Code without the plugin
Codex
Or add it to ~/.codex/config.toml directly:
Codex saves env values in config.toml as plain text. Put your export path there
if you like, but keep the account key in the OS secret store. The
QUESTLAW_ALLOW_ENV_KEY setting exists to stop the key from ending up in a file
like this one.
The ChatGPT desktop app includes the Codex engine and reads the same
~/.codex/config.toml. If you add the server through Codex, it works in the Codex
part of the desktop app, but not in ordinary ChatGPT chats. For those, see the next
section.
ChatGPT
ChatGPT can't start a local server itself. Instead, it connects through OpenAI's Secure MCP Tunnel, a connection that only goes outbound from your machine. You need developer mode in ChatGPT and access to the OpenAI developer platform.
One-time setup:
- On platform.openai.com, create a tunnel (its ID starts with
tunnel_) and a runtime API key. - Install tunnel-client,
either from that page or with
brew install tunnel-client. - Create a profile. Replace the tunnel ID and both paths with your own:
- In ChatGPT, turn on Settings, Security and Login, Developer mode.
- In ChatGPT on the web, create a developer mode app, choose Tunnel as the connection, and pick the tunnel you created. At the time of writing, this option is available on the web but not in the desktop app.
Each time you want to use it, start the tunnel and leave it running:
The tunnel client starts the MCP server for you. To check that both are running:
Any other stdio MCP client
Add an env block only to change a default:
The version is pinned so an install runs exactly the release you checked. To upgrade, change the version in your client configuration.
Default file locations:
The setup command prints the exact configuration for your machine.
Checking an install
Using the server
Available tools
An asterisk marks a required argument. The types argument accepts any of case,
quote, and source. The tag filter matches a whole tag, ignoring case, and the
court filter matches any part of a court name.
A typical session starts with library_overview, which describes the library. Then
the model calls search_library to find something, and get_case or
get_source_text to read it in full. To list the library instead of searching it,
the model can call list_cases with no arguments, and it pages through every
authority, including the ones filed under no project.
Search has a few limits that affect how you phrase a query:
- Search matches words, not meaning, so a query needs the words the user would have written.
- Court names are a filter argument, not search text. Almost every court name contains "United States", "Court", or "District", so searching those words would match almost everything.
- There are no wildcards. A query with no real words lists the library and says so, instead of reporting that nothing matched.
Tool results contain text you did not write, such as captured opinions, alongside your own notes. Treat that text as material to read, not instructions to follow. SECURITY.md explains why.
Configuration
All configuration is through environment variables, and a default install needs none of them.
Command line
The setup command accepts --yes to accept the defaults without asking, and
--key to replace a stored key. The verify command accepts --json.
Troubleshooting
Start by running doctor. The table below lists the error codes the server returns.
In a desktop client, give an absolute path to node if you run the server from a
clone. Claude Desktop and the ChatGPT desktop app start servers without loading
your shell profile, so a bare node from a version manager is not found. The
secret store commands are called by absolute path on macOS (/usr/bin/security)
and Windows (powershell.exe under %SystemRoot%). On Linux, secret-tool must be
on the default PATH.
Development and release
The server has no runtime dependencies and no build step. npm install adds
eslint, which only npm run lint uses.
CONTRIBUTING.md covers the workflow for a change.
REFERENCE.md describes the export format, the decryption steps, the
record schema, the vendored modules, the project layout, and the rules the tests
enforce. Read it before you change anything under src/ or vendor/.
To point a client at your clone instead of at npm:
npm run bundle packs only the files listed under files in package.json,
checks that the manifest version matches, confirms that the entry point and every
vendored module are present, and writes the .mcpb. It needs the system zip
command. On Windows, use npx @anthropic-ai/mcpb pack instead.
npm run plugin puts .claude-plugin/plugin.json, .mcp.json, and skills/ at
the ZIP root, and nests the files npm would publish under runtime/, because
Claude rejects uploaded plugins with a top-level bin/ directory.
Never put ${user_config.*} in the plugin's .mcp.json. REFERENCE.md explains why,
under "Traps".
License
GPL-3.0-or-later. See LICENSE.
The license covers the four files in vendor/questlaw/, which are copied from the
QuestLaw browser extension's source and published with this package on purpose.
来源:README.md,提交 81988d0
工具
0版本历史
1- v0.5.1最新Oct 9, 2026


