CM

cartographai/mcp-server-codegraph

开发工具官方

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

22 stars 8 forks 质量 56 趋势 0MIT

用于代码库图表示的MCP服务器

概览

一个模型上下文协议服务器,提供工具,用于生成和查询代码库中的图表示。 - 📊 创建代码库的图表示 - 🔍 识别实体(函数、类、导入)及其关系 - 🔗 跟踪函数调用、继承和实现等关系 - 🌐 支持多种编程语言(Python、JavaScript、Rust) - - 索引代码库以创建实体和关系的图。- - 提供指定文件中所有实体的列表。- 路径(字符串):文件的相对路径- - 列出特定实体的关系- 输入- 路径(字符串):文件的相对路径- 名称(字符串):实体名称 把这件事记进你的claude_desktop_config.json

概述(AI 翻译)

一个模型上下文协议服务器,提供工具,用于生成和查询代码库中的图表示。

特色

  • 📊 创建代码库的图形表示
  • 🔍 识别实体(函数、类、导入)及其关系
  • 🔗 跟踪函数调用、继承和实现等关系
  • 🌐 支持多种编程语言(Python、JavaScript、Rust)

工具

  • 索引
  • 索引代码库以创建实体和关系的图。
  • list_file_entities
  • 提供指定文件中所有实体的列表。
  • path(字符串):文件的相对路径
  • list_entity_relationships
  • 列出特定实体的关系
  • 输入
  • path(字符串):文件的相对路径
  • name(字符串):实体名称

用途

克劳德桌面

把这个加到你的claude_desktop_config.json

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

README

mcp-server-codegraph

A Model Context Protocol server that provides tools to generate and query a graph representation in your codebase.

Features

  • 📊 Creates a graph representation of your codebase
  • 🔍 Identifies entities (functions, classes, imports) and their relationships
  • 🔗 Tracks relationships like function calls, inheritance, and implementations
  • 🌐 Supports multiple programming languages (Python, JavaScript, Rust)

Tools

  • index
    • Indexes the codebase to create a graph of entities and relationships.
  • list_file_entities
    • Provides a list of all entities within a specified file.
      • path (string): relative path of the file
  • list_entity_relationships
    • List the relationships of a specific entity
    • Inputs
      • path (string): relative path of the file
      • name (string): name of entity

Usage

npx @cartographai/mcp-server-codegraph /path/to/directory

Claude Desktop

Add this to your claude_desktop_config.json

{
  "mcpServers": {
    "codegraph": {
      "command": "npx",
      "args": [
        "-y",
        "@cartographai/mcp-server-codegraph",
        "/path/to/directory",
      ]
    }
  }
}
在 GitHub 查看完整 README

安装

npx -y @cartographai/mcp-server-codegraph /path/to/directory
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "codegraph": { "command": "npx", "args": [ "-y", "@cartographai/mcp-server-codegraph", "/path/to/directory", ] } } }