LazyVerilog MCP
OfficialLazyVerilog MCP gives AI coding agents SystemVerilog/Verilog tooling through the LazyVerilog LSP over MCP.
Lint a single file or all files in the project filelists.
Format a whole file or a line range using project
lazyverilog.tomlrules, optionally previewing a diff.Navigate code: go to definition, find references, and hover for type/declaration info.
Rename symbols project-wide, optionally previewing the diff.
List a file outline or search project-wide workspace symbols.
Show RTL module instance hierarchy, including reverse parent lookup.
List and apply RTL code actions such as AutoInst, AutoArg, AutoFunc, AutoFF, AutoWire, and default case.
Use 1-based line plus symbol text for positions, so the agent does not need to count columns.
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., "@LazyVerilog MCP Run AutoInst on the child instance at line 4 of top.sv."
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.
🎬 Demo
Run AutoInst on the
childinstance at line 4 oftop.sv.
module top (
input logic clk
);
- child u_child ();
+ child u_child(
+ .clk(clk),
+ .din(din),
+ .dout(dout)
+ );
endmoduleWhat is
childon line 4 oftop.sv?
module child
input logic clk
input logic [7:0] din
output logic [7:0] doutShow the hierarchy under
top.sv.
top (rtl/top.sv:1)
u_child: child (rtl/child.sv:1)Lint
rtl/top.sv.
rtl/top.sv:7:34: error: expected ';'
Related MCP server: mcp-verilog
📊 Tools
The tools the agent gets:
Tool | What it does |
| Parse, lint, and semantic diagnostics for one file |
| Diagnostics for every file in the project filelists |
| Format a whole file or a line range with your |
| Declaration of a module, instance, port, signal, or macro |
| Every reference across the project |
| Type and declaration details |
| Project-wide rename |
| File outline with line numbers |
| Find modules, interfaces, packages, and classes by name |
| Instance hierarchy below (or above) a module |
| List AutoInst / AutoArg / AutoFunc / AutoFF / AutoWire / ... at a line |
| Run one of them |
Positions are a 1-based line plus the symbol text on that line, so the agent never counts columns.
Editing tools write to disk. With preview: true they return a unified diff instead.
🚀 Getting Started
1. Install Node.js
Node.js 20 or newer: https://nodejs.org. Check with node --version.
2. lazyverilog-lsp (automatic)
On first use, lazyverilog-mcp downloads the
latest LazyVerilog release of
lazyverilog-lsp for your platform, checks its SHA-256, and caches it in ~/.cache/lazyverilog-mcp
(%LOCALAPPDATA%\lazyverilog-mcp on Windows). Each new session checks for a newer release, so you
always run the latest server. Offline, it uses the newest cached copy, then lazyverilog-lsp on PATH.
To use a specific binary instead (a pinned version or your own build), set LAZYVERILOG_LSP to its
full path in the agent configuration below.
To build it yourself, see Build from source.
3. Add a lazyverilog.toml to your project
The server finds project files and settings through a lazyverilog.toml at the project root:
[design]
vcode = "files.f" # filelist of your RTL sourcesAll options: https://lazyverilog.github.io
4. Register the MCP server with your agent
claude mcp add lazyverilog --scope user -- npx -y lazyverilog-mcp--scope user enables it in every project. --scope project writes a shared .mcp.json into the
current repository instead. To pass the binary path:
claude mcp add lazyverilog --scope user -e LAZYVERILOG_LSP=/path/to/lazyverilog-lsp -- npx -y lazyverilog-mcpOn native Windows (not WSL), wrap npx with cmd /c:
claude mcp add lazyverilog --scope user -- cmd /c npx -y lazyverilog-mcpCheck it with claude mcp list, or /mcp inside a session.
~/.codex/config.toml:
[mcp_servers.lazyverilog]
command = "npx"
args = ["-y", "lazyverilog-mcp"]
# env = { LAZYVERILOG_LSP = "/path/to/lazyverilog-lsp" }mcpServers JSON:
{
"mcpServers": {
"lazyverilog": {
"command": "npx",
"args": ["-y", "lazyverilog-mcp"]
}
}
}Start the agent from your project directory, or set LAZYVERILOG_ROOT.
5. Try it
"Lint
rtl/top.svwith lazyverilog.""Where is
u_fifoon line 42 ofrtl/top.svdefined?""Run AutoInst on the instance at line 30 of
rtl/top.sv."
⚙️ Configuration
Variable | Default | Meaning |
| latest release, downloaded and cached | LSP binary; set it to pin a version |
| current directory | Workspace root; relative file paths resolve against it |
|
| Seconds the first call waits for the project index |
Formatting, lint rules, and code-action behavior come from the project's lazyverilog.toml, as in the editor plugins.
Project-wide answers (references, workspace symbols, AutoInst of modules in other files) depend on the
background index. On a large project it can still be building for some seconds after the first call.
🩺 Troubleshooting
lazyverilog-lsp not found: the download failed (no access to github.com). Download the binary from the release page yourself and setLAZYVERILOG_LSPto its path.lazyverilog-lsp exited: runlazyverilog-lsp --versionin a terminal to see why it does not start. A MinGW-built binary on Windows needs the MinGW runtime DLLs (libstdc++-6.dll, ...) onPATH.No cross-file results: check that
lazyverilog.tomlis at the project root and its filelist lists the files.
🛠️ Development
git clone https://github.com/lazyverilog/lazyverilog-mcp
cd lazyverilog-mcp
npm install # also builds dist/index.js
npm test # Node >= 22.18; downloads the latest lazyverilog-lsp unless LAZYVERILOG_LSP is set
npm run typecheckTo use a local checkout, point the agent at node /path/to/lazyverilog-mcp/dist/index.js.
To release, bump the version on main and push the tag:
npm version patch # or minor / major: commits and tags vX.Y.Z
git push --follow-tagsThe Release workflow publishes the tag to npm through trusted publishing and creates the GitHub release.
📄 License
MIT
Available Tools
12 toolsapply_code_actionA
Run the code action named title (from code_actions, prefix match ok) at line of file.
Inputs: file (required), line (required), title (required), symbol, +1 more.
code_actionsA
List RTL code actions available at line of file: AutoInst (on an instantiation line), AutoArg (module header), AutoFunc, AutoFF (always_ff), AutoWire, add default case, ... Pass symbol to place the cursor on it (e.g. the module name of an instance). Run one with apply_code_action.
Inputs: file (required), line (required), symbol.
document_symbolsC
Outline of a file: modules, ports, signals, parameters, instances, functions... with line numbers.
Inputs: file (required).
find_referencesB
List every reference to symbol (on line of file) across the project.
Inputs: file (required), line (required), symbol (required), occurrence, +1 more.
format_fileB
Format a file with the project's lazyverilog.toml [format] rules. Give start_line/end_line (1-based, inclusive) to format only that range.
Inputs: file (required), preview, end_line, start_line.
goto_definitionA
Find where symbol (as written on line of file) is declared.
Inputs: file (required), line (required), symbol (required), occurrence.
hoverC
Show type/declaration info for symbol on line of file.
Inputs: file (required), line (required), symbol (required), occurrence.
lintA
Lint one SystemVerilog file: parse errors, lint rules and semantic diagnostics. Output lines are path:line:col: severity: message (1-based).
Inputs: file (required).
lint_allA
Lint every file in the project filelists (lazyverilog.toml [design]). Can be slow on big projects.
Inputs: no named parameters.
rename_symbolB
Rename symbol (on line of file) to new_name across the project.
Inputs: file (required), line (required), symbol (required), new_name (required), +2 more.
rtl_treeA
Module instance hierarchy rooted at the module in file: instance: module (path:line). reverse=true shows the parents that instantiate it instead.
Inputs: file (required), reverse.
workspace_symbolsB
Search project-wide for modules, interfaces, packages, classes, ... whose name matches query.
Inputs: query (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 12 tools
Each tool targets a distinct LSP-style operation: navigation, symbol search, hierarchy, linting, formatting, and code actions. The paired tools are clearly differentiated, such as code_actions vs apply_code_action and lint vs lint_all.
All names use lower_snake_case and are descriptive, but conventions are mixed between verb-led actions (rename_symbol, find_references) and noun-led introspection tools (workspace_symbols, document_symbols). The pattern is still readable and mostly predictable.
Twelve tools is well within the ideal range for an HDL/LSP-style server. Each tool covers a meaningful capability without obvious padding or redundancy.
The surface covers core code intelligence: symbols, navigation, references, rename, code actions, hierarchy, linting, and formatting. Minor gaps remain around completion, signature help, and advanced hierarchy/implementation queries, but core workflows are supported.
Maintenance
Related MCP Connectors
Design circuits, simulate and verify embedded firmware, and lay out PCBs with AI agents.
Run, build, and validate firmware on virtual hardware from your AI agent. Hardware knowledge corpus.
A public board where AI agents design pieces of an open AI inference accelerator on sky130. Submit Verilog and it is linted, synthesised, simulated against hidden vectors, mapped to real standard cells for area, timed for critical path and power, and proven equivalent to a reference. No key, no account, one call. The best verified design gets fabricated.
AI-native programming language and toolchain for accountable, verifiable agent-driven development.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides AI agents with compiler-backed, read-only context for Verilog and SystemVerilog projects using pyslang.23Apache 2.0
- AlicenseAqualityBmaintenanceEnables AI coding agents and IDEs to lint, compile, syntax-check, and simulate Verilog/SystemVerilog designs through structured, token-efficient MCP tools with isolated containerized toolchains.421 npmApache 2.0
- AlicenseAqualityBmaintenanceEnables AI coding agents and IDEs to synthesize Verilog/SystemVerilog designs with Yosys, inspect cell hierarchies and gate counts, and detect synthesis hazards like inferred latches and combinational loops before physical design flows.417 npmApache 2.0
- AlicenseAqualityBmaintenanceEnables AI coding agents and IDEs to perform AST-backed semantic Verilog/SystemVerilog code reviews, catching race conditions, reset polarity mismatches, and bitwidth truncations while computing a 0–100 RTL quality score.417 npm1Apache 2.0