Token导航 LogoToken导航

MCP Server · 搜索检索

SourceSage MCP

MCP server to cache codebase as graph

stdio官方级别未说明来源级核验工具 11
代码分析知识图谱PythonClaude代码管理

快速开始

作者 / 组织
sarathsp06
提供方
sarathsp06
运行时
Python

工具数量

11

来源目录标注

资源数量

0

来源目录标注

提示词数量

0

来源目录标注

GitHub Star

7

仓库热度

收录来源

4 个

MCP.so

选型结论

SourceSage MCP 属于搜索检索类 MCP Server,公开资料标注 11 个工具,通过stdio 本地进程接入,适配 Claude,有可以直接复制的安装命令;接入前先确认权限范围。

分类

搜索检索

传输方式

stdio

认证方式

无需认证

部署方式

公开资料未说明

安装与配置

安装命令

uv --directory /path/to/sourcesage run main.py {}

公开命令不是通用的启动方式,拼不出可靠配置示例;请在客户端 MCP 配置里按官方文档填写 command 和 args。

上手步骤

  1. 1

    准备运行环境

    stdio 服务在本地起进程,需要先装好 Python,再按安装命令拉取依赖。

  2. 2

    安装服务

    复制下面的安装命令执行;命令里带占位符的位置换成自己的密钥或路径。

  3. 3

    写入客户端配置

    在客户端的 MCP 配置里填启动命令和参数,保存后完全退出客户端再打开,让新配置生效。

  4. 4

    验证是否可用

    连接成功后客户端会列出 11 个工具,随便调一个只读工具确认能返回结果。

接入前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

详细介绍

SourceSage:LLM的高效代码存储

SourceSage是一个MCP(模型上下文协议)服务器,可以有效地记忆代码库的关键方面——逻辑、风格和标准——同时允许动态更新和快速检索。它被设计为与语言无关,利用LLM对多种语言代码的理解。

特性

  • 语言无关:适用于LLM理解的任何编程语言
  • 知识图谱存储:高效地存储代码实体、关系、模式和样式约定
  • LLM驱动分析:依靠LLM分析代码并提供见解
  • 令牌高效存储:优化以最小化令牌使用,同时最大限度地提高内存容量
  • 增量更新:在没有冗余存储的情况下,当代码更改时更新知识
  • 快速检索:能够快速准确地检索相关信息

运作原理

SourceSage采用了一种新颖的方法,其中:

  1. LLM分析代码文件(任何语言)
  2. LLM使用MCP工具来注册实体、关系、模式和样式约定
  3. SourceSage将此知识存储在令牌高效的图结构中
  4. LLM稍后可以在需要时查询这些知识

这种方法利用了LLM固有的语言理解能力,同时使MCP服务器专注于高效的内存管理。

安装

# Clone the repository
git clone https://github.com/yourusername/sourcesage.git
cd sourcesage

# Install the package
pip install -e .

用法

运行MCP服务器

# Run the server
sourcesage

# Or run directly from the repository
python -m sourcesage.mcp_server

连接到Claude for Desktop

  1. 打开Claude桌面版
  2. 前往“设置”>“开发人员”>“编辑配置”
  3. 将以下内容添加到您的 claude_desktop_config.json:

如果您已安装该软件包:

{
  "mcpServers": {
    "sourcesage": {
      "command": "sourcesage",
      "args": []
    }
  }
}

如果您从本地目录运行而未安装:

{
  "sourcesage": {
      "command": "uv", 
      "args": [
        "--directory",
        "/path/to/sourcesage",
        "run",
        "main.py"
      ]
    },
}
  1. 重新启动桌面版的Claude

可用工具

SourceSage提供以下MCP工具:

  1. 注册实体:在知识图中注册代码实体
   Input:
     - name: Name of the entity (e.g., class name, function name)
     - entity_type: Type of entity (class, function, module, etc.)
     - summary: Brief description of the entity
     - signature: Entity signature (optional)
     - language: Programming language (optional)
     - observations: List of observations about the entity (optional)
     - metadata: Additional metadata (optional)
   Output: Confirmation message with entity ID
  1. 注册表关系:注册实体之间的关系
   Input:
     - from_entity: Name of the source entity
     - to_entity: Name of the target entity
     - relationship_type: Type of relationship (calls, inherits, imports, etc.)
     - metadata: Additional metadata (optional)
   Output: Confirmation message with relationship ID
  1. 寄存器_模式:注册代码模式
   Input:
     - name: Name of the pattern
     - description: Description of the pattern
     - language: Programming language (optional)
     - example: Example code demonstrating the pattern (optional)
     - metadata: Additional metadata (optional)
   Output: Confirmation message with pattern ID
  1. 注册表_样式_约定:注册编码样式约定
   Input:
     - name: Name of the convention
     - description: Description of the convention
     - language: Programming language (optional)
     - examples: Example code snippets demonstrating the convention (optional)
     - metadata: Additional metadata (optional)
   Output: Confirmation message with convention ID
  1. add_entity_observation:向实体添加观察
   Input:
     - entity_name: Name of the entity
     - observation: Observation to add
   Output: Confirmation message
  1. 查询项:查询知识图中的实体
   Input:
     - entity_type: Filter by entity type (optional)
     - language: Filter by programming language (optional)
     - name_pattern: Filter by name pattern (regex, optional)
     - limit: Maximum number of results to return (optional)
   Output: List of matching entities
  1. get_entity_details:获取有关实体的详细信息
   Input:
     - entity_name: Name of the entity
   Output: Detailed information about the entity
  1. 查询模式:查询知识图中的代码模式
   Input:
     - language: Filter by programming language (optional)
     - pattern_name: Filter by pattern name (optional)
   Output: List of matching patterns
  1. query_style_conventions:查询编码样式约定
   Input:
     - language: Filter by programming language (optional)
     - convention_name: Filter by convention name (optional)
   Output: List of matching style conventions
  1. 获取知识_统计:获取知识图谱的统计数据
   Input: None
   Output: Statistics about the knowledge graph
  1. 清除知识:清除图表中的所有知识
   Input: None
   Output: Confirmation message

