Skip to main content
Glama
zesun33

mcp-verilog

by zesun33

@zesun33/mcp-verilog

Model Context Protocol (MCP) server for Verilog and SystemVerilog hardware development.

License: Apache-2.0 Protocol: MCP Runtime: Rootless Podman

mcp-verilog provides structured, token-efficient tool APIs so AI coding agents and IDEs (Cursor, Windsurf, GitHub Copilot / OpenAI Codex, Claude Code, Google Antigravity, OpenCode, Cline) can lint, syntax-check, and simulate Verilog designs in closed-loop workflows without blowing context windows on unstructured compiler output.


⚡ Quick Tour: See It in Action

Why AI Agents Need mcp-verilog

Without mcp-verilog (Raw Shell)

With mcp-verilog (Structured MCP)

Dumps 5,000 lines of raw compiler output into context

Returns < 100 tokens of clean JSON

Agent hallucinates line numbers and syntax bugs

Direct file/line jump: "line": 9, "severity": "error"

Broken while(1) simulation hangs the agent/IDE

Timeout kill-switch (timedOut: true)

Requires manual host install of 5+ C++ EDA packages

Zero host install (isolated rootless Podman)

Real Agent Scenarios in 60 Seconds

1. Probing the Toolchain (Zero-Config Verification)

// Tool Call: verilog_toolchain_info
{
  "runtime": "podman",
  "tools": [
    { "name": "iverilog", "available": true, "version": "Icarus Verilog version 12.0 (stable)" },
    { "name": "verilator", "available": true, "version": "Verilator 5.020" },
    { "name": "verible-verilog-lint", "available": true, "version": "v0.0-4080-ga0a8d8eb" },
    { "name": "sv2v", "available": true, "version": "v0.0.13" }
  ]
}

2. Pinpoint Syntax Diagnostics (1-Shot Repair)

// Tool Call: verilog_lint {"files": ["syntax_error.v"]}
{
  "success": false,
  "diagnostics": [
    { "file": "syntax_error.v", "line": 9, "severity": "error", "message": "syntax error at token 'end'" }
  ]
}

3. Closed-Loop Testbench Simulation (318ms)

// Tool Call: verilog_simulate {"files": ["counter.v", "counter_tb.v"], "top_module": "counter_tb"}
{
  "success": true,
  "exitCode": 0,
  "stdout": "PASS: Counter testbench completed successfully with count=5\n"
}

4. Instant Assertion Triage (Catches Failures Safely)

// Tool Call: verilog_simulate {"files": ["failing_tb.v"], "top_module": "failing_tb"}
{
  "success": false,
  "exitCode": 1,
  "errors": ["FATAL: failing_tb.v:11: SIMULATION_ASSERTION_FAILED: Test intentional failure."]
}

Related MCP server: EDA Tools MCP Server

Tools Exposed

Tool

Parameters

Engine

Description

verilog_lint

files: string[], ruleset?: string, cwd?: string

verible-verilog-lint

Analyzes code style and syntax, returning structured line, column, severity, and rule diagnostics.

verilog_compile

files: string[], top_module?: string, compiler?: "iverilog" | "verilator", cwd?: string

iverilog / verilator

Elaboration and syntax checking without running a full simulation.

verilog_simulate

files: string[], top_module?: string, timeout_ms?: number, dump_waves?: boolean, cwd?: string

iverilog + vvp

Compiles and executes a behavioral testbench, capturing runtime $fatal assertions, errors, and timing out runaway loops.

verilog_toolchain_info

none

Probe

Returns the active runtime (podman, docker, host) and installed toolchain versions.


Execution Runtime

mcp-verilog automatically prioritizes running tools inside the zesun33/verilog rootless Podman image (localhost/zesun33/verilog), ensuring tools run identically across any Linux host without polluting the host environment:

  • Container mount: -v <workspace>:/workspace:Z -w /workspace

  • Podman storage option: --storage-opt overlay.ignore_chown_errors=true

To force host binaries instead of container execution:

export MCP_VERILOG_RUNTIME=host

Universal Client & AI IDE Setup

Because mcp-verilog implements the standard Model Context Protocol (MCP), it connects seamlessly to any MCP-compliant AI IDE or agent interface:

Environment

Supported Tools

Setup Location

AI IDEs

