Register the MCP server (Claude Code, VS Code)
Adds drag-lint serve to Claude Code and VS Code MCP config: merged, backed up, idempotent, removable.
Run drag-lint mcp-config --all (try --dry-run first) once after installing, so Claude Code and VS Code can start drag-lint's MCP server. Pass --db to pin one index per entry (--name); --remove takes only its own entry out again.
How to run it
drag-lint mcp-config (--claude-code | --vscode | --all) [--remove] [--dry-run] [--name <n>] [--db <index>] [--engine <exe>] [--config-path <file>] [--json]
Example:
--all --dry-run
Full flag list: mcp-config in the CLI reference.
Flags
| Flag | Argument | Meaning | Default |
|---|---|---|---|
--claude-code | |||
--vscode | |||
--all | |||
--remove | |||
--dry-run | |||
--name | <n> | ||
--db | <index> | ||
--engine | <exe> | ||
--config-path | <file> | ||
--json | |||
--home-dir | |||
--appdata-dir |
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).