Code Context Provider MCP
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.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Code Context Provider MCPanalyze the src directory and include all symbols"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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: syntax-map-mcp
Quick Usage (MCP Setup)
Installing via Smithery
To install Code Context Provider for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @AB498/code-context-provider-mcp --client claudeWindows
{
"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"
]
}
}
}OR install globally with npm:
npm install -g code-context-provider-mcpThen use it by running:
code-context-provider-mcp # if you're not using @latest, you may want to clear the cache for latest version using `Remove-Item -Path "$env:LOCALAPPDATA\npm-cache\_npx" -Recurse -Force` for windows and `rm -rf ~/.npm/_npx` for linux/macosAvailable 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
Directory structure for: C:\Users\Admin\Desktop\mcp\context-provider-mcp
Code Analysis Summary:
- Files analyzed: 3
- Total functions: 29
- Total variables: 162
- Total classes: 0
Note: Symbol analysis is supported for JavaScript/TypeScript (.js, .jsx, .ts, .tsx) and Python (.py) files only.
Code analysis limited to a maximum depth of 5 directory levels (default).
├── index.js (39 KB)
│ └── [Analyzed: 22 functions, 150 variables, 0 classes]
│ Functions:
│ - initializeTreeSitter [39:0]
│ - getLanguageFromExtension [107:0]
│ - getPosition [138:24]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
[Development] Setting up the Development Environment
# Clone the repository
git clone https://github.com/your-username/code-context-provider-mcp.git
cd code-context-provider-mcp
# Install dependencies
npm install
# Set up WASM parsers
npm run setup[Development] 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:
npx code-context-provider-mcp-setupLicense
MIT
For more information or help
Available Tools
1 toolget_code_contextA
Returns Complete Context of a given project directory, including directory tree, and code symbols. Useful for getting a quick overview of a project. Use this tool when you need to get a comprehensive overview of a project's codebase. Useful at the start of a new task.
| Name | Required | Description | Default |
|---|---|---|---|
| absolutePath | Yes | Absolute path to the directory to analyze. For windows, it is recommended to use forward slashes to avoid escaping (e.g. C:/Users/username/Documents/project/src) | |
| analyzeJs | No | Whether to analyze JavaScript/TypeScript and Python files. Returns the count of functions, variables, classes, imports, and exports in the codebase. | |
| includeSymbols | No | Whether to include code symbols in the response. Returns the code symbols for each file. | |
| maxDepth | No | Maximum directory depth for code analysis (default: 5 levels). Directory tree will still be built for all levels. Reduce the depth if you only need a quick overview of the project. | |
| symbolType | No | Type of symbols to include if includeSymbols is true. Otherwise, returns only the directory tree. | all |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It describes what the tool returns (context, directory tree, code symbols) and its usefulness for project overviews, but lacks details on performance, error handling, or specific output format. This provides basic behavioral context but leaves gaps for a tool with 5 parameters.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is appropriately sized with three sentences that each add value: stating the tool's purpose, its usefulness for overviews, and when to use it. It is front-loaded with the core functionality. A minor deduction for slight redundancy ('useful' appears twice).
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (5 parameters, no output schema, no annotations), the description is moderately complete. It covers the purpose and usage context but lacks details on output format, error cases, or performance considerations. Without an output schema, more guidance on return values would be beneficial for full contextual understanding.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema description coverage is 100%, so the schema fully documents all 5 parameters. The description does not add any parameter-specific semantics beyond what the schema provides, such as explaining interactions between parameters like analyzeJs and includeSymbols. The baseline score of 3 reflects adequate but not enhanced parameter understanding.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose with specific verbs ('returns complete context') and resources ('project directory, including directory tree, and code symbols'). It distinguishes the tool's comprehensive overview capability, which is well-defined even without sibling tools for comparison.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides clear context for when to use the tool ('useful for getting a quick overview of a project' and 'useful at the start of a new task'). However, it lacks explicit guidance on when not to use it or alternatives, as there are no sibling tools mentioned to differentiate from.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
1 tool update
v1.0.0- First observed
get_code_context
TDQS
With only one tool, there is no possibility of ambiguity or overlap between tools. The single tool has a clear and distinct purpose focused on providing project context.
The naming follows a consistent verb_noun pattern (get_code_context), and with only one tool, there is no inconsistency to evaluate. The naming is clear and descriptive.
A single tool is generally too few for most MCP server purposes, as it limits functionality and can feel thin. For a 'Code Context Provider', one tool may not cover all potential needs like updating or filtering context, making it borderline inadequate.
The tool set is severely incomplete for the implied domain of code context provision. While it offers a comprehensive overview, there are obvious gaps such as tools for updating context, filtering by file type, or handling specific symbols, which could lead to agent workarounds or failures.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Code intelligence for LLMs. Analyze, search, and retrieve code from any public git repository.
Code intelligence for coding agents: semantic, AST, graph, and full-text search. 279+ languages.
Deterministic context layer for your codebase: change impact, blast radius, answers with receipts.
Ground-truth code graph for your codebase: exact callers, callees, symbols & dependencies.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables AI assistants to understand and navigate codebases through structural analysis. Provides code mapping, symbol search, and impact analysis using ast-grep for accurate parsing of Python, JavaScript, TypeScript, and Go projects.452MIT
- AlicenseNot gradedqualityDmaintenanceEnables code analysis of JavaScript, TypeScript, TSX, Python, and Rust files using Tree-sitter, providing symbol listing, definition/reference lookup, AST queries, LSP-style features, and SQLite indexing for efficient cross-file searches.15MIT
- AlicenseNot gradedqualityCmaintenanceProvides a semantic understanding of your codebase by parsing with tree-sitter and building a graph of symbols and dependencies. Enables AI assistants to navigate code, analyze changes, and discover architecture using 18 tools with minimal context overhead.221MIT
- AlicenseAqualityFmaintenanceA deterministic structural code map server for AI agents, giving them the shape of a codebase (imports, exports, classes, functions, signatures, comments, TODO-markers) without reading whole files into context. Powered by tree-sitter WASM grammars, it runs anywhere Node 18+ works.7121AGPL 3.0
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/AB498/code-context-provider-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server