Provide Code Context for AI Assistants
Extracts directory structure and code symbols (functions, classes, variables) for AI assistants using dependency-free WebAssembly Tree-sitter parsers.
Why it matters
Enhance AI coding assistants by providing detailed code context, including directory structure and code symbols, extracted efficiently using WebAssembly Tree-sitter parsers.
Outcomes
What it gets done
Generate directory tree structures.
Extract code symbols (functions, variables, classes) from JavaScript, TypeScript, and Python files.
Filter code context based on file patterns and directory depth.
Integrate seamlessly with AI assistants via the MCP protocol.
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/vb-code-context-provider-mcp | bash Capabilities
Tools your agent gets
Analyzes a directory and returns its structure along with code symbols like functions, variables, and classes.
Overview
code-context-provider-mcp server
This MCP server analyzes a project directory and returns its structure plus extracted code symbols (functions, classes, variables, imports, exports) for JS/TS/Python files, using dependency-free WebAssembly Tree-sitter parsers. Use it when an AI assistant needs a quick structural overview of a codebase rather than reading every file. It only covers JavaScript, TypeScript, JSX/TSX, and Python.
What it does
code-context-provider-mcp is an MCP server that gives AI assistants code context and analysis by extracting a directory's structure and its code symbols using WebAssembly Tree-sitter parsers, with zero native dependencies. It exposes a single tool, get_code_context, which analyzes a directory and returns its structure alongside extracted symbols - functions, variables, classes, imports, and exports - while automatically filtering out anonymous functions.
When to use - and when NOT to
Use this when an AI assistant needs a fast, structural map of a codebase - directory layout plus the functions and classes defined in it - without reading every file's full contents. It supports JavaScript (.js), JSX (.jsx), TypeScript (.ts), TSX (.tsx), and Python (.py) files, with file-pattern filtering (glob wildcards, direct extensions, or exact filenames) and a configurable maximum depth to keep analysis efficient on large projects. It is not a general-purpose code reader for other languages beyond the JS/TS/Python family it parses.
Inputs and outputs
Input: a target directory, an optional file-pattern filter, and an optional max-depth setting. Output: the directory tree structure plus, for each matched file, the extracted code symbols. Example usage:
Analyze the directory structure of my project
Extract all functions and classes from my JavaScript files
Get code context for files matching specific patterns like *.js and *.py
Analyze only the top 2 levels of directories in my large project
Integrations
Install via Smithery:
npx -y @smithery/cli install @AB498/code-context-provider-mcp --client claude
or globally via npm:
npm install -g code-context-provider-mcp
MCP client configuration (macOS/Linux):
{
"mcpServers": {
"code-context-provider-mcp": {
"command": "npx",
"args": ["-y", "code-context-provider-mcp@latest"]
}
}
}
On Windows, use cmd.exe /c npx -y code-context-provider-mcp@latest as the command/args. If the bundled WASM parser fails to download during install, it can be fetched manually with npx code-context-provider-mcp-setup.
Who it's for
Developers using AI coding assistants who want fast, structural context about a codebase - directory layout and symbol inventories - without native build dependencies getting in the way of installation.
Source README
An MCP server that provides code context and analysis for AI assistants by extracting directory structure and code symbols using WebAssembly Tree-sitter parsers with zero native dependencies.
Installation
Smithery
npx -y @smithery/cli install @AB498/code-context-provider-mcp --client claude
NPM Global
npm install -g code-context-provider-mcp
Development Setup
git clone https://github.com/your-username/code-context-provider-mcp.git
cd code-context-provider-mcp
npm install
npm run setup
Configuration
Windows
{
"mcpServers": {
"code-context-provider-mcp": {
"command": "cmd.exe",
"args": [
"/c",
"npx",
"-y",
"code-context-provider-mcp@latest"
]
}
}
}
MacOS/Linux
{
"mcpServers": {
"code-context-provider-mcp": {
"command": "npx",
"args": [
"-y",
"code-context-provider-mcp@latest"
]
}
}
}
Available Tools
| Tool | Description |
|---|---|
get_code_context |
Analyzes a directory and returns its structure along with code symbols (functions, variables, classes...) |
Features
- Directory tree structure generation
- JavaScript/TypeScript and Python file analysis
- Code symbol extraction (functions, variables, classes, imports, exports)
- MCP protocol compatibility for seamless integration with AI assistants
- File pattern filtering support
- Configurable directory analysis depth
- Zero native dependencies thanks to WebAssembly Tree-sitter parsers
- Automatic anonymous function filtering
Usage Examples
Analyze the directory structure of my project
Extract all functions and classes from my JavaScript files
Get code context for files matching specific patterns like *.js and *.py
Analyze only the top 2 levels of directories in my large project
Resources
Notes
Supports JavaScript (.js), JSX (.jsx), TypeScript (.ts), TSX (.tsx), and Python (.py) files for code symbol analysis. File patterns support glob patterns with wildcards, direct file extensions, and exact file names. The maximum depth parameter helps efficiently handle large projects. If WASM parser loading fails during installation, users can manually run: npx code-context-provider-mcp-setup
FAQ
Common questions
Discussion
Questions & comments ยท 0
Sign In Sign in to leave a comment.