Cursor, Windsurf, Google Antigravity, Zed

.cursor/mcp.json or .windsurf/mcp.json

Extensions

GitHub Copilot / OpenAI Codex, Cline, Roo Code

VS Code MCP extension settings

CLI Agents

Claude Code, OpenCode, Goose, Antigravity CLI (agy)

Global MCP configuration or CLI flags

Desktop

Claude Desktop

claude_desktop_config.json

1. Cursor / Windsurf / Antigravity IDE

Add to your project's .cursor/mcp.json or .windsurf/mcp.json:

{
  "mcpServers": {
    "verilog": {
      "command": "node",
      "args": ["/data/mxm6982/projects/personal-projects/mcp-verilog/dist/index.js"]
    }
  }
}

2. VS Code (GitHub Copilot / OpenAI Codex / Cline)

Add to your VS Code MCP settings or user settings:

{
  "mcpServers": {
    "verilog": {
      "command": "node",
      "args": ["/data/mxm6982/projects/personal-projects/mcp-verilog/dist/index.js"]
    }
  }
}

3. Claude Desktop & Claude Code

Add to claude_desktop_config.json:

{
  "mcpServers": {
    "verilog": {
      "command": "node",
      "args": ["/path/to/personal-projects/mcp-verilog/dist/index.js"]
    }
  }
}

Verification & Testing

Run the full verification suite:

./scripts/verify.sh

Run specific test tiers:

npm run test:unit       # Unit tests (regex parsers & contract)
npm test                # All tests (including Podman integration)

Available Tools

4 tools
verilog_compileA

Performs syntax validation and elaboration checking on Verilog files using iverilog or verilator without running full simulation.

ParametersJSON Schema
NameRequiredDescriptionDefault
cwdNoOptional working directory.
filesYesList of Verilog source files to compile.
compilerNoCompiler engine to use ('iverilog' or 'verilator'). Defaults to 'iverilog'.
top_moduleNoTop-level module name for elaboration.

TDQS

A3.8/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It usefully discloses that full simulation is not run and names the compiler engines. However, it does not describe possible side effects, error behavior, or whether intermediate files are generated, which would matter without annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence with no filler. It front-loads the core purpose and includes the key exclusion ('without running full simulation') compactly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The schema is rich enough to cover all parameters, and the description states the tool's scope and non-simulation behavior. There is no output schema, and the description does not describe return values, but compiler success/error output is reasonably inferable for this kind of tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema covers 100% of the parameters, so the description does not need to repeat parameter details. It adds marginal value by mentioning iverilog and verilator, which aligns with the compiler parameter, but does not go beyond what the schema already documents.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific action ('syntax validation and elaboration checking') on a specific resource ('Verilog files') and explicitly distinguishes itself from full simulation, which separates it from the verilog_simulate sibling. It is clear and actionable.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives clear context: use this for syntax/elaboration checking rather than full simulation. However, it does not explicitly mention when to prefer verilog_lint or verilog_simulate, nor does it state exclusions or alternatives by name.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

verilog_lintA

Lints Verilog / SystemVerilog source files using verible-verilog-lint and returns structured line, column, severity, and rule diagnostics.

ParametersJSON Schema
NameRequiredDescriptionDefault
cwdNoOptional working directory where the files reside.
filesYesList of Verilog/SystemVerilog source files to lint (relative to cwd or absolute).
rulesetNoOptional Verible ruleset name (e.g. 'all', 'default').

TDQS

A3.8/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description bears the full behavioral burden. It does disclose what the tool returns (line, column, severity, rule diagnostics), which is helpful, but it does not mention whether the tool is read-only, requires verible to be installed, or how it behaves on lint errors. It adds some context but not comprehensive behavioral detail.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, tightly worded sentence that front-loads the core action and immediately states what diagnostics are returned. There is no redundant or filler content.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is simple, all parameters are documented in the schema, and the description covers the essential return information. It does not explain error behavior or toolchain prerequisites, but those are minor gaps for this kind of lint wrapper.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, and the input schema already documents files, cwd, and ruleset clearly. The description adds no additional parameter-level meaning, so the baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific action ('Lints Verilog / SystemVerilog source files'), names the underlying tool ('verible-verilog-lint'), and specifies the output ('structured line, column, severity, and rule diagnostics'). This clearly distinguishes it from siblings like verilog_compile and verilog_simulate.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The intended use is implied by the verb 'lints' and the file types, but there is no explicit guidance about when to choose this tool over verilog_compile, verilog_simulate, or verilog_toolchain_info. No exclusions or alternative conditions are mentioned.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

