Skip to content

MCP tools for Tree-sitter code analysis — parse, query, extract symbols and diagnose syntax errors

Notifications You must be signed in to change notification settings

wippy-projects/mcp-code-tools

Repository files navigation

Code Analysis Tools

MCP tools for Tree-sitter-powered source code analysis. Parse, query, extract symbols, and diagnose syntax errors across 11 programming languages.

Tools

Tool Description
code_languages List supported languages and capabilities
code_parse Parse code into a syntax tree (AST) at configurable depth
code_outline Structural overview: functions, types, imports, variables
code_symbols Flat symbol list with filtering by kind and name pattern
code_query Run custom Tree-sitter S-expression queries
code_diagnostics Detect syntax errors with positions and context

Input Modes

All tools (except code_languages) accept source code in two ways:

Direct code:

{"code": "func hello() {}", "language": "go"}

From project file (language auto-detected from extension):

{"path": "src/main.go", "project": "my-app"}

Supported Languages

Go, JavaScript, TypeScript, TSX, Python, Lua, PHP, C#, HTML, Markdown, SQL

Languages with query patterns (Go, JS/TS, Python, Lua, PHP, C#) support code_outline, code_symbols, and code_query. All languages support code_parse and code_diagnostics.

Architecture

code-tools/
├── _index.yaml          # Registry: tool definitions + MCP metadata
├── parser_lib.lua       # Shared: language detection, parsing, project resolution
├── queries_lib.lua      # Shared: language-specific Tree-sitter query patterns
├── code_languages.lua   # Tool: list supported languages
├── code_parse.lua       # Tool: syntax tree display
├── code_outline.lua     # Tool: structural outline
├── code_symbols.lua     # Tool: symbol extraction
├── code_query.lua       # Tool: custom queries
└── code_diagnostics.lua # Tool: syntax error detection

Dependencies

  • butschster/mcp-server — MCP tool discovery via mcp.tool registry meta
  • treesitter module — Tree-sitter parsing and query engine (built into Wippy)

About

MCP tools for Tree-sitter code analysis — parse, query, extract symbols and diagnose syntax errors

Resources

Stars

Watchers

Forks

Releases

No releases published

Languages