Neurarch MCP logo

Neurarch MCP

Inspect, compare, trace, and estimate PyTorch model graphs through MCP tools, with optional Hugging Face and ledger-backed planning.

Install Neurarch MCP

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "neurarch-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "neurarch-mcp"
      ]
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

We couldn’t confirm it starts correctly

We ran the install command but it didn't respond within our test window — this can mean a slow first-time install rather than a real problem.

npx -y neurarch-mcp

No response to initialize.

This is an experimental automated check and can have false negatives — missing environment variables, a slow cold install, etc. It doesn’t necessarily mean something’s wrong. Last checked 8d ago.

Overview

The neurarch-mcp MCP server gives coding agents structured access to PyTorch source files, Neurarch graphs, reference architectures, and optional Hugging Face models. It reports architecture shape, parameter, compute, dependency, validation, and structural-difference information through MCP tools, while `trace_model` can run neurarch-trace to recover real runtime shapes. Use it when an agent needs facts about a model before suggesting edits, especially when downstream impact or model cost matters. Most analysis runs locally and offline; `plan` and `history` are the exceptions because they contact the organization ledger.

Use cases

  • Inspect a PyTorch model before training
  • Trace a dynamic repository to recover runtime shapes
  • Compare layers or model graphs before editing
  • Measure downstream impact before changing a layer
  • Browse reference architectures offline

Key features

  • Structured PyTorch graph inspection
  • Layer search, comparison, and impact analysis
  • Architecture summaries with parameters and MACs
  • Runtime tracing through neurarch-trace
  • Offline reference architecture library
  • Mermaid diagram and PyTorch export

Tools19

What Neurarch MCP lets your agent do. Expand a tool for its parameters.

Self-reported~726 tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked 3d ago

Recent health check succeeded.

7/7 checks healthy over the last 45d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 8h ago via OSV.dev · neurarch-mcp (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars1Stargazers on the source repository.
npm downloads878Package downloads in the last 30 days.
Last commit5d agoMost recent push to the default branch.
Install checkInconclusiveDidn't respond in our test window — often a slow first install.
Tools exposed19Callable tools this server registers over MCP.
Directory activity1 viewsConfig copies, upvotes, and views on AllMCPs.

How Neurarch MCP works

What neurarch-mcp MCP server does

The neurarch-mcp MCP server lets an agent inspect a PyTorch model as a structured graph instead of inferring architecture details from source text. It accepts a self-contained .py file, a saved .neurarch.json graph, a bundled reference architecture, or—when started with --hf—a Hugging Face repository. The server can also discover model definitions and saved graphs in a directory with find_models.

The main orientation tool is describe_architecture. It returns a topology-ordered pipeline, graph depth, input and output shapes, total parameters and MACs, the largest parameter and compute hotspots, and a validation rollup. More targeted tools expose model summaries, individual layers, searches, structural comparisons, downstream impact, model diffs, Mermaid diagrams, and runnable PyTorch export.

How it works

For source files, the server statically parses layer definitions and wiring. This path can identify layers, types, hyperparameters, and connections, but it cannot reliably recover runtime shapes or FLOPs when those values are created dynamically. A saved graph carries richer information, including shapes, groups, and design notes.

trace_model runs neurarch-trace in the user’s Python environment with supplied input dimensions and returns a graph path containing runtime shapes. The README presents tracing as the preferred route for real repositories, including models spread across files, dynamically constructed models, and code using from_pretrained or timm. load_architecture opens one of the 81 bundled reference architectures, which include families such as Llama, Qwen, DeepSeek, Mixtral, Gemma, Whisper, CLIP, BERT, ViT, and ResNet. These references are offline and include configuration-derived dimensions and checked parameter counts.

The plan tool sends the graph to POST /api/v1/plan; history sends a fingerprint and key without sending the graph. These are the only listed operations described as opening a network connection.

Setup and configuration

Node 20 or newer is required. For a local model file, run the server with npx, for example:

Terminal
npx -y neurarch-mcp /absolute/path/to/model.py

The README provides client-specific setup for Claude Code, Cursor, Claude Desktop, VS Code, Windsurf, and Codex. A saved graph can be watched with --watch so app-side saves become visible without restarting the server. Hugging Face loading requires the --hf option, and load_hf_model is the listed tool that opens a socket for that purpose.

Tracing requires the separate neurarch-trace Python package. It can trace a callable with input dimensions or record the first forward pass when enabled in a training script.

Limitations and notes

Static parsing is a fallback rather than a substitute for tracing on complex repositories. The referenced study found a recognizable graph for 41% of 116 real model files; source-derived shapes and compute values may be unknown. The README also reports that static-parser findings should be treated cautiously and recommends tracing before acting on them.

export_pytorch writes only when started with --write, and it must not target the file used to start the server. plan and history have different privacy and connectivity behavior from the offline inspection tools: plan sends the model graph, while history does not send the graph.

The neurarch-mcp MCP server can inspect a Hugging Face repository only through the explicitly enabled --hf mode. For an ordinary local analysis, no API key or account is described as required.

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Neurarch MCP

neurarch-mcp is an MCP server that connects agents to PyTorch source files, Neurarch graphs, reference architectures, and optional Hugging Face repositories. Its main tools inspect architectures, summarize models, find and compare layers, calculate layer impact, trace models for runtime shapes, generate Mermaid diagrams, and export runnable PyTorch modules.

Install it by running `npx -y neurarch-mcp` with a model path; Node 20 or newer is required. For example, run `npx -y neurarch-mcp /absolute/path/to/model.py`. The README also provides setup instructions for supported MCP clients.

Yes, neurarch-mcp works with Cursor. The README includes a Cursor installation link and client configuration, and the server can be started with `npx` against a local model file.

Use `trace_model` with neurarch-trace and input dimensions to produce a graph containing runtime shapes. This is recommended for dynamic or multi-file repositories; static parsing of a `.py` file may leave shapes and FLOPs unknown.

No API key is required for the local inspection tools described in the README. Most tools run offline, while `plan` and `history` contact the organization ledger; Hugging Face loading also opens a socket when enabled with `--hf`.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewNeurarch MCP AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/neurarch-mcp?style=directory)](https://allmcps.com/mcp/neurarch-mcp)
HTML Embed
<a href="https://allmcps.com/mcp/neurarch-mcp"><img src="https://allmcps.com/api/badge/neurarch-mcp?style=directory" alt="Neurarch MCP on AllMCPs" /></a>