NeuronScope

by rudrendupaul

Not rated
GitHub

About

Traces which neurons and attention heads drive a language model's output via MCP tools, built on TransformerLens.

Details

Author
rudrendupaul
Categories
Developer Tools

Setup

Install NeuronScope in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/rudrendupaul/NeuronScope

Follow the installation instructions in the repository README, then restart your MCP client.

What is NeuronScope and why does it exist

TransformerLens gives you a Python API for loading a model and running hooked forward passes. That's the right interface for a research notebook. It's the wrong interface for a script that needs a subprocess call and a JSON document back, or for an agent that needs a tool it can call over MCP. NeuronScope exists to be that second interface: the same underlying computation, wrapped so a CLI invocation or an MCP tool call gets back a schema-versioned document instead of a Python object graph.

Is this a replacement for TransformerLens, nnsight, SAELens, circuit-tracer, or Neuronpedia?No. NeuronScope is built directly on TransformerLens and does not do anything TransformerLens itself can't already do at a lower level. It doesn't train SAEs (SAELens), do full path-patching circuit discovery with transcoders (circuit-tracer), give you a Python-native tracing context manager for arbitrary PyTorch models (nnsight), or host a browsable feature database (Neuronpedia). It's a CLI and MCP wrapper around one slice of TransformerLens's functionality.

What models are supported?Anythingtransformer_lens.HookedTransformer.from_pretrainedsupports, which today is 249 checkpoints and aliases spanning GPT-2, Pythia, Llama, Gemma, Qwen, and others. Runpython -c "from transformer_lens.loading_from_pretrained import OFFICIAL_MODEL_NAMES; print(len(OFFICIAL_MODEL_NAMES))"in your own environment to get the exact count for your installed version, since TransformerLens adds models over time.

Does it need a GPU?No. Small models likegpt2run fine on CPU; that's what the test suite and the quickstart above run on. Larger models will be slow on CPU. NeuronScope does not auto-select Apple Silicon's MPS backend even when available, because PyTorch's MPS backend can silently produce incorrect values for some ops that this project's activation-patching math depends on being exact. Passdevice="mps"explicitly in your own code if you want it anyway.

Is it safe to expose the MCP server to an untrusted agent?Only with resource limits in place. See Known limitations below.

How is NeuronScope different from circuit-tracer, the other CLI tool in this list?circuit-tracer does deeper circuit analysis (full attribution graphs from trained transcoders) but only for a fixed allowlist of models: Gemma-2, Gemma-3, Llama-3.1/3.2, Qwen-3, and GPT-OSS. NeuronScope trades that depth for breadth: it works with any of TransformerLens's 249 supported checkpoints with no transcoder training step, and ships an MCP server so an agent can call it directly. The cost is that NeuronScope does single-component logit attribution and zero-ablation, not transcoder-based path patching.

Does the installed version always match what's on PyPI?Runneuronscope --versionafter installing to check.pip install neuronscope-clipulls whatever release PyPI has published most recently; the code on this repo'smainbranch can be ahead of that between releases. Installing from source (pip install -e .) always tracksmainexactly, including whatever hasn't been released yet.

What license is NeuronScope under, and can I use it commercially?MIT. You can use, modify, and redistribute it in commercial and closed-source projects, with attribution and the license notice kept intact. The dependencies it pulls in (TransformerLens, PyTorch, themcppackage) carry their own licenses; check those separately if you're redistributing a bundled product rather than just callingneuronscope-clias a dependency.

- circuitis an approximation.It ranks components by logit attribution and measures each one's individual causal effect via single-component zero-ablation on one prompt. It does not do full path-patching with clean/corrupted prompt pairs, and it will not catch interaction effects between components. The--jsonoutput states this in itsmethodfield so a caller doesn't have to trust prose to know the caveat.
- No size cap or timeout on model loading or forward passes.NeuronScope loads whatever model weights the caller asks for and runs the forward pass to completion, with no built-in limit on model size or wall-clock time. If you run the MCP server somewhere an untrusted agent can call it, put a resource limit around the process (a cgroup,ulimit, or a container memory/CPU cap) rather than relying on NeuronScope to refuse an oversized request on its own.
- HookedTransformer.from_pretrainedis deprecated upstream.TransformerLens 3.6.0 emits aDeprecationWarningpointing atTransformerBridge.boot_transformersas the replacement. It still works today, and every command shown in this README ran on it, but NeuronScope's backend hasn't migrated yet. Tracked as an open item; migrating would be a change insideneuronscope/backends/transformer_lens.py, not a change to any CLI command or MCP tool signature.

Issues and pull requests are welcome. See](https://github.com/RudrenduPaul/NeuronScope/blob/HEAD/neuronscope/mcp_server.py)CONTRIBUTING.mdfor dev setup, where the code lives, and what a PR needs before it merges. Quick version:

pip install -e ".[dev,mcp]" pytest -v

CI runs the same suite on Python 3.10, 3.11, and 3.12 on every push and pull request againstmain. The suite covers 87% ofneuronscope/(pytest --cov=neuronscope), with the MCP server's less-exercised paths (specific error branches) the main gap.

This is a web browser that enables your coding agent, such as Claude Code, to visit websites on your behalf and assist you in identifying bugs or creating UI test cases.

Create crafted UI components inspired by the best 21st.dev design engineers.

Bring agent evaluations, observability, and synthetic test set generation directly into your IDE for free with Galileo's new MCP server

An MCP server to help AI assistants to answer questions and generate AccelByte Extend SDK code more effectively .

MCP server for AI Diagram Maker — generate beautiful software engineering diagrams directly inside Cursor, Claude Desktop, Claude Code, or any MCP-compatible AI agent

ALAPI MCP Tools,Call hundreds of API interfaces via MCP

AI-powered SVG animation generator that transforms static files into animated SVG components using the Allyson platform

MCP server that gives AI assistants on-demand access to 1,500+ amCharts docs, ~300 code examples, and 1000+ class API references.

APIMatic MCP Server is used to validate OpenAPI specifications using APIMatic. The server processes OpenAPI files and returns validation summaries by leveraging APIMatic’s API.

One shared context layer for AI agents and humans — live API specs, DB schemas, and versioned contracts across repos so every agent and teammate works from the same source of truth.

Build and deploy full-stack Next.js apps with 98 tools for React, AWS, and MongoDB

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.