Code Knowledge MCP Server

by davidvc

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. 패키지 빌드

먼저 배포 파일을 빌드해야 합니다.

지엑스피1

이렇게 하면 dist/ 디렉토리에 두 개의 파일이 생성됩니다.

  • 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 구성을 설정에 복사하세요.

클라인(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. 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

              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 -
                81
                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
                22
                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

              ID: prkz57y7a2