Skip to main content
Glama
nendotools

Tree-Sitter MCP

by nendotools

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"
    }
  }
}

Related MCP server: CodeGraph MCP Server

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.

A
license - permissive license
-
quality - not tested
D
maintenance

Maintenance

Maintainers
Response time
3dRelease cycle
12Releases (12mo)
Commit activity
Issues opened vs closed

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    -
    quality
    D
    maintenance
    Enables semantic code search across projects using AI embeddings to find code by meaning rather than just text matching. Provides fast intelligent search, symbol analysis, and code similarity detection with multi-language support.
    Last updated
    MIT
  • F
    license
    -
    quality
    D
    maintenance
    Enables querying and analyzing code relationships by building a lightweight graph of TypeScript and Python symbols. Supports symbol lookup, reference tracking, impact analysis from diffs, and code snippet retrieval through natural language.
    Last updated
  • A
    license
    A
    quality
    F
    maintenance
    Enables semantic code search across codebases with automatic incremental indexing. Searches return relevant code snippets with file paths and line numbers based on natural language queries.
    Last updated
    1
    810
    Apache 2.0

View all related MCP servers

Related MCP Connectors

  • Enterprise code intelligence for M&A, security audits, and tech debt. Hosted server with 200k free.

  • Search public open-source code, documentation, metadata, vulnerabilities, changelogs, and examples.

  • AI Agent with Architectural Memory. Impact analysis (free), tests and code from the graph (pro).

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/nendotools/tree-sitter-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server