Claude工作流示例

  1. 分析代码:请Claude分析您的代码文件
   "Please analyze this Python file and register the key entities and relationships."
  1. 注册实体:Claude将使用register_instance工具存储代码实体
   "I'll register the main class in this file."
  1. 注册关系:Claude将使用register_relations工具存储关系
   "I'll register the inheritance relationship between these classes."
  1. 查询知识:稍后,问克劳德你的代码库
   "What classes are defined in my codebase?"
   "Show me the details of the User class."
   "What's the relationship between the User and Profile classes?"
  1. 获取编码模式:向Claude询问编码模式
   "What design patterns are used in my codebase?"
   "Show me examples of the Factory pattern in my code."

这有什么不同

与传统的代码分析工具不同,SourceSage:

  1. 利用LLM理解:利用LLM跨语言理解代码语义的能力
  2. 存储语义知识:注重意义和关系,而不仅仅是语法
  3. 语言是不可知的吗:适用于LLM理解的任何编程语言
  4. 优化令牌效率:以最小化令牌使用的方式存储知识
  5. 随着LLM能力的发展而发展:随着LLM的改进,代码理解能力也在提高

贡献

欢迎投稿!请随时提交拉取请求。

许可证

此项目根据MIT许可证获得许可-有关详细信息,请参阅许可证文件。

工具与能力

工具数量

11

资源数量

0

提示词数量

0

能力标签

research-and-datasourcesagecode-memoryllm代码分析Python本地部署知识图谱

支持客户端

Claude

数量来自来源目录的标注,具体工具清单以官方文档为准。

典型使用场景

查资料带出处

把网页、论文和文档的检索结果连同链接一起带回对话。

站内知识检索

在自己的文档库里做语义搜索,比关键词更贴题。

事实核对

交叉多个来源确认一条信息,减少模型凭记忆作答。

选择建议

值得选的地方

  • 工具数量 11 个,一次接入能覆盖的操作比单点工具更全。
  • 有现成的安装命令,不用自己找入口,照着跑就能起服务。
  • 4 个目录同时收录,信息可以交叉核对。

先想清楚的地方

  • stdio 方式要求本地装好 Python,换机器要重新装一遍。
  • 公开摘要偏短,具体能力和限制要回到仓库确认。
  • 第三方目录整理,版本更新和行为细节以官方仓库为准。

更适合

  • 需要在搜索检索场景里让模型直接调用外部能力的人。
  • 已经在用 Claude 的用户,接入路径最短。
  • 想先快速试一下、能接受在本地跑服务的人。

不太适合

  • 完全不想在本地装环境的人。
  • 需要厂商级 SLA 和技术支持的生产环境。

同类对比

5 个同类
MCP Server工具数传输方式安装命令收录来源最后核验
SourceSage MCP

MCP.so · 本页

11stdio有4 个2026-05-17
Baidu Netdisk

MCP World

未标注未说明未标注1 个2026-05-17
Sequentialthinking

MCP.so

1SSE有2 个2026-05-17
Brave Search 433812ff

MCP World

2未说明未标注1 个2026-05-17
mindsdb (430e18)

MCP World

0未说明有1 个2026-05-17

按同分类和工具数量挑出最接近的几条,字段以各自详情页为准。

常见问题

5 条

SourceSage MCP 怎么安装?

公开资料给出的安装命令是 uv --directory /path/to/sourcesage run main.py {},运行环境为 Python。装完后按客户端要求写进 MCP 配置,重启客户端生效。

SourceSage MCP 怎么在 Claude Desktop、Cursor 里配置?

它是stdio 本地进程,客户端配置里要写启动命令和参数,运行环境是 Python;保存后完全退出客户端再打开,配置才会生效。

SourceSage MCP 收费吗?

本站只整理公开资料,不代收费用,也没有标注具体价格。是否收费取决于服务本身和背后的接口额度,正式使用前按官方说明确认。

SourceSage MCP 需要 API Key 吗?

公开资料标注为无需认证,装好就能连;如果实际调用时报鉴权错误,按官方文档补上凭据。

SourceSage MCP 支持哪些客户端?

公开资料标注支持 Claude;其他客户端只要能配置 MCP Server,也能用同样的命令或地址接入。

来源信息

继续浏览同类 MCP