tentra-mcp
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
Memory for AI coding agents. Persistent code graph + AI-generated architecture diagrams — MCP-native. Works in Cursor, Claude Code, Codex, and Windsurf.
Dogfood benchmark on our own monorepo: **99.4% token reduction** (156.8× ratio) across 8 "where is X implemented?" queries — 114,644 tokens via file re-read vs 731 tokens via query_symbols. Full write-up →
Quick Start (60 seconds)
One command:
1. Writes MCP config for **Cursor / Claude Code / Codex / Windsurf** (whichever are installed)
2. Installs a git post-commit hook so the code graph auto-refreshes after every commit — no manual re-indexing
3. Auto-derives your repo_id from the git remote and saves it to .tentra/metadata.json
Then grab your API key at trytentra.com/settings, replace YOUR_TENTRA_API_KEY in the generated config, reload your IDE, and ask your agent:
From here on, every git commit fires a background re-index. Your agents stay caught up automatically.
> **Skip the hook:** drop --hook — just writes IDE configs.
> **Manual stdio install:** npx tentra-mcp (opens browser for GitHub device-flow auth on first tool call).
> **API key instead:** npx tentra-mcp --key YOUR_API_KEY.
What is Tentra?
Tentra is an AI-native architecture platform for engineering teams. Describe a system — get a diagram and 14-framework code exports. Index your repo — agents query a structured graph of files, symbols, imports, and call edges instead of re-grepping source every session.
This MCP server gives your AI assistant **36 tools**:
Architecture (10 tools)
| Tool | Description |
|------|-------------|
| create_architecture | Design a new system from a description |
| update_architecture | Modify an existing architecture |
| get_architecture | Read architecture details |
| list_architectures | Browse all saved designs |
| analyze_codebase | Scan local code and generate diagram |
| lint_architecture | Quality checks (9 rules: orphans, SPOFs, god services) |
| sync_architecture | Detect drift between diagram and code |
| get_spec_alignment | Mid-implementation drift check — changed files in, spec context + drift signals out |
| export_architecture | Export to 14 frameworks (Java, Python, Go, Rust, etc.) |
| create_flow | Create step-by-step flow visualization |
Code Graph — Write (4 tools)
| Tool | Description |
|------|-------------|
| index_code | Walk a repo, Tree-sitter locally, start a semantic indexing job |
| index_code_continue | Resume an in-progress indexing job |
| record_semantic_node | Persist an agent-extracted semantic annotation |
| get_index_job | Check status of an indexing job |
Code Graph — Read (13 tools)
| Tool | Description |
|------|-------------|
| query_symbols | Fuzzy trigram search across indexed symbols |
| find_references | Every resolved caller of a symbol — refactor-safety primitive |
| safe_rename | Patch plan (definition + every call site) for renaming a symbol |
| explain_codebase | Agent-ready narrative walkthrough of a whole repo |
| get_symbol_neighbors | BFS traversal in the call/import graph |
| get_service_code_graph | Subgraph for a canvas service |
| explain_code_path | Shortest path between two symbols with semantic context |