# pyslang-mcp [Health: Active]

**Category:** 📟 Embedded System  
**Repository:** https://github.com/ariklapid/pyslang-mcp  
**GitHub Stars:** 24  
**Views:** 1  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/pyslang-mcp

## Description
Compiler-backed read-only Verilog and SystemVerilog project analysis.

## Tools
Capabilities this server exposes over MCP:

- **pyslang_parse_files** — Parse and elaborate an explicit list of Verilog or SystemVerilog files under a declared project root. Returns the normalized project configuration plus a compact parse summary with file, include, define, top-module, and diagnostic counts.
- **pyslang_parse_filelist** — Parse and elaborate a project filelist under a declared project root. Returns the normalized project configuration, parse counts, expanded nested filelists, and any unsupported filelist directives that were reported instead of ignored.
- **pyslang_get_diagnostics** — Return parse and semantic diagnostics for a project described by explicit files or a filelist. Use this early to confirm the project loads cleanly; the result includes severity counts, per-diagnostic locations, and truncation metadata.
- **pyslang_list_design_units** — List project-local modules, interfaces, and packages for the analyzed project. Use this as the discovery step before `pyslang_describe_design_unit`; results include stable names, kinds, paths, locations, and truncation metadata.
- **pyslang_describe_design_unit** — Describe one project-local design unit by exact, case-sensitive name. Start with `pyslang_list_design_units` if you need discovery. The result reports `found` / `ambiguous`, candidate matches, and on success a `design_unit` object with ports, member-kind counts, child instances, and declared names.
- **pyslang_get_hierarchy** — Return the elaborated instance hierarchy rooted at pyslang top instances. Use `max_depth` and `max_children` to control expansion; nodes include definitions, locations, port-connection snippets, and child truncation markers.
- **pyslang_find_symbol** — Search declarations and references by symbol name, lexical path, or hierarchical path. `match_mode` accepts `exact`, `contains`, or `startswith`. Reference hits can include `named_value`, `package_import`, `instance_definition`, and `declared_type`; set `include_references=false` for a cheaper declaration-only query.
- **pyslang_dump_syntax_tree_summary** — Summarize syntax-tree shapes per file without dumping full raw ASTs. Returns each file's root kind, top-level member kinds, include directives, and the most common node kinds up to `max_node_kinds`.
- **pyslang_preprocess_files** — Return conservative preprocessing metadata and leading source excerpts for analyzed files. This is summary-only: it reports include directives and effective defines, but it does not claim to produce a full standalone preprocessed text stream.
- **pyslang_get_project_summary** — Return a compact project-wide summary of normalized inputs, diagnostics, design-unit counts, top instances, and tracked paths. The summary uses bounded internal limits; tune them with `max_diagnostics`, `max_design_units`, `max_depth`, and `max_children`.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `uvx` (confidence: high):

```json
"mcpServers": {
  "pyslang-mcp": {
    "command": "uvx",
    "args": ["pyslang-mcp"]
  }
}
```

## Documentation

## What pyslang-mcp MCP server does

The pyslang-mcp MCP server gives MCP clients read-only access to compiler-backed information from Verilog and SystemVerilog projects. It wraps pyslang, so requests operate on parsed and elaborated HDL structures rather than treating source files as unstructured text.

The server is intended for local RTL checkouts and can answer questions about compiler diagnostics, design units, module hierarchy, declarations, references, assignments, port connections, and bounded structural connectivity. It can also report how a filelist resolves, including source files, include directories, defines, nested filelists, and unsupported entries.

Results are scoped to a supplied `project_root`. Source files, filelists, and include directories may be absolute or relative, but they must remain inside that root. Responses are compact JSON and can include truncation metadata for large result sets.

## How it works

Start by loading either explicit source files or a `.f` filelist. The available parsing tools accept include directories, preprocessor defines, and optional top modules. After parsing, use diagnostics to identify syntax or semantic problems, then query the compiler’s view of the project.

A typical investigation lists discovered modules, interfaces, and packages before inspecting a particular design unit or walking the elaborated instance tree. Symbol searches can include references, while member searches focus on names local to one design unit. Assignment and instance-connection tools provide additional structural context, and connectivity tracing follows bounded paths through assignments and instance port bindings.

The pyslang-mcp MCP server maintains a process-local cache keyed by project configuration and tracked file modification times. Its preprocessing tool returns metadata and source excerpts rather than promising a complete standalone preprocessed stream.

## Setup and configuration

Install the published package with:

```bash
pip install pyslang-mcp
```

Launch the local stdio server with `pyslang-mcp`. An editable checkout can instead be installed with the development extras and started using `python -m pyslang_mcp` from its virtual environment. An MCP client must launch the process on a machine, virtual machine, or development container that can access the RTL checkout.

A minimal client configuration uses the `pyslang-mcp` command with no arguments. Every tool request must provide `project_root`; parsing requests then supply either `files` or `filelist`, with optional `include_dirs`, `defines`, and `top_modules`.

## Tools and capabilities

The pyslang-mcp MCP server exposes tools for:

- Parsing explicit files or loading nested filelists.
- Retrieving diagnostics and grouping them by diagnostic code.
- Listing and describing modules, interfaces, packages, and other design units.
- Walking instance hierarchy and inspecting one instance’s port connections.
- Finding declarations, references, and local members.
- Inspecting signal assignments and bounded structural connectivity.
- Summarizing syntax node shapes and preprocessing metadata.
- Producing a compact project summary.

Filelists support source entries, nested `-f` and `-F` references, include-directory forms such as `+incdir+...`, `-I dir`, and `-Idir`, plus define forms including `+define+...`, `-D NAME`, and `-DNAME`. Unsupported tokens are reported in tool output.

## Limitations and notes

Operations are read-only: the server does not modify RTL, format files, simulate, synthesize, or replace a linter. Connectivity results are structural frontend evidence, not simulation results, formal proofs, CDC or RDC signoff, timing signoff, or a complete netlist-level driver/load database.

The project is described as early-stage. Streamable HTTP is experimental, and the documented local deployment uses stdio. The server is best suited to compiler-backed questions about complete or sufficiently configured source sets; simple text searches, comments, naming lookups, and incomplete source sets may be better handled with editor search, `rg`, or direct file reading.

_Full upstream README: https://allmcps.com/mcp/pyslang-mcp/readme_

