WC

websines/codegraph-mcp

Developer tools

Эта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал

20 stars 5 forks Качество 52 Тренд 10

CodeGraph MCP - Give persistent learning to your coding agent for a codebase across teams & token saving superpower to the coding agent

Обзор

A self-use Rust MCP server that gives AI coding agents persistent code understanding and memory across sessions. Built as a personal tool to explore what happens when you give an LLM structured access to a codebase's symbol graph, session state, and accumulated project knowledge. Codegraph runs as an MCP server (stdio transport) and exposes 26 tools that an AI agent can call: - — Parses source code with tree-sitter (Rust, TypeScript, JavaScript, Python, Go), extracts symbols and their relationships (calls, imports, inherits), and stores them as a directed graph. The agent can search symbols, traverse dependencies, and understand file structure without reading entire files. - — Tracks the agent's current task, subtasks, decisions, and working context. Survives context window compaction so the agent can resume where it left off. - — Records patterns (things that worked), failures (gotchas to avoid), and solution lineage (attempt chains with outcomes).

README

Показан фрагмент оригинального README. Открыть оригинал.

Codegraph MCP

A self-use Rust MCP server that gives AI coding agents persistent code understanding and memory across sessions. Built as a personal tool to explore what happens when you give an LLM structured access to a codebase’s symbol graph, session state, and accumulated project knowledge.

What It Does

Codegraph runs as an MCP server (stdio transport) and exposes 26 tools that an AI agent can call:

  • Code Graph — Parses source code with tree-sitter (Rust, TypeScript, JavaScript, Python, Go), extracts symbols and their relationships (calls, imports, inherits), and stores them as a directed graph. The agent can search symbols, traverse dependencies, and understand file structure without reading entire files.

  • Session Memory — Tracks the agent’s current task, subtasks, decisions, and working context. Survives context window compaction so the agent can resume where it left off.

  • Learning System — Records patterns (things that worked), failures (gotchas to avoid), and solution lineage (attempt chains with outcomes). A reflection engine converts outcomes into reusable knowledge. A suggestion system combines all three to recommend approaches for new tasks.

  • Skill Distillation — Generates a SKILL.md from accumulated patterns, failures, and conventions — a machine-readable summary of project-specific knowledge.

  • Cross-Language Inference — Detects REST/GraphQL calls in frontend code and matches them to backend route definitions.

  • Bash Compression — Compresses verbose command output (git status, test results, directory listings) to reduce token usage.

Tech Stack

Component Technology
Language Rust (async, tokio)
Protocol MCP over stdio (JSON-RPC 2.0)
Parsing tree-sitter (5 language grammars)
Graph petgraph (directed graph with BFS traversal)
Storage libSQL / SQLite (two databases: code graph + learning)
Hashing xxh3 (content-based change detection)
Config TOML

Architecture

src/
├── main.rs              # Entry point
├── config.rs            # Project root detection, config.toml
├── mcp/                 # MCP protocol layer
│   ├── protocol.rs      # JSON-RPC 2.0 + MCP types
│   ├── transport.rs     # Stdio transport
│   ├── server.rs        # Request dispatch, lazy init
│   └── tools.rs         # Tool registry (26 tools)
├── store/               # Persistence
│   ├── db.rs            # SQLite CRUD
│   ├── graph.rs         # In-memory petgraph
│   └── migrations.rs    # Schema versioning
├── code/                # Code analysis
│   ├── parser.rs        # tree-sitter symbol extraction
│   ├── indexer.rs       # Incremental indexing + cross-file resolution
│   ├── languages.rs     # Language configs + grammars
│   └── cross_language.rs
├── session/             # Session state machine
│   └── state.rs         # Task, decisions, context tracking
├── learning/            # Learning system
Открыть полный README на GitHub

Установка

This server does not publish a one-line install command.

Open the repository installation guide Новичок в MCP? Начните с руководства на mcpskill.org →

Конфигурация

{ "mcpServers": { "codegraph": { "command": "/absolute/path/to/codegraph-mcp/target/release/codegraph", "type": "stdio" } } }