npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

stacklens-mcp

v1.0.0

Published

Claude MCP plugin — paste an error, understand it instantly

Downloads

29

Readme

StackLens

Paste an error. Understand it instantly.

StackLens is a Claude MCP plugin that analyzes any stack trace or error log and returns a structured explanation — root cause, plain-English summary, code fix, severity level, and common causes.

No API key required. StackLens uses MCP sampling — it asks Claude (your existing host) to run the analysis, so it works with your existing Claude Desktop or Claude Code session.

Supported languages

Python · JavaScript · TypeScript · Java · Go · Rust · SQL · Docker · C/C++

Quick install

Prerequisites: Node.js 18+

Claude Desktop

Add to your config file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "stacklens": {
      "command": "npx",
      "args": ["-y", "stacklens-mcp"]
    }
  }
}

Restart Claude Desktop. Look for the tools icon — StackLens is ready when you see explain_error listed.

Claude Code (CLI)

Option 1 — Global (available in all Claude Code sessions):

claude mcp add stacklens npx -- -y stacklens-mcp

Option 2 — Project-level (copy .mcp.json from this repo into your project root):

cp /path/to/stacklens/.mcp.json your-project/

Claude Code auto-loads .mcp.json from the project root.

Usage

Option 1 — Slash command:

/debug [paste your error here]

Option 2 — Natural language:

Use explain_error to analyze: [paste stack trace]

Option 3 — Batch mode:

Use explain_errors_batch with these errors: [...]

Example output

🔴 Trying to call .upper() on a None value — user.name was not set

Language: Python  |  Severity: crash

Root cause
app.py line 42
user.name is None because the database query returned no result

Fix
Before:
result = user.name.upper()

After:
result = user.name.upper() if user.name else ""

Common causes
- User record not found in database
- Optional field not validated before use
- Race condition where user object is partially populated

Docs: https://docs.python.org/3/library/stdtypes.html#str.upper

Development

make setup    # install dependencies
make dev      # run without building
make test     # run against 3 real error cases (requires .env with ANTHROPIC_API_KEY)
make build    # compile to dist/
make lint     # type-check only
make clean    # remove dist/ and logs/

make test is a developer tool that calls the Anthropic API directly. End-users of the plugin do not need an API key.

How it works

StackLens uses MCP sampling: when you call explain_error, the server sends a sampling/createMessage request back to the Claude host (Desktop or Code). The host runs the inference using its own Claude connection and returns the result. No separate API key is needed.

Troubleshooting

| Problem | Fix | |---------|-----| | Tool not appearing in Claude | Restart Claude Desktop completely | | JSON parse error | Retry — the model returned non-JSON | | Module not found | Run make build first | | Batch mode timeout | Reduce batch size below 5 | | Client does not support sampling | Upgrade Claude Desktop / Claude Code to a recent version |

Contributing

Pull requests welcome. Please open an issue first for large changes.

License

MIT