verilog_simulateA

Compiles and runs a behavioral testbench simulation using iverilog + vvp. Captures runtime assertions ($fatal), testbench errors, and protects against infinite loops with a timeout.

ParametersJSON Schema
NameRequiredDescriptionDefault
cwdNoOptional working directory.
filesYesList of Verilog source files including the design and testbench.
dump_wavesNoWhether to record VCD waveforms.
timeout_msNoMaximum simulation runtime in milliseconds before aborting (default: 15000).
top_moduleNoName of the top-level testbench module.

TDQS

A3.9/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full behavioral burden. It discloses meaningful non-obvious behaviors: capturing $fatal runtime assertions, detecting testbench errors, and enforcing a timeout to prevent infinite loops. This is strong value beyond the schema.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single well-structured sentence with no filler. It leads with the primary action, then adds the most important behavioral safeguards, making it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description covers the core simulation behavior and timeout safeguard, but with no output schema and no annotations, it does not explain what the tool returns or how the captured assertions/errors are presented to the agent. It also lacks explicit sibling differentiation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so all parameters are already documented. The description adds minimal parameter-level nuance, mainly connecting timeout_ms to infinite-loop protection. This meets the baseline but does not exceed it.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb+resource construct: 'Compiles and runs a behavioral testbench simulation using iverilog + vvp.' This clearly identifies what the tool does and distinguishes it from the sibling lint/compile tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The purpose implies this is the tool to use when simulation is needed, but it never explicitly states when to choose it over verilog_compile or verilog_lint. There is no when-to-use, when-not-to-use, or alternative routing.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

verilog_toolchain_infoA

Returns active container or host execution runtime info and versions of iverilog, verilator, verible, and sv2v.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the behavioral disclosure burden. The verb 'Returns' makes the non-mutating, read-only nature clear, and 'active container or host' reveals that results depend on where execution occurs. It does not mention failure modes or output format, but for a no-argument query tool this is minor.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single sentence that states exactly what is returned and names all four covered tools. There is no repetition, filler, or information already present in the schema.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a zero-parameter inspection tool, the description is largely complete: it names the environment dimension (container/host) and the exact tool versions covered. It could optionally specify the output shape, but with no output schema and no parameters, this is not a critical gap.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool accepts zero parameters, so the baseline is 4 and the description need not explain parameter meaning. It adds value by enumerating the exact information returned: iverilog, verilator, verible, and sv2v versions, plus runtime info.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb and resource ('Returns active container or host execution runtime info and versions of ...') and is clearly distinct from the sibling action tools verilog_lint, verilog_compile, and verilog_simulate. An agent can immediately identify this as the inspection/query tool.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The intended use is implied: call this when execution environment details or toolchain version information is needed before running lint/compile/simulate actions. However, it does not explicitly state when to prefer this over siblings or when not to use it, leaving some inference required.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 4 tool updatesv0.1.0
    • First observedverilog_compile
    • First observedverilog_lint
    • First observedverilog_simulate
    • First observedverilog_toolchain_info

TDQS

A4.1/5.0
Disambiguation5/5

Each tool targets a distinct stage of Verilog development: lint rules, compile/elaboration, simulation execution, and environment/version introspection. There is no meaningful overlap between these purposes.

Naming Consistency4/5

All tools share the verilog_ prefix and use lowercase snake_case, making them easy to group. The first three are clearly verb-style actions, while verilog_toolchain_info is noun-style, a minor deviation from a strict verb_noun pattern.

Tool Count5/5

Four tools is a well-scoped size for a Verilog toolchain server. Each tool covers a significant, non-redundant capability without bloating the API.

Completeness4/5

Lint, compile, simulate, and toolchain info cover the core hardware verification workflow well. A formatter such as verible-verilog-format or waveform/coverage retrieval would round out the surface, but agents can work around those gaps.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/zesun33/mcp-verilog'

If you have feedback or need assistance with the MCP directory API, please join our Discord server