Verilog MCP Server
Verilog/SystemVerilog RTL 语义分析 MCP 服务器。基于 tree-sitter 解析 HDL 源文件,结合 pyslang(slang 编译器前端)进行语义级 elaboration,通过 MCP 协议暴露模块搜索、信号追踪、层次树构建、FSM 检测、时钟域分析和可视化等工具。
Power your agent
Install from the publisher. Not a PlugMCP endpoint.
Host a copy with our keys and logs.
No packaged release in the registry yet. Follow the repository README.
Remote URL or a command on your machine? How the two installs differ
Run on PlugMCP
A new server you create. It is not this listing's official endpoint. Use the publisher install when you want their URL and their credentials.
LaunchFrom the publisher
Verilog/SystemVerilog RTL 语义分析 MCP 服务器。基于 tree-sitter 解析 HDL 源文件,结合 pyslang(slang 编译器前端)进行语义级 elaboration,通过 MCP 协议暴露模块搜索、信号追踪、层次树构建、FSM 检测、时钟域分析和可视化等工具。
Verilog/SystemVerilog RTL semantic analysis MCP Server — dual tree-sitter + pyslang engine with 28 MCP tools for module search, signal tracing, hierarchy building, FSM detection, clock domain analysis, and interactive visualization.
pip install -e .
# 查看版本
verilog-mcp-server --version
# 启动 MCP 服务器(stdio 传输,由 MCP 客户端调用)
verilog-mcp-server
# 启动时构建索引
verilog-mcp-server --build -p /path/to/rtl/project
# 指定 filelist 文件(自动提取 +incdir+ 和 +define+)
verilog-mcp-server --build -f project.f
# 指定顶层模块
verilog-mcp-server --build -f project.f --top soc
# 强制全量重建
verilog-mcp-server --rebuild -p /path/to/rtl/project
{
"mcpServers": {
"verilog": {
"command": "verilog-mcp-server",
"args": ["--build", "-f", "/path/to/project.f", "--top", "soc"]
}
}
}
CentOS 8.4 兼容的独立可执行文件(无需 Python 环境):
# 在 CentOS 8.4 上构建
bash scripts/build-centos8.sh
# 或使用预构建的 tar.gz
tar xzf verilog-mcp-server-linux-x86_64.tar.gz
./verilog-mcp-server --build -f project.f --top soc
图类型:
HTML 输出使用 vis.js 交互式网络图,支持缩放/拖拽/点击详情/层次展开。
verilog_mcp_server/
├── server.py # FastMCP 应用创建、CLI、stdio 启动
├── config.yaml # 默认配置
│
├── indexer/ # tree-sitter 解析 + 数据提取
│ ├── builder.py # 全量/增量索引构建(支持并行解析)
│ ├── project_scanner.py # 文件发现、.f 文件展开(+incdir+/+define+ 传递)
│ ├── verilog_parser.py # tree-sitter 封装
│ ├── module_extractor.py
│ ├── port_extractor.py # 端口提取(ANSI + 非 ANSI)
│ ├── signal_extractor.py # 信号 + testbench 检测
│ ├── instance_extractor.py # 例化(含门级原语 + defparam)
│ ├── type_extractor.py
│ ├── package_extractor.py # package 定义 + import 声明
│ ├── sva_extractor.py # SVA 断言
│ ├── macro_extractor.py # 宏定义
│ ├── function_task_extractor.py # function/task 提取
│ ├── filelist_parser.py # .f 文件解析(+incdir+/+define+/+libdir+)
│ ├── pyslang_parser.py # pyslang 编译 + elaboration
│ └── pyslang_extractor.py # pyslang 数据提取
│
├── database/ # SQLite + 内存缓存
│ ├── models.py # 数据类:ModuleDef, PortDef, SignalDef, PackageDef,
│ │ # FunctionDef, SvaDef, MacroDef, InstanceDef 等
│ ├── index_store.py # 索引存储(模块/类型/package/function 查询)
│ ├── sqlite_backend.py # SQLite CRUD
│ └── errors.py
│
├── analysis/ # 分析引擎
│ ├── hierarchy.py # 模块层次树(优先 pyslang 数据)
│ ├── fan_in.py # 信号扇入追踪
│ ├── fan_out.py # 信号扇出追踪
│ ├── fsm_detector.py # 状态机检测
│ ├── clock_analyzer.py # 时钟域分析
│ ├── clock_tree.py # 时钟域层次映射
│ ├── always_classify.py # always 块分类
│ ├── cross_ref.py # 交叉引用
│ ├── expr_walker.py # 表达式信号引用提取
│ ├── signal_classifier.py
│ └── visualizer.py # 图谱生成(Mermaid + vis.js HTML)
│
├── tools/ # MCP 工具注册
│ ├── level1_search.py # Level 1 — 查询(含 package/function 搜索)
│ ├── level2_relation.py # Level 2 — 关联分析
│ ├── level3_analysis.py # Level 3 — 智能分析(含 SVA 查询)
│ ├── visualize.py # 统一可视化
│ └── elab_tools.py # pyslang elaboration 报告
│
├── templates/
│ └── visualizer.html # vis.js HTML 模板
│
└── scripts/
├── build-centos8.sh # CentOS 8.4 构建脚本
└── tree_sitter_cache_hook.py # PyInstaller runtime hook
ProcessPoolExecutor 多进程解析(≥10 文件自动启用)pyslang 是 slang(业界公认最完整的开源 SystemVerilog 编译器前端)的官方 Python 绑定。
pyslang:
enabled: true
include_dirs: [] # include 搜索路径(自动合并 .f 文件的 +incdir+)
defines: {} # 预定义宏(自动合并 .f 文件的 +define+)
top_module: "" # 指定顶层模块
rtl_elab_instances 显示 genblk 展开后的完整层次路径rtl_get_module 信号列表显示 resolved 位宽rtl_hierarchy 优先使用 pyslang 数据(含 generate 展开)rtl_elab_report 显示诊断信息支持标准 EDA .f 文件列表格式:
verilog-mcp-server --build -f project.f
.f 文件中的 +incdir+ 和 +define+ 自动传递给 pyslang 预处理器:
# project.f
+incdir+./include
+incdir+./rtl
+define+SIM
+define+BUS_WIDTH=32
./rtl/top.sv
./rtl/cpu.sv
-f sub_module.f
pytest tests/ -v
Verilog/SystemVerilog RTL semantic analysis MCP Server — dual tree-sitter + pyslang engine with 28 MCP tools for module search, signal tracing, hierarchy building, FSM detection, clock domain anal
Overview
Verilog/SystemVerilog RTL semantic analysis MCP Server — dual tree-sitter + pyslang engine with 28 MCP tools for module search, signal tracing, hierarchy building, FSM detection, clock domain analysis, and interactive visualization.
Tools
No tool list yet. Remote servers get one after the first health check.
FAQ
Copy the stdio config for Cursor, Claude Desktop, Claude Code, or VS Code on this page. It uses the publisher's install, not a PlugMCP proxy.
No required environment variable is listed on this record.
Verilog runs locally over stdio.
Last checked 2026-10-28. Verilog/SystemVerilog RTL semantic analysis MCP Server — dual tree-sitter + pyslang engine with 28 MCP tools for module search, signal tracing, hierarchy building, FSM detection, clock domain analysis, and interactive visualization.