Tree-Sitter MCP

Tree-Sitter MCP

Enables fast semantic code search and analysis across 15+ programming languages. Supports searching for functions and classes, tracing code usage, detecting syntax errors, and analyzing code quality and structure.

Category
Visit Server

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.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured