Code Context Provider

Code Context Provider

ab498

Analyzes project directories to extract code structure and symbols from JavaScript, TypeScript, and Python files using Tree-sitter parsers. Generates directory trees and provides detailed code analysis for AI assistants.

Analyzes project directories to extract code structure and symbols using Tree-sitter parsers, providing tools for generating directory trees and performing deep code analysis of JavaScript, TypeScript, and Python files.

22571 views8Local (stdio)

What it does

  • Generate directory tree structure
  • Extract code symbols from JS/TS/Python files
  • Analyze functions, classes, variables, and imports
  • Get complete project context overview
  • Parse code without native dependencies

Best for

AI assistants understanding codebasesCode review and analysis workflowsProject documentation generationOnboarding developers to new projects
Zero native dependencies via WebAssemblyTree-sitter powered parsing

About Code Context Provider

Code Context Provider is a community-built MCP server published by ab498 that provides AI assistants with tools and capabilities via the Model Context Protocol. Analyze JavaScript, TypeScript, and Python projects with Code Context Provider—advanced static code analysis and source It is categorized under developer tools. This server exposes 1 tool that AI clients can invoke during conversations and coding sessions.

How to install

You can install Code Context Provider in your AI client of choice. Use the install panel on this page to get one-click setup for Cursor, Claude Desktop, VS Code, and other MCP-compatible clients. This server runs locally on your machine via the stdio transport.

License

Code Context Provider is released under the MIT license. This is a permissive open-source license, meaning you can freely use, modify, and distribute the software.

Tools (1)

get_code_context

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.

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

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 claude

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"
      ]
    }
  }
}

OR install globally with npm:

npm install -g code-context-provider-mcp

Then 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/macos

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 analyze
  • analyzeJs (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 subdirectories
  • maxDepth: 3 - Analyze the root, and two levels of subdirectories
  • maxDepth: 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-setup

License

MIT

For more information or help

Alternatives

Related Skills

Browse all skills
building-mcp-server-on-cloudflare

Builds remote MCP (Model Context Protocol) servers on Cloudflare Workers with tools, OAuth authentication, and production deployment. Generates server code, configures auth providers, and deploys to Workers. Use when: user wants to "build MCP server", "create MCP tools", "remote MCP", "deploy MCP", add "OAuth to MCP", or mentions Model Context Protocol on Cloudflare. Also triggers on "MCP authentication" or "MCP deployment".

4
satori

Persistent long term memory for for continuity in ai sessions between providers and codegen tools. TRIGGERS - Activate this skill when: - User explicitly mentions "satori", "remember this", "save", "add", "save this for later", "store this", "add to memory" - User asks to recall/search past decisions: "what did we decide", "remind me", "search my notes", "what do I know about" - Conversation contains notable facts worth persisting: decisions, preferences, deadlines, names, tech stack choices, strategic directions - Starting a new conversation where proactive context retrieval would help - Use Satori search when user asks a question

1
skill-sync

Syncs Claude Skills with other AI coding tools like Cursor, Copilot, and Codeium by creating cross-references and shared knowledge bases. Invoke when user wants to leverage skills across multiple tools or create unified AI context.

10
mcp-manager

Manage MCP (Model Context Protocol) servers in Claude Code projects. Use this skill when the user requests enabling, installing, disabling, or removing specific MCP servers like context7 or chrome-devtools. Always operates at project level (local scope only).

7
n8n-mcp-orchestrator

Expert MCP (Model Context Protocol) orchestration with n8n workflow automation. Master bidirectional MCP integration, expose n8n workflows as AI agent tools, consume MCP servers in workflows, build agentic systems, orchestrate multi-agent workflows, and create production-ready AI-powered automation pipelines with Claude Code integration.

6
ai-sdk

Answer questions about the AI SDK and help build AI-powered features. Use when developers: (1) Ask about AI SDK functions like generateText, streamText, ToolLoopAgent, embed, or tools, (2) Want to build AI agents, chatbots, RAG systems, or text generation features, (3) Have questions about AI providers (OpenAI, Anthropic, Google, etc.), streaming, tool calling, structured output, or embeddings, (4) Use React hooks like useChat or useCompletion. Triggers on: "AI SDK", "Vercel AI SDK", "generateText", "streamText", "add AI to my app", "build an agent", "tool calling", "structured output", "useChat".

6