基本能力
产品定位
codelogic-mcp-server 是一个用于增强 AI 编程助手功能的工具服务器,专注于提供代码依赖和影响评估数据。
核心功能
- get-impact 工具:从 Codelogic 服务器的 API 中获取代码的影响评估,帮助开发者理解代码修改的潜在影响。
适用场景
- 代码修改评估:在修改代码时,评估修改对现有代码库的影响。
- AI 编程助手集成:与 AI 编程助手(如 Claude Desktop 或 Windsurf IDE)集成,提供实时的代码影响分析。
工具列表
- get-impact:
- 功能:获取代码的影响评估。
- 输入:需要指定“方法”及其关联的“类”。
常见问题解答
- 如何安装 Astral UV?:请参考 Astral UV 安装指南。
- 如何配置 Windsurf IDE?:需要修改
~/.codeium/windsurf/mcp_config.json
文件并添加全局规则。
使用教程
使用依赖
安装 Astral UV:
```bash
请参考 Astral UV 的官方安装指南
```
安装教程
Claude Desktop
在 MacOS 上:
bash
~/Library/Application\ Support/Claude/claude_desktop_config.json
在 Windows 上:
bash
%APPDATA%/Claude/claude_desktop_config.json
在 Linux 上:
bash
~/.config/Claude/claude_desktop_config.json
配置示例:
json
"mcpServers": {
"codelogic-mcp-server": {
"command": "uvx",
"args": [
"codelogic-mcp-server@latest"
],
"env": {
"CODELOGIC_SERVER_HOST": "<url to the server e.g. https://myco.app.codelogic.com>",
"CODELOGIC_USERNAME": "<my username>",
"CODELOGIC_PASSWORD": "<my password>",
"CODELOGIC_MV_NAME": "<my marterialized view>"
}
}
}
Windsurf IDE
配置 ~/.codeium/windsurf/mcp_config.json
:
json
"mcpServers": {
"codelogic-mcp-server": {
"command": "uvx",
"args": [
"codelogic-mcp-server@latest"
],
"env": {
"CODELOGIC_SERVER_HOST": "<url to the server e.g. https://myco.app.codelogic.com>",
"CODELOGIC_USERNAME": "<my username>",
"CODELOGIC_PASSWORD": "<my password>",
"CODELOGIC_MV_NAME": "<my marterialized view>"
}
}
}
添加全局规则到 ~/.codeium/windsurf/memories/global_rules.md
:
markdown
When I ask you to modify existing code, try running the get-impact mcp tool against the code I've provided and any methods or functions that you are changing. Make sure the results sent back from the tool are highlighted as impacts for the given method or function.
调试方式
运行单元测试
bash
python -m unittest discover -s test -p "unit_*.py"
运行集成测试(可选)
- 复制
test/.env.test.example
到test/.env.test
并填写 Codelogic 服务器详细信息。 - 运行集成测试:
bash
python -m unittest discover -s test -p "integration_*.py"