Skip to main content
Glama
LazyVerilog MCP

LazyVerilog MCP

Official
by lazyverilog

 

🎬 Demo

Run AutoInst on the child instance at line 4 of top.sv.

 module top (
     input logic clk
 );
-  child u_child ();
+  child u_child(
+    .clk(clk),
+    .din(din),
+    .dout(dout)
+  );
 endmodule

What is child on line 4 of top.sv?

module child
  input   logic        clk
  input   logic [7:0]  din
  output  logic [7:0]  dout

Show 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

lint

Parse, lint, and semantic diagnostics for one file

lint_all

Diagnostics for every file in the project filelists

format_file

Format a whole file or a line range with your lazyverilog.toml rules

goto_definition

Declaration of a module, instance, port, signal, or macro

find_references

Every reference across the project

hover

Type and declaration details

rename_symbol

Project-wide rename

document_symbols

File outline with line numbers

workspace_symbols

Find modules, interfaces, packages, and classes by name

rtl_tree

Instance hierarchy below (or above) a module

code_actions

List AutoInst / AutoArg / AutoFunc / AutoFF / AutoWire / ... at a line

apply_code_action

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 sources

All 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-mcp

On native Windows (not WSL), wrap npx with cmd /c:

claude mcp add lazyverilog --scope user -- cmd /c npx -y lazyverilog-mcp

Check 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.sv with lazyverilog."

  • "Where is u_fifo on line 42 of rtl/top.sv defined?"

  • "Run AutoInst on the instance at line 30 of rtl/top.sv."

 

⚙️ Configuration

Variable

Default

Meaning

LAZYVERILOG_LSP

latest release, downloaded and cached

LSP binary; set it to pin a version

LAZYVERILOG_ROOT

current directory

Workspace root; relative file paths resolve against it

LAZYVERILOG_INDEX_TIMEOUT

30

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 set LAZYVERILOG_LSP to its path.

  • lazyverilog-lsp exited: run lazyverilog-lsp --version in a terminal to see why it does not start. A MinGW-built binary on Windows needs the MinGW runtime DLLs (libstdc++-6.dll, ...) on PATH.

  • No cross-file results: check that lazyverilog.toml is 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 typecheck

To 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-tags

The Release workflow publishes the tag to npm through trusted publishing and creates the GitHub release.

📄 License

MIT

Available Tools

12 tools
apply_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

    A3.7/5.0

    Scored across 12 tools

    Disambiguation5/5

    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.

    Naming Consistency4/5

    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.

    Tool Count5/5

    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.

    Completeness4/5

    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

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Provides AI agents with compiler-backed, read-only context for Verilog and SystemVerilog projects using pyslang.
      23
      Apache 2.0
    • A
      license
      A
      quality
      B
      maintenance
      Enables 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.
      4
      21 npm
      Apache 2.0
    • A
      license
      A
      quality
      B
      maintenance
      Enables 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.
      4
      17 npm
      Apache 2.0
    • A
      license
      A
      quality
      B
      maintenance
      Enables 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.
      4
      17 npm
      1
      Apache 2.0