Skip to main content
Glama

codelogic-mcp-服务器

MCP 服务器可在您的 AI 编程助手中利用 Codelogic 丰富的软件依赖数据。

成分

工具

服务器实现了两个工具:

  • codelogic-method-impact :从 CodeLogic 服务器的 API 中提取对您的代码的影响评估。

    • 采用您正在处理的给定“方法”及其相关的“类”。

  • codelogic-database-impact :分析代码和数据库实体之间的影响。

    • 采用数据库实体类型(列、表或视图)及其名称。

安装

先决条件

MCP 服务器依赖 Astral UV 运行,请安装

Related MCP server: DependencyMCP Server

不同 IDE 的配置

Visual Studio Code 配置

要在 VS Code 中配置此 MCP 服务器:

  1. 首先,确保您已在 VS Code 中启用 GitHub Copilot 代理模式。

  2. 在您的工作区中创建一个.vscode/mcp.json文件,并配置如下:

{ "servers": { "codelogic-mcp-server": { "type": "stdio", "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_WORKSPACE_NAME": "<my workspace>", "CODELOGIC_DEBUG_MODE": "true" } } } }

**注意:**在某些系统上,您可能需要使用 uvx 可执行文件的完整路径,而不仅仅是“uvx”。例如:Linux/Mac 上的/home/user/.local/bin/uvx或 Windows 上的C:\Users\username\AppData\Local\astral\uvx.exe

  1. 或者,您可以从命令面板运行MCP: Add Server命令并提供服务器信息。

  2. 要管理您的 MCP 服务器,请使用命令面板中的MCP: List Servers命令。

  3. 配置完成后,服务器的工具将可供 Copilot 代理模式使用。在代理模式下,您可以根据需要点击聊天视图中的“工具”按钮来启用/禁用特定工具。

  4. 要以代理模式使用 Codelogic 工具,您可以具体询问代码影响或数据库关系,代理将使用适当的工具。

Claude桌面配置

通过编辑配置文件来配置Claude Desktop:

  • 在 MacOS 上: ~/Library/Application\ Support/Claude/claude_desktop_config.json

  • 在 Windows 上: %APPDATA%/Claude/claude_desktop_config.json

  • 在 Linux 上: ~/.config/Claude/claude_desktop_config.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_WORKSPACE_NAME": "<my workspace>" } } }

**注意:**在某些系统上,您可能需要使用 uvx 可执行文件的完整路径,而不仅仅是“uvx”。例如:Linux/Mac 上的/home/user/.local/bin/uvx或 Windows 上的C:\Users\username\AppData\Local\astral\uvx.exe

添加配置后,重新启动 Claude Desktop 以应用更改。

Windsurf IDE 配置

要使用Windsurf IDE运行此 MCP 服务器:

配置 Windsurf IDE

要配置 Windsurf IDE,您需要创建或修改~/.codeium/windsurf/mcp_config.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_WORKSPACE_NAME": "<my workspace>" } } }

**注意:**在某些系统上,您可能需要使用 uvx 可执行文件的完整路径,而不仅仅是“uvx”。例如:Linux/Mac 上的/home/user/.local/bin/uvx或 Windows 上的C:\Users\username\AppData\Local\astral\uvx.exe

添加配置后,重新启动 Windsurf IDE 或刷新工具以应用更改。

游标配置

要在 Cursor 中配置 CodeLogic MCP 服务器:

  1. 通过创建.cursor/mcp.json文件来配置 MCP 服务器:

{ "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_WORKSPACE_NAME": "<my workspace>", "CODELOGIC_DEBUG_MODE": "true" } } } }

**注意:**在某些系统上,您可能需要使用 uvx 可执行文件的完整路径,而不仅仅是“uvx”。例如:Linux/Mac 上的/home/user/.local/bin/uvx或 Windows 上的C:\Users\username\AppData\Local\astral\uvx.exe

  1. 重新启动 Cursor 以应用更改。

CodeLogic MCP 服务器工具现在将在您的 Cursor 工作区中可用。

AI助手指令/规则

为了帮助AI助手有效地使用CodeLogic工具,您可以在客户端的配置中添加以下说明/规则。我们建议您自定义这些说明,以符合您团队的特定编码标准、最佳实践和工作流程要求:

VS Code(GitHub Copilot)说明

创建一个.vscode/copilot-instructions.md文件,其中包含以下内容:

