Skip to main content
Glama

Code Knowledge MCP Server

by davidvc

コード知識ツール

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

ビルドとインストール

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

local-only server

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

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

  1. ビルドとインストール
    1. パッケージをビルドする
    2. パッケージをインストールする
  2. RooCode/Clineとの統合
    1. メモリバンクおよびRAGコンテキストプロバイダーとして使用
      1. 特徴
        1. 要件
          1. 発達
            1. テストの実行
          2. 将来の配布
            1. ライセンス

              Related MCP Servers

              • -
                security
                A
                license
                -
                quality
                A VS Code extension provides a MCP server that exposes Roslyn language features. It enables tools like find usages, go to definition, quick info, etc.
                Last updated -
                111
                TypeScript
                AGPL 3.0
                • Linux
                • Apple
              • -
                security
                A
                license
                -
                quality
                A comprehensive code analysis and management tool that integrates with Claude Desktop to analyze code at project and file levels, helping adapt changes to projects intelligently.
                Last updated -
                29
                Python
                MIT License
              • A
                security
                A
                license
                A
                quality
                Chat with your codebase through intelligent code searching without embeddings by breaking files into logical chunks, giving the LLM tools to search these chunks, and letting it find specific code needed to answer your questions.
                Last updated -
                8
                51
                Python
                MIT License
              • -
                security
                F
                license
                -
                quality
                A server component of the Model Context Protocol that provides intelligent analysis of codebases using vector search and machine learning to understand code patterns, architectural decisions, and documentation.
                Last updated -
                4
                Python

              View all related MCP servers

              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/davidvc/code-knowledge-mcptool'

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