CodeLogic

Official
Mozilla Public License 2.0
4
  • Apple
  • Linux

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

Integrations

  • Enables Windsurf IDE to leverage Codelogic's software dependency analysis for assessing the impact of code modifications

コードロジックMCPサーバー

AI プログラミング アシスタントで Codelogic の豊富なソフトウェア依存データを活用するためのMCP サーバー

コンポーネント

ツール

サーバーは次の 2 つのツールを実装します。

  • codelogic-method-impact : コードに対する CodeLogic サーバーの API から影響評価を取得します。
    • 作業中の特定の「メソッド」とそれに関連付けられた「クラス」を受け取ります。
  • codelogic-database-impact : コードとデータベース エンティティ間の影響を分析します。
    • データベース エンティティの種類 (列、テーブル、またはビュー) とその名前を取得します。

インストール

前提条件

MCPサーバーはAstral UVに依存して動作します。インストールしてください。

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_MV_NAME": "<my materialized view>", "CODELOGIC_DEBUG_MODE": "true" } } } }
  1. あるいは、コマンド パレットからMCP: Add Serverコマンドを実行し、サーバー情報を入力することもできます。
  2. MCP サーバーを管理するには、コマンド パレットのMCP: List Serversコマンドを使用します。
  3. 設定が完了すると、サーバーのツールがCopilotエージェントモードで利用できるようになります。エージェントモード時にチャットビューの「ツール」ボタンをクリックすることで、必要に応じて特定のツールのオン/オフを切り替えることができます。
  4. Codelogic ツールをエージェント モードで使用する場合、コードの影響やデータベースの関係について具体的に質問すると、エージェントが適切なツールを利用します。

構成ファイルを編集して 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_MV_NAME": "<my materialized view>" } } }

設定を追加したら、Claude Desktop を再起動して変更を適用します。

この MCP サーバーをWindsurf IDEで実行するには:

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_MV_NAME": "<my materialized view>" } } }

設定を追加した後、Windsurf IDE を再起動するか、ツールを更新して変更を適用します。

Cursor で CodeLogic MCP サーバーを構成するには:

  1. .cursor/mcp.jsonファイルを作成して MCP サーバーを構成します。
{ "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_MV_NAME": "<my materialized view>", "CODELOGIC_DEBUG_MODE": "true" } } } }
  1. 変更を適用するにはカーソルを再起動します。

CodeLogic MCP サーバー ツールがカーソル ワークスペースで使用できるようになります。

AIアシスタントの指示

AI アシスタントが CodeLogic ツールを効果的に使用できるようにするには、クライアントの構成に次の指示を追加できます。

次の内容を含む.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/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

次の内容で~/.codeium/windsurf/memories/global_rules.mdマークダウン ファイルを作成または変更します。

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/rules/codelogic-rules.mdファイルを作成します。

# CodeLogic MCP Server Rules ## 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_MV_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_MV_NAME": "<my materialized view>", "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.exampletest/.env.testにコピーし、CodeLogic サーバーの詳細を入力します。
  2. 統合テストを実行します。
python -m unittest discover -s test -p "integration_*.py"

注: 統合テストでは、CodeLogic サーバー インスタンスへのアクセスが必要です。

You must be authenticated.

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

複雑なコードとデータ アーキテクチャの依存関係をグラフ化するソフトウェア インテリジェンス プラットフォームである CodeLogic と連携して、AI の精度と洞察力を高めます。

  1. Components
    1. Tools
    2. Install
    3. AI Assistant Instructions
    4. Environment Variables
  2. Testing
    1. Running Unit Tests
    2. Integration Tests (Optional)
ID: cq6x71y62p