Skip to main content
Glama

Code Context Provider MCP

by AB498

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

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

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

Install Server
A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

local-only server

The server can only run on the client's local machine because it depends on local resources.

네이티브 종속성이 없는 WebAssembly Tree-sitter 파서를 사용하여 디렉토리 구조와 코드 심볼을 추출하여 AI 어시스턴트에 대한 코드 컨텍스트와 분석을 제공합니다.

  1. AI 어시스턴트에 코드 컨텍스트와 분석을 제공하는 MCP 서버입니다. 네이티브 종속성이 없는 WebAssembly 트리시터 파서를 사용하여 디렉터리 구조와 코드 심볼을 추출합니다.
    1. 특징
      1. 빠른 사용(MCP 설정)
        1. Smithery를 통해 설치
        2. 윈도우
        3. 맥OS/리눅스
      2. 사용 가능한 도구
        1. get_code_context
      3. 도구 호출 시 출력 텍스트 예
        1. 파일 패턴 예제
          1. 대규모 프로젝트 처리
            1. 지원 언어
              1. 개발
                1. 개발 환경 설정
                2. 설치 후
              2. 특허
                1. 더 많은 정보나 도움이 필요하시면

                  Related MCP Servers

                  • A
                    security
                    A
                    license
                    A
                    quality
                    Provides tools for collecting and documenting code from directories.
                    Last updated -
                    4
                    618
                    14
                    TypeScript
                    MIT License
                    • Apple
                    • Linux
                  • -
                    security
                    F
                    license
                    -
                    quality
                    Analyzes codebases to generate dependency graphs and architectural insights across multiple programming languages, helping developers understand code structure and validate against architectural rules.
                    Last updated -
                    11
                    JavaScript
                  • -
                    security
                    A
                    license
                    -
                    quality
                    A sophisticated server that enables AI assistants to automatically analyze codebases and generate comprehensive, professional documentation.
                    Last updated -
                    3
                    Python
                    MIT License
                    • Linux
                    • Apple
                  • A
                    security
                    A
                    license
                    A
                    quality
                    Provides AI assistants with persistent memory of your project architecture, development history, and technical decisions, allowing them to give context-aware coding help without needing repeated explanations.
                    Last updated -
                    16
                    61
                    1
                    TypeScript
                    MIT License
                    • Apple
                    • Linux

                  View all related MCP servers

                  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