Skip to main content
Glama
davidvc

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]"

Related MCP server: hive-memory

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ライセンス

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

No tool schema history has been recorded yet.

Maintenance

ActivityInactive
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    C
    maintenance
    Provides AI coding assistants with persistent project memory to retain architectural decisions, code patterns, and domain knowledge across sessions. It stores data locally in a SQLite database, allowing agents to remember, recall, and manage project-specific context using full-text search.
    13
    Apache 2.0
  • A
    license
    Not graded
    quality
    C
    maintenance
    Provides AI coding agents with persistent, graph-connected memory across projects, enabling cross-project context retrieval via synaptic connections and hybrid search.
    15
    6
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables AI coding agents to retrieve and manage code context with hybrid search, project memory, and observability via MCP tools.
    29
    MIT
  • A
    license
    B
    quality
    D
    maintenance
    Persistent, searchable project memory for Claude Code. Each project has its own local DuckDB with vector embeddings, auto-loading context at session start.
    24
    30
    MIT

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

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