Code Knowledge MCP Server

local-only server

The server can only run on the client’s local machine because it depends on local resources.

Integrations

  • Provides knowledge management tool for code repositories, suggesting integration with Git repositories

  • References cloning from a GitHub repository as part of the setup process

  • Uses Ollama for efficient embedding generation, requiring it to be installed and running for vector operations

コード知識ツール

ベクトル埋め込みを用いたコードリポジトリ向けの知識管理ツールです。高度な埋め込み技術を用いて、コードベースに関する知識の維持とクエリを支援します。

ビルドとインストール

1. パッケージをビルドする

まず、配布ファイルをビルドする必要があります。

# Clone the repository git clone https://github.com/yourusername/code-knowledge-tool.git cd code-knowledge-tool # Create and activate a virtual environment python -m venv venv source venv/bin/activate # Install build tools python -m pip install --upgrade pip build # Build the package python -m build

これにより、dist/ ディレクトリに 2 つのファイルが作成されます。

  • code_knowledge_tool-0.1.0-py3-none-any.whl (インストール用のホイール ファイル)
  • code_knowledge_tool-0.1.0.tar.gz (ソース配布)

2. パッケージをインストールする

前提条件

  1. Ollama がインストールされ、実行されていることを確認します。
# Install Ollama (if not already installed) curl https://ollama.ai/install.sh | sh # Start Ollama service ollama serve
  1. パッケージをインストールします。
オプション 1: ホイール ファイルからインストールする (使用上の推奨)
# Navigate to where you built the package cd /path/to/code_knowledge_tool # Install from the wheel file pip install dist/code_knowledge_tool-0.1.0-py3-none-any.whl
オプション 2: 編集可能モードでインストールする (開発に推奨)

このオプションは、ツールを変更したり、開発に貢献したりする場合に最適です。

# Assuming you're already in the code-knowledge-tool directory # and have activated your virtual environment # Install in editable mode with development dependencies pip install -e ".[dev]"

RooCode/Clineとの統合

  1. MCP 構成を設定にコピーします。

Cline (VSCode) の場合:

# Open the settings file open ~/Library/Application\ Support/Code/User/globalStorage/rooveterinaryinc.roo-cline/settings/cline_mcp_settings.json

次の構成を追加します。

{ "mcpServers": { "code_knowledge": { "command": "python", "args": ["-m", "code_knowledge_tool.mcp_tool"], "env": { "PYTHONPATH": "${workspaceFolder}" } } } }

RooCodeの場合:

# Open the settings file open ~/Library/Application\ Support/RooCode/roocode_config.json

上記と同じ構成を追加します。

  1. 新しいツールをロードするには、RooCode/Cline を再起動します。

メモリバンクおよびRAGコンテキストプロバイダーとして使用

このツールは、プロジェクトのメモリバンクおよびRAGコンテキストプロバイダーとして機能します。設定手順は次のとおりです。

  1. 提供されたテンプレートをプロジェクトにコピーします。
cp clinerules_template.md /path/to/your/project/.clinerules
  1. プロジェクトのニーズに合わせて .clinerules のルールとパターンをカスタマイズします

テンプレートには、次の事項に関する包括的な手順が含まれています。

  • ナレッジベース管理
  • RAGベースの開発ワークフロー
  • コード品質ガイドライン
  • メモリ管理の実践

完全な設定と使用方法の詳細については、clinerules_template.md を参照してください。

特徴

  • コード知識のためのローカルベクトルストレージ
  • Ollamaを使用した効率的な埋め込み生成
  • 複数のファイル形式のサポート
  • コンテキスト認識コード理解
  • MCP 経由の RooCode および Cline との統合
  • RAGベースのコンテキスト拡張
  • 永続的な知識の保存

要件

  • Python 3.8以上
  • ローカルで実行されている Ollama サービス
  • ベクトル演算用のchromadb

発達

テストの実行

このプロジェクトは、エンドツーエンドの機能とMCP契約の遵守に重点を置いた統合優先のテストアプローチを採用しています。テストスイートは以下のとおりです。

  1. MCP 契約テスト
    • ツールの登録と実行
    • リソース管理
    • 知識操作
    • エラー処理
  2. パッケージビルドテスト
    • インストール検証
    • 依存関係の解決
    • MCPサーバーの初期化
    • 基本機能

テストを実行するには:

# Install test dependencies pip install -e ".[dev]" # Run all tests pytest # Run specific test suites pytest tests/integration/test_mcp_contract.py -v # MCP functionality pytest tests/integration/test_package_build.py -v # Installation verification

テスト環境の要件:

# Ensure Ollama is running ollama serve

テストでは、テスト実行間で自動的にクリーンアップされる一時ディレクトリ (test_knowledge_store) が使用されます。

テスト戦略とパターンの詳細については、 docs/のドキュメントを参照してください。

将来の配布

このパッケージを pip 経由で利用できるようにするには (つまり、 pip install code-knowledge-tool )、次の手順を実行する必要があります。

  1. PyPIにアカウントを登録する
  2. twine をインストールします: pip install twine
  3. ディストリビューションをアップロードする: twine upload dist/*

ただし、現時点では、上記のローカル ビルドおよびインストール方法を使用してください。

ライセンス

MITライセンス

-
security - not tested
F
license - not found
-
quality - not tested

RooCode および Cline と統合された、ベクター埋め込みによるコードの理解と管理を強化するプロジェクト メモリ バンクと RAG コンテキスト プロバイダーを提供します。

  1. Building and Installing
    1. 1. Build the Package
    2. 2. Install the Package
  2. Integration with RooCode/Cline
    1. Using as Memory Bank and RAG Context Provider
      1. Features
        1. Requirements
          1. Development
            1. Running Tests
          2. Future Distribution
            1. License
              ID: prkz57y7a2