AC

ab498/code-context-provider-mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

20 stars 7 forks 质量 62 趋势 0MIT

MCP服务器为AI助手提供代码上下文和分析。使用WebAssembly树置解析器,零原生依赖,提取目录结构和代码符号。

概览

- 生成目录树结构 - 分析JavaScript/TypeScript和Python文件 - 提取代码符号(函数、变量、类、导入、导出)- 兼容MCP协议,实现与AI助手的无缝集成 通过Smithery自动安装Claude Desktop的Code Context Provider: 分析目录并返回其结构及代码符号(可选)。 参数:- absolutePath(字符串,必需):指向要分析目录的绝对路径 - analyzeJs(布尔值,可选):是否分析JavaScript/TypeScript和Python文件(默认:false)- includeSymbols(布尔函数,可选):是否在响应中包含代码符号(默认:false)- symbolType(枚举,可选):如果includeSymbols为真,应包含的符号类型(选项:“functions”、“variables”、“classes”、“imports”、“exports”、“all”,默认:“all”) - filePatterns(字符串数组,可选):分析文件模式(例如['.js', '.py', 'config.

概述(AI 翻译)

MCP 服务器,为 AI 助手提供代码上下文和分析。使用 WebAssembly 树状分析器,零原生依赖,提取目录结构和代码符号。


特色

  • 生成目录树结构
  • 分析JavaScript/TypeScript和Python文件
  • 提取代码符号(函数、变量、类、导入、导出)
  • 兼容MCP协议,实现与AI助手的无缝集成

快速使用(MCP设置)

通过Smithery安装

通过Smithery自动安装Claude Desktop的Code Context Provider:

Windows

MacOS/Linux

或者全局安装 npm:

然后通过运行它来使用:

可用工具

get_code_context

分析目录并返回其结构及代码符号(可选)。

参数:

  • absolutePath(字符串,必需):分析目录的绝对路径
  • analyzeJs(布尔值,可选):是否分析JavaScript/TypeScript和Python文件(默认:false)
  • includeSymbols(布尔值,可选):是否在响应中包含代码符号(默认:false)

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

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)
在 GitHub 查看完整 README

安装

npx -y code-context-provider-mcp@latest
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "code-context-provider-mcp": { "command": "cmd.exe", "args": [ "/c", "npx", "-y", "code-context-provider-mcp@latest" ] } } }