Code Context Provider MCP
Поставщик контекста кода MCP
MCP-сервер, который предоставляет контекст кода и анализ для помощников ИИ. Извлекает структуру каталогов и символы кода с помощью парсеров WebAssembly Tree-sitter с нулевыми собственными зависимостями.
Функции
Создать структуру дерева каталогов
Анализ файлов JavaScript/TypeScript и Python
Извлечение символов кода (функций, переменных, классов, импорта, экспорта)
Совместимость с протоколом MCP для бесшовной интеграции с помощниками на базе искусственного интеллекта
Related MCP server: syntax-map-mcp
Быстрое использование (настройка MCP)
Установка через Smithery
Чтобы автоматически установить Code Context Provider для Claude Desktop через Smithery :
npx -y @smithery/cli install @AB498/code-context-provider-mcp --client claudeОкна
{
"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"
]
}
}
}ИЛИ установите глобально с помощью npm :
npm install -g code-context-provider-mcpЗатем используйте его, выполнив:
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Доступные инструменты
get_code_context
Анализирует каталог и возвращает его структуру вместе с кодовыми символами (необязательно).
Параметры:
absolutePath(строка, обязательно): Абсолютный путь к каталогу для анализа.analyzeJs(логическое значение, необязательно): следует ли анализировать файлы JavaScript/TypeScript и Python (по умолчанию: false)includeSymbols(логическое значение, необязательно): включать ли символы кода в ответ (по умолчанию: false)symbolType(enum, необязательно): Тип символов, которые следует включить, если includeSymbols имеет значение true (параметры: «functions», «variables», «classes», «imports», «exports», «all», по умолчанию: «all»)filePatterns(массив строк, необязательно): шаблоны файлов для анализа (например, [' .js', ' .py', 'config.*'])maxDepth(число, необязательно): максимальная глубина каталога для анализа (по умолчанию: 5 уровней)
Примечание: анонимные функции автоматически отфильтровываются из результатов.
Пример выходного текста при вызове инструмента
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]Примеры шаблонов файлов
Вы можете использовать параметр filePatterns , чтобы указать, какие файлы анализировать. Это полезно для сложных проектов с несколькими языками или определенными интересующими файлами.
Примеры:
["*.js", "*.py"]- Анализ всех файлов JavaScript и Python["config.*"]- Анализ всех файлов конфигурации независимо от расширения["package.json", "*.config.js"]- Анализ package.json и любых файлов конфигурации JavaScript[".ts", ".tsx", ".py"]- Анализ файлов TypeScript и Python (используя формат расширения)
Сопоставление шаблонов файлов поддерживает:
Простые шаблоны глобусов с подстановочными знаками (*)
Прямые расширения файлов (с точкой или без)
Точные имена файлов
Реализация крупных проектов
Для очень больших проектов можно использовать параметр maxDepth , чтобы ограничить глубину обхода каталогов инструментом:
maxDepth: 2— анализировать только корневой каталог и один уровень подкаталоговmaxDepth: 3— Анализ корня и двух уровней подкаталоговmaxDepth: 0— анализировать только файлы в корневом каталоге
Это особенно полезно, когда:
Работа с большими монорепозиториями
Анализ проектов со множеством зависимостей
Сосредоточение внимания только на основном исходном коде, а не на сторонних библиотеках
Поддерживаемые языки
Анализ символов кода поддерживается для:
JavaScript (.js)
JSX (.jsx)
TypeScript (.ts)
TSX (.tsx)
Питон (.py)
Использование параметра filePatterns позволяет включать другие типы файлов в структуру каталогов, хотя символьный анализ может быть ограничен.
Разработка
Настройка среды разработки
# 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После установки
После установки автоматически запускается скрипт prepare пакета для загрузки парсеров WASM. Если по какой-то причине загрузка не удалась, пользователи могут вручную запустить установку:
npx code-context-provider-mcp-setupЛицензия
Массачусетский технологический институт
Для получения дополнительной информации или помощи
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.
Inputs: absolutePath (required), analyzeJs, includeSymbols, maxDepth, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 1 tool
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
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.
Ask a codebase what calls what: search, blast radius, paths between symbols, and diffs.
Related MCP Servers
- AlicenseAqualityCmaintenanceEnables 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
- AlicenseCqualityDmaintenanceEnables 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.2113 npmMIT
- AlicenseNot gradedqualityDmaintenanceProvides 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.14 npm1MIT
- FlicenseAqualityDmaintenanceEnables token-efficient structural code exploration using tree-sitter AST parsing, with tools for symbol search, outlines, source unfolding, call graphs, and related-file discovery.1-