sourcesage

sarathsp06/sourcesage

3.3

If you are the rightful owner of sourcesage and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

SourceSage is an MCP server designed to efficiently memorize and manage key aspects of a codebase, leveraging LLM's understanding across multiple languages.

SourceSage is a Model Context Protocol (MCP) server that focuses on efficiently memorizing and managing key aspects of a codebase, such as logic, style, and standards. It is designed to be language-agnostic, allowing it to work with any programming language that the LLM understands. SourceSage uses a knowledge graph to store code entities, relationships, patterns, and style conventions in a token-efficient manner. This enables fast retrieval and dynamic updates without redundant storage. The server relies on the LLM to analyze code and provide insights, making it a powerful tool for developers who need to manage complex codebases across different languages. SourceSage's approach leverages the LLM's inherent language understanding while focusing on efficient memory management.

Features

  • Language Agnostic: Works with any programming language the LLM understands
  • Knowledge Graph Storage: Efficiently stores code entities, relationships, patterns, and style conventions
  • LLM-Driven Analysis: Relies on the LLM to analyze code and provide insights
  • Token-Efficient Storage: Optimizes for minimal token usage while maximizing memory capacity
  • Incremental Updates: Updates knowledge when code changes without redundant storage

Usages

usage with claude desktop installed package

{
  "mcpServers": {
    "sourcesage": {
      "command": "sourcesage",
      "args": []
    }
  }
}

usage with claude desktop local directory

{
  "sourcesage": {
    "command": "uv", 
    "args": [
      "--directory",
      "/path/to/sourcesage",
      "run",
      "main.py"
    ]
  }
}

Tools

  1. register_entity

    Register code entity to knowledge graph

  2. register_relationship

    Relationships between registered entities

  3. register_pattern

    Register code mode

  4. register_style_convention

    Register coding style agreement

  5. add_entity_observation

    Add entity observations

  6. query_entities

    Query entities in the knowledge graph

  7. get_entity_details

    Get detailed information about an entity

  8. query_patterns

    Query code pattern

  9. query_style_conventions

    Query coding style conventions

  10. get_knowledge_statistics

    Obtain statistics on knowledge graphs

  11. clear_knowledge

    Clear all knowledge in the knowledge graph