MCP M7: the lean catalogue — nine tools, 3 440 model-visible bytes, no dry_run/paging, short answers
ci / checks (push) Successful in 1m43s
ci / corpus (push) Successful in 36s

hierarchy (file:line per instance, peek), find (every declaration by
name, refs + unresolved mentions), outline, read, check, rename, port,
edit_item, format. Name lookup reaches every declaration the symbol
tables hold (tools/declared.rs); rename of a generate-block label is
refused (engine gap filed as topo §2.9 MCP-14). Text-only results,
engine sentences made root-relative. Tests ported or deleted per the
README; QA lane in tests/qa_m7.rs. Docs, smoke gate, release notes
(0.58.0 unreleased) updated.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
This commit is contained in:
lucioandClaude Fable 5.1 committed 2026-09-24 01:40:53 -07:00
1 parent edad66947f
commit bfa8e98eb5
59 files changed
+4895 -7672

No files matched your search

+33 -41
View File
@@ -5,11 +5,13 @@ description: Give Claude Code, Cursor and VS Code's agent mode lucisv's parser,
`lucisv-mcp` is lucisv as a [Model Context Protocol](https://modelcontextprotocol.io)
server. A coding agent spawns it over stdio and asks it about the
Verilog/SystemVerilog tree instead of reading whole files: a module's ports,
a file's outline, one `always` block, who instantiates what, every reference
to a signal. It can also make the edits lucisv already knows how to make
safely — format, lint fixes, rename, the port refactorings and single-item
replacements — each one verified before anything is written.
Verilog/SystemVerilog tree instead of reading whole files: the instance
hierarchy and where each instance is written, where a name is declared and
used, a module's ports, a file's outline, one `always` block. It can also
make the edits a plain file write cannot make safely — a rename across the
design, adding or removing a port in every instantiation, a single-item
edit, formatting with the safe lint fixes — each one verified before
anything is written.
It is the same engine as the CLI and the language server (parser, index,
formatter, linter, refactorings), in a third binary that shares no state with
@@ -97,48 +99,38 @@ description. The agent sees the full description and input schema.
| tool | writes | what it answers |
|---|---|---|
| `project_overview` | | Files, units by kind, top modules, largest files. |
| `list_units` | | Units (modules, interfaces, packages, classes, programs) with file:line. |
| `unit_interface` | | A unit's parameters, ports (direction, type, range), modports or members; `template: true` adds an instantiation. |
| `outline` | | A file's declarations as a tree with line ranges, and its parse errors. |
| `read_item` | | One item's exact source and lines. |
| `search_symbols` | | Declarations whose name contains `query` (any case), members included. |
| `defines` | | The \`define table (name, parameters, body, file:line) of a `file`, a macro `name`, or all. |
| `definition` | | Where a name or macro is declared: file:line:col, kind, line. |
| `references` | | Uses of one declaration, then its unresolved mentions (strings, comments, macro text). |
| `hierarchy` | | Who instantiates a module (`up`, with file:line) or what it instantiates (`down`, default). |
| `diagnostics` | | Parse errors and lint findings (`line:col severity message [rule]`) of `file` or all. |
| `format` | yes | Format `file`/`files` as `lucisv format`; `lines` limits it. |
| `fix_lint` | yes | Apply the safe lint fixes to `file`/`files`; says what remains. |
| `rename` | yes | Rename a declaration and its uses; select as `definition`. |
| `expand_wildcard` | yes | Replace one instance's `.*` with the named connections it binds. |
| `convert_ports` | yes | Rewrite a module's non-ANSI header as an ANSI port list. |
| `organize_imports` | yes | Remove unused `import`s in the scope at a position; sort the rest. |
| `inline_module` | yes | Replace one instance with its module's body, connections substituted. |
| `propagate_ports` | yes | Connect by name every port one instance leaves unconnected. |
| `remove_port` | yes | Delete a port and its connection in every instantiation; refused while the body uses it. |
| `add_port` | yes | Add an ANSI port to a module, connected in every instantiation; `after` positions it. |
| `extract_module` | yes | Move whole items in lines `start_line`..`end_line` to a new module instantiated in their place. |
| `replace_item` | yes | Replace one item with `text`: one item, same kind and names (unless `rename`; references untouched). |
| `insert_item` | yes | Insert items `text` before or after item `anchor`, or at `end` (`end@NAME`) of the last unit (unit NAME). |
| `delete_item` | yes | Delete one item and its leading comments; refused while its names are used (sites listed) or it holds a \`define, unless `force`. |
| `instantiate` | | Instantiation text for module `name`: parameters, instance name, named or `.*` ports. |
| `hierarchy` | | The instance tree of `root` to `depth` (1-20, default 1), each at its instantiation file:line; `up`: its instantiations; `peek`: each statement's source. |
| `find` | | Every declaration of `name` or unit.name (kind name file:line; macros too); `refs: true` adds each one's uses as file:line and the unresolved mentions (strings, comments, macro text). |
| `outline` | | Exactly one of: `file`, its declarations as a tree with line ranges, parse errors first; `unit`, its file:line, parameters and ports in order (modports, package members). |
| `read` | | One item's exact source after its file:first–last line. |
| `check` | | Parse errors and lint findings of `file` or the whole design, one per line (file:line:col severity message [rule]), errors first; `ok` when clean. |
| `rename` | yes | Rename declaration `name` (or unit.name) to `new_name` with every resolved use (.name/.* written out); `file` and name@LINE pick among declarations. |
| `port` | yes | On `module`, `add` an ANSI port declaration (after port `after`, else last) connected in every instantiation, or `remove` a port and its connections (refused while used). |
| `edit_item` | yes | One item of `file` (selector as read): `op` replace it by `text` (same kind and names), insert `text` before/after it (item `end`/`end@UNIT`: a unit's end), or delete it if unused. |
| `format` | yes | Format `files` (a path, directory or glob like `rtl/**/*.sv`) as lucisv format; `fix: true` applies safe lint fixes first. |
## What it promises
- **Answers come from the disk.** Every call first re-checks the files it
indexes, so no answer is older than the disk at the moment the call
arrived. Unsaved editor buffers are invisible to it — save before asking.
- **Edits are verified, then written whole.** Every edit tool computes and
verifies every file's new text before the first write; a refusal names the
reason and touches nothing. The formatter's own safety net applies to
`format`; `replace_item`, `insert_item` and `delete_item` require the file to
still parse and change no byte outside the item.
- **`dry_run: true`** on any edit tool returns the unified diff instead of
writing.
- **Answers are short.** One line per fact, root-relative `file:line`, no
headers; a long answer is cut at a fixed cap with one `… and N more` line,
and a better question (`root`, `file`, `depth`, `unit.name`) narrows it.
A refusal is one sentence, and when a name is unknown it lists the near
matches.
- **Edits are verified, then written whole — there is no dry run.** Every
edit tool computes and verifies every file's new text before the first
write, and writes all of it or none of it; call it like a file write and
trust the answer (`check` afterwards, when you want the lint verdict). A
refusal names the reason and touches nothing. The formatter's own safety
net applies to `format` (a file it refuses is named and left as it was);
`edit_item` requires the file to still parse and changes no byte outside
the item; `rename` and `port` list the name's unresolved mentions
(strings, comments, macro text) for you to check.
- **Nothing outside the roots.** Every path a tool takes must resolve inside a
`--root`; anything else is refused.
- **The language server's cache is never written.** `--index-cache` names
the directory the extension gives `lucisv-server`; `lucisv-mcp` accepts it
today and will read that store (read-only) for a warm start in a later
release — never write it, so there are never two writers.
the directory the extension gives `lucisv-server`; `lucisv-mcp` reads that
store for a warm start and writes only its own, `index-cache-mcp`, beside
it — never two writers of one file.