SourceSage: LLM을 위한 효율적인 코드 메모리
SourceSage는 코드베이스의 핵심 요소(논리, 스타일, 표준)를 효율적으로 기억하는 동시에 동적 업데이트와 빠른 검색을 지원하는 MCP(Model Context Protocol) 서버입니다. 언어에 구애받지 않고 LLM이 여러 언어의 코드를 이해하는 방식을 활용하도록 설계되었습니다.
특징
언어 무관 : LLM이 이해하는 모든 프로그래밍 언어로 작업 가능
지식 그래프 저장소 : 코드 엔터티, 관계, 패턴 및 스타일 규칙을 효율적으로 저장합니다.
LLM 기반 분석 : LLM을 사용하여 코드를 분석하고 통찰력을 제공합니다.
토큰 효율적 스토리지 : 메모리 용량을 최대화하면서 토큰 사용량을 최소화하도록 최적화합니다.
증분 업데이트 : 중복 저장소 없이 코드가 변경될 때 지식을 업데이트합니다.
빠른 검색 : 관련 정보를 빠르고 정확하게 검색할 수 있습니다.
작동 원리
SourceSage는 다음과 같은 새로운 접근 방식을 사용합니다.
LLM은 코드 파일(모든 언어)을 분석합니다.
LLM은 MCP 도구를 사용하여 엔터티, 관계, 패턴 및 스타일 규칙을 등록합니다.
SourceSage는 이 지식을 토큰 효율적인 그래프 구조로 저장합니다.
LLM은 나중에 필요할 때 이 지식을 쿼리할 수 있습니다.
이 접근 방식은 MCP 서버의 효율적인 메모리 관리에 집중하는 동시에 LLM의 고유한 언어 이해력을 활용합니다.
설치
지엑스피1
용법
MCP 서버 실행
데스크톱용 Claude에 연결
데스크톱용 Open Claude
설정 > 개발자 > 구성 편집으로 이동하세요.
claude_desktop_config.json에 다음을 추가하세요.
패키지를 설치한 경우:
설치하지 않고 로컬 디렉토리에서 실행하는 경우:
데스크톱용 Claude를 다시 시작하세요
사용 가능한 도구
SourceSage는 다음과 같은 MCP 도구를 제공합니다.
register_entity : 지식 그래프에 코드 엔터티를 등록합니다.
Input: - name: Name of the entity (e.g., class name, function name) - entity_type: Type of entity (class, function, module, etc.) - summary: Brief description of the entity - signature: Entity signature (optional) - language: Programming language (optional) - observations: List of observations about the entity (optional) - metadata: Additional metadata (optional) Output: Confirmation message with entity IDregister_relationship : 엔티티 간 관계를 등록합니다.
Input: - from_entity: Name of the source entity - to_entity: Name of the target entity - relationship_type: Type of relationship (calls, inherits, imports, etc.) - metadata: Additional metadata (optional) Output: Confirmation message with relationship IDregister_pattern : 코드 패턴을 등록합니다
Input: - name: Name of the pattern - description: Description of the pattern - language: Programming language (optional) - example: Example code demonstrating the pattern (optional) - metadata: Additional metadata (optional) Output: Confirmation message with pattern IDregister_style_convention : 코딩 스타일 규칙을 등록합니다.
Input: - name: Name of the convention - description: Description of the convention - language: Programming language (optional) - examples: Example code snippets demonstrating the convention (optional) - metadata: Additional metadata (optional) Output: Confirmation message with convention IDadd_entity_observation : 엔티티에 관찰을 추가합니다.
Input: - entity_name: Name of the entity - observation: Observation to add Output: Confirmation messagequery_entities : 지식 그래프의 쿼리 엔터티
Input: - entity_type: Filter by entity type (optional) - language: Filter by programming language (optional) - name_pattern: Filter by name pattern (regex, optional) - limit: Maximum number of results to return (optional) Output: List of matching entitiesget_entity_details : 엔터티에 대한 자세한 정보를 가져옵니다.
Input: - entity_name: Name of the entity Output: Detailed information about the entityquery_patterns : 지식 그래프의 쿼리 코드 패턴
Input: - language: Filter by programming language (optional) - pattern_name: Filter by pattern name (optional) Output: List of matching patternsquery_style_conventions : 쿼리 코딩 스타일 규칙
Input: - language: Filter by programming language (optional) - convention_name: Filter by convention name (optional) Output: List of matching style conventionsget_knowledge_statistics : 지식 그래프에 대한 통계를 가져옵니다.
clear_knowledge : 그래프에서 모든 지식을 지웁니다.
Claude를 사용한 워크플로 예시
코드 분석 : Claude에게 코드 파일을 분석해 달라고 요청하세요.
"Please analyze this Python file and register the key entities and relationships."엔터티 등록 : Claude는 register_entity 도구를 사용하여 코드 엔터티를 저장합니다.
"I'll register the main class in this file."관계 등록 : Claude는 register_relationship 도구를 사용하여 관계를 저장합니다.
"I'll register the inheritance relationship between these classes."지식 쿼리 : 나중에 Claude에게 코드베이스에 대해 물어보세요.
"What classes are defined in my codebase?" "Show me the details of the User class." "What's the relationship between the User and Profile classes?"코딩 패턴 얻기 : Claude에게 코딩 패턴에 대해 물어보세요
"What design patterns are used in my codebase?" "Show me examples of the Factory pattern in my code."
어떻게 다른가
기존 코드 분석 도구와 달리 SourceSage는 다음과 같은 기능을 제공합니다.
LLM 이해 활용 : LLM의 기능을 활용하여 여러 언어의 코드 의미를 이해합니다.
의미 지식을 저장합니다 . 구문뿐만 아니라 의미와 관계에 초점을 맞춥니다.
언어에 구애받지 않음 : LLM이 이해하는 모든 프로그래밍 언어와 호환 가능
토큰 효율성을 최적화합니다 . 토큰 사용량을 최소화하는 방식으로 지식을 저장합니다.
LLM 역량 향상에 따른 진화 : LLM이 향상됨에 따라 코드 이해도 향상됩니다.
기여하다
기여를 환영합니다! 풀 리퀘스트를 제출해 주세요.
특허
이 프로젝트는 MIT 라이선스에 따라 라이선스가 부여되었습니다. 자세한 내용은 라이선스 파일을 참조하세요.
Tools
SourceSage는 코드베이스의 핵심 요소(논리, 스타일, 표준)를 효율적으로 기억하는 동시에 동적 업데이트와 빠른 검색을 지원하는 MCP(Model Context Protocol) 서버입니다. 언어에 구애받지 않고 LLM이 여러 언어의 코드를 이해하는 방식을 활용하도록 설계되었습니다.
Related MCP Servers
- -security-license-qualityThis is an MCP server for PostgREST. It allows LLMs perform database queries and operations on Postgres databases via PostgREST. This server works with both Supabase projects (which use PostgREST) and standalone PostgREST servers.Last updated -9262,230Apache 2.0
 - -security-license-qualityA Model Context Protocol server that provides AI assistants with structured access to your Logseq knowledge graph, enabling retrieval, searching, analysis, and creation of content within your personal knowledge base.Last updated -51
 - Asecurity-licenseAqualityAn MCP server that connects to a Swagger specification and helps an AI to build all the required models to generate a MCP server for that service.Last updated -53581MIT License
 - Asecurity-licenseAqualityA Model Context Protocol server that integrates with DeepSource to provide AI assistants with access to code quality metrics, issues, and analysis results.Last updated -9676MIT License
 
Appeared in Searches
- A tool for extracting code metadata and exposing it via MCP
 - Retrieve the latest documentation of libraries in word embeddings form for LLMs
 - Using local LLMs for code writing, reviewing, and rule generation
 - Assistance with reviewing and merging code changes in a merge request
 - Resources or Assistance for Learning to Code