MCP server
Exposes the index to MCP clients as 15 tools.
The drag-lint MCP server lets an MCP client (an AI assistant) query the index and run checks through 15 tools.
Details
Adds drag-lint's MCP server (drag-lint serve) to Claude Code and VS Code in one command, so an AI client can query the index without hand-editing JSON. The installer runs it with --all as an optional task; the verb is drag-lint mcp-config.
Running it
drag-lint mcp-config --all --dry-run (print the change, write nothing)
drag-lint mcp-config --claude-code --db C:\Projects\MyApp\_D-RAG\MyApp.sqlite
drag-lint mcp-config --all --remove
Targets
--claude-code-- user scope, the top-levelmcpServersof~\.claude.json, by file edit (the verb never runs theclaudeCLI).--vscode--serversin%APPDATA%\Code\User\mcp.json.--all-- both; a client that is not installed is skipped. Claude Code counts as installed with a~\.claudefolder, an existingCLAUDE_CONFIG_DIRor an existing.claude.json; VS Code with%APPDATA%\Code\User.
What it writes
{ "type": "stdio", "command": "<engine>", "args": ["serve", "--db", "<index>"] } (Claude Code adds "env": {}). Without --db the args are ["serve"] and the engine picks the index from its manifest when the client starts it. serve answers from ONE index, so register one entry per index with --name. The engine defaults to the running drag-lint.exe; --engine <exe> overrides it.
Safe on a real config
--dry-runwrites nothing.- A real write backs the file up to
<file>.bak-<stamp>, merges (other servers and keys untouched) and is idempotent: a second run says "unchanged" and writes nothing. --removedeletes only its own entry; an entry by that name whose command is notdrag-lint.exeis refused, never touched.- Keys you added to the entry, an
envincluded, survive an update; everyenvandheadersVALUE prints as***(the keys stay). - Malformed JSON, or JSON with comments a rewrite would drop, is refused with nothing written (the entry to paste by hand is printed). JSON is written UTF-8 without BOM.
Related
serve -- the MCP server itself. Tests: tests\autotest\run_mcp_config_verb.ps1 (scratch copies; it asserts the real config files are unchanged).