The Code Context Provider MCP server extracts and analyzes code context for AI assistants, providing:
Directory Tree Generation: Retrieve project structure with customizable depth
Code Symbol Analysis: Extract functions, variables, classes, imports, and exports from JavaScript/TypeScript and Python files
Customization Options: Control analysis depth, filter files using glob patterns, and select specific symbol types
Integration Features: Compatible with the MCP protocol for AI assistant integration
Performance Optimization: Limit analysis depth for handling large projects/monorepos
Cross-Platform: Works on Windows, MacOS, and Linux
Summary Reports: Provides counts of different symbol types in analyzed files
Provides community support through Discord, with a server link for users to get help with the MCP integration.
Provides code symbol analysis for JavaScript files, extracting functions, variables, classes, imports, and exports to help AI assistants understand code structure.
Enables symbol extraction and analysis from Python files, providing AI assistants with contextual understanding of Python code structure.
Analyzes TypeScript files to extract code symbols including functions, variables, classes, imports, and exports for improved code context.
Uses WebAssembly Tree-sitter parsers with zero native dependencies to efficiently parse and analyze code across multiple languages.
Code Context Provider MCP
MCP server that provides code context and analysis for AI assistants. Extracts directory structure and code symbols using WebAssembly Tree-sitter parsers with Zero Native Dependencies.
Features
Generate directory tree structure
Analyze JavaScript/TypeScript and Python files
Extract code symbols (functions, variables, classes, imports, exports)
Compatible with the MCP protocol for seamless integration with AI assistants
Related MCP server: Document Automation MCP Server
Quick Usage (MCP Setup)
Installing via Smithery
To install Code Context Provider for Claude Desktop automatically via Smithery:
Windows
MacOS/Linux
OR install globally with npm:
Then use it by running:
Available Tools
get_code_context
Analyzes a directory and returns its structure along with code symbols (optional).
Parameters:
absolutePath(string, required): Absolute path to the directory to analyzeanalyzeJs(boolean, optional): Whether to analyze JavaScript/TypeScript and Python files (default: false)includeSymbols(boolean, optional): Whether to include code symbols in the response (default: false)symbolType(enum, optional): Type of symbols to include if includeSymbols is true (options: 'functions', 'variables', 'classes', 'imports', 'exports', 'all', default: 'all')filePatterns(array of strings, optional): File patterns to analyze (e.g. ['.js', '.py', 'config.*'])maxDepth(number, optional): Maximum directory depth to analyze (default: 5 levels)
Note: Anonymous functions are automatically filtered out of the results.
Example Output Text On Tool Call
File Pattern Examples
You can use the filePatterns parameter to specify which files to analyze. This is useful for complex projects with multiple languages or specific files of interest.
Examples:
["*.js", "*.py"]- Analyze all JavaScript and Python files["config.*"]- Analyze all configuration files regardless of extension["package.json", "*.config.js"]- Analyze package.json and any JavaScript config files[".ts", ".tsx", ".py"]- Analyze TypeScript and Python files (using extension format)
The file pattern matching supports:
Simple glob patterns with wildcards (*)
Direct file extensions (with or without the dot)
Exact file names
Handling Large Projects
For very large projects, you can use the maxDepth parameter to limit how deeply the tool will traverse directories:
maxDepth: 2- Only analyze the root directory and one level of subdirectoriesmaxDepth: 3- Analyze the root, and two levels of subdirectoriesmaxDepth: 0- Only analyze files in the root directory
This is particularly useful when:
Working with large monorepos
Analyzing projects with many dependencies
Focusing only on the main source code and not third-party libraries
Supported Languages
Code symbol analysis is supported for:
JavaScript (.js)
JSX (.jsx)
TypeScript (.ts)
TSX (.tsx)
Python (.py)
Using the filePatterns parameter allows you to include other file types in the directory structure, though symbolic analysis may be limited.
Development
Setting up the Development Environment
Post-Installation
After installation, the package's prepare script automatically runs to download the WASM parsers. If for some reason the download fails, users can manually run the setup:
License
MIT