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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@sshadows/tree-sitter-mcp

v1.0.0

Published

Fast in-memory code search and analysis MCP service using tree-sitter

Readme

Tree-Sitter MCP

CI npm version License: GPL v3 Node.js

Fast semantic code search and analysis for common programming languages. Search for functions and classes, trace code usage, and analyze code quality across your entire project.

Works as both a standalone CLI tool and an MCP server for AI tools like Claude Code.

Getting Started

Install:

npm install -g @nendo/tree-sitter-mcp

Search for code:

tree-sitter-mcp search "handleRequest" --type function

Analyze code quality:

tree-sitter-mcp analyze --analysis-types quality deadcode structure

Find syntax errors:

tree-sitter-mcp errors --output text

Setup with Claude Desktop:

tree-sitter-mcp setup --auto

Or configure manually by adding to ~/.config/claude-desktop/claude_desktop_config.json:

{
  "mcpServers": {
    "tree-sitter-mcp": {
      "command": "npx",
      "args": ["@nendo/tree-sitter-mcp", "--mcp"],
      "cwd": "/path/to/your/project"
    }
  }
}

Features

  • Semantic search - Find functions, classes, and variables by name across 15+ languages
  • Usage tracing - See where code is used before making changes
  • Quality analysis - Detect complex functions, dead code, and architectural issues
  • Fast results - Sub-100ms searches by parsing code structure, not scanning text
  • No configuration - Works immediately on any project

Supported Languages

JavaScript, TypeScript, Python, Go, Rust, Java, C/C++, Ruby, C#, PHP, Kotlin, Scala, Elixir

Config files: JSON, YAML, TOML, .env

CLI Usage

Search for code elements:

tree-sitter-mcp search "DatabaseManager" --exact
tree-sitter-mcp search "handle.*Request" --type function method

Find usage of identifiers:

tree-sitter-mcp find-usage "UserService" --exact
tree-sitter-mcp find-usage "API_KEY" --case-sensitive

Analyze code quality:

tree-sitter-mcp analyze --analysis-types quality structure deadcode
tree-sitter-mcp analyze src/components --analysis-types quality

Find syntax errors:

tree-sitter-mcp errors --output text
tree-sitter-mcp errors src/components --max-results 10

Setup MCP integration:

tree-sitter-mcp setup --auto
tree-sitter-mcp setup  # Manual setup instructions

MCP Tools

When used as an MCP server, provides these tools for AI assistants:

  • search_code - Search for functions, classes, variables by name
  • find_usage - Find all usages of identifiers across the project
  • analyze_code - Comprehensive code quality and structure analysis
  • check_errors - Find actionable syntax errors with detailed context

See the full documentation for detailed API reference.

Installation Requirements

This package includes native components requiring build tools:

  • Windows: Visual Studio Build Tools or npm install --global windows-build-tools
  • macOS: Xcode Command Line Tools (xcode-select --install)
  • Linux: sudo apt-get install build-essential (Ubuntu/Debian)

Contributing

We welcome contributions! Please see our Contributing Guide for details.

License

GPL-3.0

Acknowledgments

Built with Tree-Sitter and the Model Context Protocol.