# CodeLogic MCP Server Instructions When modifying existing code methods: - Use codelogic-method-impact to analyze code changes - Use codelogic-database-impact for database modifications - Highlight impact results for the modified methods When modifying SQL code or database entities: - Always use codelogic-database-impact to analyze potential impacts - Highlight impact results for the modified database entities To use the CodeLogic tools effectively: - For code impacts: Ask about specific methods or functions - For database relationships: Ask about tables, views, or columns - Review the impact results before making changes - Consider both direct and indirect impacts

Claude 桌面说明

创建一个文件~/.claude/instructions.md其中包含以下内容:

# CodeLogic MCP Server Instructions When modifying existing code methods: - Use codelogic-method-impact to analyze code changes - Use codelogic-database-impact for database modifications - Highlight impact results for the modified methods When modifying SQL code or database entities: - Always use codelogic-database-impact to analyze potential impacts - Highlight impact results for the modified database entities To use the CodeLogic tools effectively: - For code impacts: Ask about specific methods or functions - For database relationships: Ask about tables, views, or columns - Review the impact results before making changes - Consider both direct and indirect impacts

Windsurf IDE 规则

创建或修改~/.codeium/windsurf/memories/global_rules.md markdown 文件,内容如下:

When modifying existing code methods: - Use codelogic-method-impact to analyze code changes - Use codelogic-database-impact for database modifications - Highlight impact results for the modified methods When modifying SQL code or database entities: - Always use codelogic-database-impact to analyze potential impacts - Highlight impact results for the modified database entities To use the CodeLogic tools effectively: - For code impacts: Ask about specific methods or functions - For database relationships: Ask about tables, views, or columns - Review the impact results before making changes - Consider both direct and indirect impacts

游标全局规则

要在 Cursor 中配置 CodeLogic 规则:

  1. 打开游标设置

  2. 导航至“规则”部分

  3. 在“用户规则”中添加以下内容:

# CodeLogic MCP Server Rules ## Codebase - The CodeLogic MCP Server is for java, javascript, typescript, and C# dotnet codebases - don't run the tools on python or other non supported codebases ## AI Assistant Behavior - When modifying existing code methods: - Use codelogic-method-impact to analyze code changes - Use codelogic-database-impact for database modifications - Highlight impact results for the modified methods - When modifying SQL code or database entities: - Always use codelogic-database-impact to analyze potential impacts - Highlight impact results for the modified database entities - To use the CodeLogic tools effectively: - For code impacts: Ask about specific methods or functions - For database relationships: Ask about tables, views, or columns - Review the impact results before making changes - Consider both direct and indirect impacts

环境变量

可以配置以下环境变量来定制服务器的行为:

  • CODELOGIC_SERVER_HOST :CodeLogic 服务器的 URL。

  • CODELOGIC_USERNAME :您的 CodeLogic 用户名。

  • CODELOGIC_PASSWORD :您的 CodeLogic 密码。

  • CODELOGIC_WORKSPACE_NAME :要使用的工作区的名称。

  • CODELOGIC_DEBUG_MODE :设置为true以启用调试模式。启用后,将生成其他调试文件,例如timing_log.txtimpact_data*.json 。默认为false

示例配置

"env": { "CODELOGIC_SERVER_HOST": "<url to the server e.g. https://myco.app.codelogic.com>", "CODELOGIC_USERNAME": "<my username>", "CODELOGIC_PASSWORD": "<my password>", "CODELOGIC_WORKSPACE_NAME": "<my workspace>", "CODELOGIC_DEBUG_MODE": "true" }

固定版本

您无需使用服务器的最新版本,而是可以通过更改args字段来匹配pypi中的版本,从而固定到特定版本,例如

"args": [ "codelogic-mcp-server@0.2.2" ],

版本兼容性

此 MCP 服务器具有以下版本兼容性要求:

  • 版本 0.3.1 及以下:兼容所有 CodeLogic API 版本

  • 版本 0.4.0 及以上:需要 CodeLogic API 版本 25.10.0 或更高版本

如果您正在升级,请确保您的 CodeLogic 服务器满足最低 API 版本要求。

测试

运行单元测试

该项目使用 unittest 进行测试。您可以运行单元测试而无需任何外部依赖项:

python -m unittest discover -s test -p "unit_*.py"

单元测试使用模拟数据,不需要连接到 CodeLogic 服务器。

集成测试(可选)

如果您想运行连接到真实 CodeLogic 服务器的集成测试:

  1. test/.env.test.example复制到test/.env.test并填充您的 CodeLogic 服务器详细信息

  2. 运行集成测试:

python -m unittest discover -s test -p "integration_*.py"

注意:集成测试需要访问 CodeLogic 服务器实例。

One-click Deploy
A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/CodeLogicIncEngineering/codelogic-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server