Traces which neurons and attention heads drive a language model's output via MCP tools.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
Ask a language model "why did you say that" and get back the actual attention heads and neurons responsible, as JSON, from the command line or from an agent over MCP.

That gets you the neuronscope command. To install from source instead (for development or to
track main):
[!NOTE] The first run of any command downloads the requested model from the HuggingFace Hub (
gpt2is about 500MB) and prints two lines to stderr that are expected, not errors: a CPU-fallback notice if you don't have a CUDA GPU, and an unauthenticated-HF-Hub rate-limit notice. Neither one means anything broke.
Real output from this exact command (stderr trimmed to the two expected warnings mentioned above):
gpt2 predicts Tokyo correctly, and head L9H8 is the single biggest contributor to that
prediction. Add --json to get the machine-readable version of the same result:
NeuronScope is a CLI and MCP server built on top of TransformerLens. TransformerLens does the actual model loading, hooking, and activation math; NeuronScope adds a stable CLI, a versioned JSON schema, and an MCP server around it, so a script or an agent can ask "which components drove this output" without writing TransformerLens code directly.
trace: runs a prompt through the model and ranks attention heads by direct logit
attribution to the predicted token, and MLP neurons by activation magnitude at the final
prompt position.activations: dumps shape, mean, std, min/max, and the max-activating sequence
position for every layer's residual stream, MLP neuron activations, and attention pattern.patch: zero-ablates one component (resid_pre, resid_mid, resid_post,
attn_out, mlp_out, or mlp_post) at a given layer and reports how the predicted token
and its logit changed.circuit: a best-effort automated circuit sketch. Ranks candidate heads/neurons by
logit attribution, then measures each one's individual causal effect via single-component
ablation. This is not full path-patching with clean/corrupted prompt pairs and does not
capture interaction effects between components. The --json output says so explicitly in
its method field.--json for a schema_version-stamped document instead of a
table, and the same four operations are exposed as MCP tools returning the identical
shape via .model_dump(), so a CLI call and an MCP tool call produce the same document
for the same input.transformer_lens.HookedTransformer.from_pretrained supports.
Installing neuronscope-cli today pulls TransformerLens 3.6.0, which supports 249
pretrained checkpoints and aliases (OFFICIAL_MODEL_NAMES), covering GPT-2, Pythia,
Llama, Gemma, Qwen, and more. Small models like gpt2 run comfortably on CPU.NeuronScope does not replace TransformerLens, nnsight, SAELens, Anthropic's circuit-tracer, or Neuronpedia. It wraps TransformerLens for one narrower job: fast, scriptable, agent-callable component tracing on a single prompt. It leaves deeper mechanistic work (SAE training, transcoder-based circuit graphs, hosted feature browsing) to those tools.
Every command takes MODEL (any name HookedTransformer.from_pretrained accepts, for
example gpt2 or EleutherAI/pythia-70m) and PROMPT as positional arguments.
| Command | Extra flags | What it does |
|---|---|---|
neuronscope trace MODEL PROMPT | --top-k INTEGER (default 10), --json | Ranks top attention heads (logit attribution) and MLP neurons (activation magnitude) for the predicted next token |
neuronscope activations MODEL PROMPT | --json | Dumps per-layer activation summary stats (residual stream, MLP, attention pattern) |
neuronscope patch MODEL PROMPT | --layer INTEGER (required), --component [resid_pre|resid_mid|resid_post|attn_out|mlp_out|mlp_post] (required), --json | Zero-ablates one component and reports the logit/prediction delta |
neuronscope circuit MODEL PROMPT | --top-k INTEGER (default 10), --json | Best-effort circuit sketch via ranked single-component ablation |
neuronscope mcp-server | none | Starts the MCP server over stdio |
Global: neuronscope --version, neuronscope <command> --help. Exit codes: 0 success,
1 a runtime error (prompt too long for the model's context window, --layer out of range,
etc.), 2 a Click usage error (bad flags), 3 an unsupported model name.


NeuronScope ships a Model Context Protocol server so an AI agent (Claude, Cursor, or any MCP-compatible client) can trace, inspect, ablate, and sketch circuits directly, without a human invoking the CLI by hand.
Install the extra:
Add it to your MCP client's config (for Claude Desktop, claude_desktop_config.json):
The server exposes four tools, trace, activations, patch, and circuit, each returning
the identical pydantic-model-shaped JSON the CLI's --json flag prints, via .model_dump(), so
an agent calling this server and a script calling the CLI get the same document for the same
input. A real trace call and its response:
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/neuronscope)<a href="https://allmcps.com/mcp/neuronscope"><img src="https://allmcps.com/api/badge/neuronscope?style=directory" alt="Neuronscope on AllMCPs" /></a>