sourcesage
SourceSage: LLM을 위한 효율적인 코드 메모리
SourceSage는 코드베이스의 핵심 요소(논리, 스타일, 표준)를 효율적으로 기억하는 동시에 동적 업데이트와 빠른 검색을 지원하는 MCP(Model Context Protocol) 서버입니다. 언어에 구애받지 않고 LLM이 여러 언어의 코드를 이해하는 방식을 활용하도록 설계되었습니다.
특징
언어 무관 : LLM이 이해하는 모든 프로그래밍 언어로 작업 가능
지식 그래프 저장소 : 코드 엔터티, 관계, 패턴 및 스타일 규칙을 효율적으로 저장합니다.
LLM 기반 분석 : LLM을 사용하여 코드를 분석하고 통찰력을 제공합니다.
토큰 효율적 스토리지 : 메모리 용량을 최대화하면서 토큰 사용량을 최소화하도록 최적화합니다.
증분 업데이트 : 중복 저장소 없이 코드가 변경될 때 지식을 업데이트합니다.
빠른 검색 : 관련 정보를 빠르고 정확하게 검색할 수 있습니다.
Related MCP server: Logseq MCP Tools
작동 원리
SourceSage는 다음과 같은 새로운 접근 방식을 사용합니다.
LLM은 코드 파일(모든 언어)을 분석합니다.
LLM은 MCP 도구를 사용하여 엔터티, 관계, 패턴 및 스타일 규칙을 등록합니다.
SourceSage는 이 지식을 토큰 효율적인 그래프 구조로 저장합니다.
LLM은 나중에 필요할 때 이 지식을 쿼리할 수 있습니다.
이 접근 방식은 MCP 서버의 효율적인 메모리 관리에 집중하는 동시에 LLM의 고유한 언어 이해력을 활용합니다.
설치
지엑스피1
용법
MCP 서버 실행
# Run the server
sourcesage
# Or run directly from the repository
python -m sourcesage.mcp_server데스크톱용 Claude에 연결
데스크톱용 Open Claude
설정 > 개발자 > 구성 편집으로 이동하세요.
claude_desktop_config.json에 다음을 추가하세요.
패키지를 설치한 경우:
{
"mcpServers": {
"sourcesage": {
"command": "sourcesage",
"args": []
}
}
}설치하지 않고 로컬 디렉토리에서 실행하는 경우:
{
"sourcesage": {
"command": "uv",
"args": [
"--directory",
"/path/to/sourcesage",
"run",
"main.py"
]
},
}데스크톱용 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 : 지식 그래프에 대한 통계를 가져옵니다.
Input: None
Output: Statistics about the knowledge graphclear_knowledge : 그래프에서 모든 지식을 지웁니다.
Input: None
Output: Confirmation messageClaude를 사용한 워크플로 예시
코드 분석 : 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 라이선스에 따라 라이선스가 부여되었습니다. 자세한 내용은 라이선스 파일을 참조하세요.
Available Tools
13 toolsadd_entity_observationC
Add an observation to an entity.
Args: entity_name: Name of the entity observation: Observation to add
Inputs: entity_name (required), observation (required).
clear_knowledgeA
Clear all knowledge from the graph.
Inputs: no named parameters.
dump_project_understandingA
Dump understanding of an entire project at once.
This tool provides a comprehensive dump of all knowledge related to a project, including all entities, relationships, patterns, and style conventions.
Args: project_path: Path to the project root directory include_observations: Whether to include detailed observations
Inputs: project_path (required), include_observations.
get_entity_detailsC
Get detailed information about an entity.
Args: entity_name: Name of the entity
Inputs: entity_name (required).
get_knowledge_statisticsC
Get statistics about the knowledge graph.
Inputs: no named parameters.
load_project_understandingB
Load understanding of an entire project at once.
This tool should be used by MCP clients to quickly get project understanding if available, instead of reading all the files individually. It loads all entities, relationships, patterns, and style conventions related to the project.
Args: project_path: Path to the project root directory
Inputs: project_path (required).
query_entitiesB
Query entities in the knowledge graph.
Args: entity_type: Filter by entity type (class, function, module, etc.) language: Filter by programming language name_pattern: Filter by name pattern (regex) limit: Maximum number of results to return
Inputs: entity_type, language, limit, name_pattern.
query_patternsB
Query code patterns in the knowledge graph.
Args: language: Filter by programming language pattern_name: Filter by pattern name
Inputs: language, pattern_name.
query_style_conventionsA
Query coding style conventions in the knowledge graph.
Args: language: Filter by programming language convention_name: Filter by convention name
Inputs: convention_name, language.
register_entityB
Register a code entity in the knowledge graph.
Args: 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 (e.g., function signature) language: Programming language observations: List of observations about the entity metadata: Additional metadata as key-value pairs
Inputs: entity_type (required), name (required), summary (required), language, +3 more.
register_patternB
Register a code pattern.
Args: name: Name of the pattern description: Description of the pattern language: Programming language example: Example code demonstrating the pattern metadata: Additional metadata as key-value pairs
Inputs: description (required), name (required), example, language, +1 more.
register_relationshipC
Register a relationship between entities.
Args: 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 as key-value pairs
Inputs: from_entity (required), relationship_type (required), to_entity (required), metadata.
register_style_conventionC
Register a coding style convention.
Args: name: Name of the convention description: Description of the convention language: Programming language examples: Example code snippets demonstrating the convention metadata: Additional metadata as key-value pairs
Inputs: description (required), name (required), examples, language, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 13 tools
Most tools have distinct purposes focused on different aspects of knowledge graph management (entities, patterns, relationships, style conventions). However, there is some potential overlap between dump_project_understanding and load_project_understanding as both handle project-level data, though their descriptions clarify one is for output and the other for input.
All tools follow a consistent snake_case naming pattern with clear verb_noun structure (e.g., add_entity_observation, get_entity_details, query_entities, register_entity). The naming is predictable and uniform across all 13 tools.
With 13 tools, this is well-scoped for a knowledge graph server covering entities, patterns, relationships, and style conventions. Each tool serves a specific function in the CRUD/lifecycle operations, and none appear redundant or out of place.
The toolset provides comprehensive coverage for managing a knowledge graph, including registration, querying, and statistics. Minor gaps exist, such as no explicit update or delete operations for entities/patterns/relationships/conventions, but agents can work around this by re-registering or using clear_knowledge.
Related MCP Connectors
Team memory for AI coding agents and code reviews, reviewed by humans and served over MCP.
Shared memory for coding agents. Stop re-explaining your codebase every session.
Give your AI agent persistent, governed memory for every project. At task start it recalls the approved decisions, conventions, risks and architecture (semantic search, ranked by importance); at close it proposes what was learned as typed memories that you review and approve — governance, not a notes dump. Agents propose, humans govern: edits go back to pending and deletion is human-only by design. Connect Claude Code, Cursor, Claude Desktop or any MCP client in two minutes with just your API key — hosted (nothing to install) or locally via `uvx solucortex-mcp`. Built by SoluAI and dogfooded daily: SoluCortex is developed using its own living memory.
Shared memory MCP server for Claude Code, Codex, Gemini CLI and Cursor. Cited, editable.
Related MCP Servers
- AlicenseNot gradedqualityAmaintenanceThis 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.2,128 npm3,017Apache 2.0
- AlicenseNot gradedqualityDmaintenanceA 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.70MIT
- AlicenseAqualityDmaintenanceAn 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.5167MIT
- AlicenseBqualityFmaintenanceA Model Context Protocol server that integrates with DeepSource to provide AI assistants with access to code quality metrics, issues, and analysis results.10132 npm7MIT
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