Skip to main content
MCP server CX Codex

VisualTorch — Claude Code MCP server: diagrams and setup

VisualTorch turns PyTorch model structure into architecture diagrams and animated GIFs. Use it when an agent needs to inspect a neural network visually.

Install into Claude Code · Platform CLI All methods and platforms ↓
claude mcp add visualtorch -- uvx visualtorch
Open on GitHub

What VisualTorch does

VisualTorch is an MCP server for visualizing PyTorch models. It can render graph, flow, and lenet architecture styles, plus animated GIFs that reveal the model layer by layer or column by column. The server uses stdio and returns structured output metadata.

The project lists Python 3.10+ and PyTorch 2.0+ as requirements. Its MCP extras can be installed with visualtorch[mcp], while Claude Code connects through uvx. VisualTorch supports PyTorch Sequential and custom models. It traces a real forward pass, so data-dependent control flow is represented by the branch taken for the test input. Models with several meaningful output tensors still get node sizing from the first tensor, although show_dimension=True can show every output shape. That matters when the model relies on conditional paths or multi-output layers.

What it helps with

  • render a PyTorch architecture diagram
  • map layer connections in graph style
  • generate a model view in flow or lenet style
  • create a GIF that reveals the architecture step by step
  • inspect a custom model through a forward pass

Example prompts for the agent

  • Use VisualTorch to render the PyTorch model from model.py in graph style and show tensor dimensions.
  • Generate an animated flow GIF for this model with VisualTorch.
  • Render the same model in graph, flow, and lenet styles, then compare the diagrams.

How to install VisualTorch

Platform CLI

claude mcp add visualtorch -- uvx visualtorch

uvx runs the command named after the package; if the README names another one, use uvx --from visualtorch <command>

Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more

Questions about VisualTorch

How do I install VisualTorch in Claude Code?

Run claude mcp add visualtorch -- uvx visualtorch.

What does VisualTorch do?

VisualTorch renders PyTorch architectures in graph, flow, and lenet styles, and can create animated GIFs that reveal the model progressively.

What tracing limits should I know about?

VisualTorch follows a real forward pass. A data-dependent branch is shown according to the test input, and a node with several outputs is sized from its first tensor.

Similar MCP servers

All MCP servers for AI and ML →

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor