lore-mcp
LORE — это движок для археологии кода на основе плагинов для проектов на TypeScript. Он анализирует ваше AST, строит карту зависимостей, обнаруживает циклические зависимости, отслеживает цепочки асинхронных вызовов, оценивает безопасность типов и передает архитектурную информацию AI-помощникам через Model Context Protocol (MCP).
Создано EliotShift · Проверено в боевых условиях на 16 реальных проектах · 100% успешных проходов.
Почему LORE?
AI-помощники пишут код быстро, но им не хватает архитектурной памяти. Они не могут запомнить:
Какие файлы сильно связаны
Где находятся циклические зависимости
Какие типы распространяются через границы модулей
Какие файлы меняются слишком часто (горячие точки)
Каковы архитектурные слои
LORE решает эту проблему, предоставляя вашему AI-помощнику глубокое понимание архитектуры вашей кодовой базы — через анализ CLI и интеграцию с MCP-сервером.
Related MCP server: Continuum
Возможности
13 анализаторов
# | Анализатор | Что он делает |
1 | AST Parser | Полный парсинг TypeScript/TSX с использованием гибрида ts-morph + regex |
2 | Dependency Graph | Отображает все импорты, экспорты и ре-экспорты в проекте |
3 | Circular Dependency Detector | Находит циклы и ранжирует их по степени серьезности |
4 | Dependency Direction Checker | Обеспечивает соблюдение правил слоев (например, запрет импорта контроллеров в БД) |
5 | Shannon Entropy | Оценка сложности каждого файла (от простого до очень сложного) |
6 | Hotspot Analysis | Обнаружение активности в Git — файлы, которые меняются слишком часто |
7 | Import Impact Analyzer | Показывает радиус поражения каждого импорта |
8 | Type Safety Scorer | Оценивает использование |
9 | Hidden Coupling Detector | Находит неявные зависимости через общие типы |
10 | AI Recommendations | Приоритизированные предложения по исправлению (P0–P3) |
11 | Tooling Config Checker | Проверяет настройки ESLint, Prettier, tsconfig |
12 | Breaking Change Detector | Помечает паттерны с высоким риском нарушения обратной совместимости |
13 | Architectural Gap Finder | Выявляет отсутствующие абстракции и паттерны |
Интеграция с MCP (8 инструментов + 3 ресурса)
Предоставьте LORE доступ к Claude Desktop, VS Code, Cursor или любому другому MCP-клиенту:
Инструмент | Описание |
| Полный анализ проекта — оценки, нарушения, сложность, горячие точки |
| Оценки состояния: общая, безопасность типов, инструменты, архитектура |
| Циклические зависимости, нарушения слоев, архитектурные пробелы |
| AI-предложения по улучшению (P0–P3) |
| Файлы с высокой активностью в git (красный/желтый/зеленый) |
| Отчет о сложности по Шеннону |
| Импорты, экспорты, потребители, сложность файла |
| Глубокий анализ TS: фреймворк, слои, асинхронные цепочки, поток типов |
Ресурс | Описание |
| Последние результаты анализа (JSON) |
| Граф глубокой архитектуры (JSON) |
| Состояние окружения и кэша (JSON) |
Команды CLI
lore [path] Analyze project (default: cwd)
lore analyze [path] Explicit analysis
lore init Extract architectural decisions
lore status View decisions by category
lore diff Diff against saved baseline
lore doctor Environment + tooling check
lore doctor --fix Auto-fix project setup
lore ignore List/manage ignore patterns
lore watch Watch + re-analyze on change
lore mcp inspect Inspect MCP server setup
lore mcp config Claude Desktop config snippet
lore version Show versionДокументация
Веб-сайт: eliotshift.github.io/lore-mcp
Страница | Описание |
Полный обзор функций, значки и быстрый старт | |
Установка через npm, npx и Docker | |
Все команды CLI: init, status, doctor, watch, diff и т.д. | |
Настройка Claude Desktop, Cursor и Windsurf | |
Реальный анализ Express, NestJS, Next.js и других | |
Ответы на часто задаваемые вопросы |
Быстрый старт
Установка
npm install -g lore-mcpИспользование CLI
# Analyze current project
lore
# Analyze a specific project
lore ./my-typescript-project
# Check environment and auto-fix
lore doctor --fix
# Watch for changes
lore watch --filter src/
# Diff from last baseline
lore diffИнтеграция с MCP (Claude Desktop)
Добавьте это в конфигурацию Claude Desktop:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Linux: ~/.config/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"lore": {
"command": "npx",
"args": ["-y", "lore-mcp"]
}
}
}Или если установлено глобально:
{
"mcpServers": {
"lore": {
"command": "lore",
"args": ["mcp"]
}
}
}Перезапустите Claude Desktop, затем спросите:
"Analyze my project architecture" → LORE запустит
analyze_architecture"What are the circular dependencies?" → LORE запуститget-violations"Which files are hotspots?" → LORE запуститget-hotspots"What are the AI recommendations?" → LORE запуститget-recommendations
Архитектура
lore-mcp/
├── src/
│ ├── algorithm/ # LoreGraph, AST parser, async chain builder, type tracker
│ ├── algorithms/ # AI recommendations, hotspot analysis, entropy, scoring
│ ├── analyzer/ # Dependency parsers, circular deps, direction, imports
│ ├── commands/ # CLI: doctor, diff, ignore, init, status, watch
│ ├── core/ # Plugin system, pipeline runner, graph engine
│ ├── lib/ # Hidden coupling, gaps, middleware chain, ontology
│ ├── mcp/ # MCP server + architecture bridge
│ ├── output/ # Formatter, markdown, SARIF, logger
│ ├── plugins/built-in/ # 13 built-in analysis plugins
│ ├── storage/ # Cache and decision store
│ ├── types/ # TypeScript type definitions
│ ├── cli.ts # CLI entry point
│ └── index.ts # MCP server entry point
├── package.json
└── tsconfig.jsonСистема плагинов
LORE использует архитектуру на основе плагинов — каждый анализатор является плагином:
interface LorePlugin {
name: string;
version: string;
analyze(context: AnalysisContext): Promise<PluginResult>;
}Встроенные плагины включают: circular-deps, coupling-matrix, dep-direction, entropy, gaps, hidden-coupling, hotspot, import-impact, middleware-chain, breaking-changes, type-safety, tooling-config, ai-recommendations.
Как это работает
Парсинг — LORE анализирует все файлы
.ts/.tsx, используя гибридный парсер ts-morph + regexПостроение графа — Создает граф зависимостей с типизированными ребрами (import, type-ref, decorator, async-chain, implements, extends)
Запуск плагинов — 13 анализаторов запускаются параллельно через конвейер плагинов
Оценка — Вычисляет оценки состояния (безопасность типов, инструменты, архитектура, общая оценка 0–100)
Рекомендации — AI-движок генерирует приоритизированные предложения (от P0 критических до P3 желательных)
Обслуживание — Результаты доступны через вывод CLI, инструменты MCP или формат SARIF
Валидация
Проект | Файлы | Результат | |
Express | 42 | 100% Pass | |
Next.js | 68 | 100% Pass | |
Fastify | 55 | 100% Pass | |
NestJS | 38 | 100% Pass | |
Prisma | 45 | 100% Pass | |
Zod | 35 | 100% Pass | |
TypeORM | 60 | 100% Pass | + 9 еще |
Все 16 тестовых проектов: 100% успешных проходов, ноль сбоев.
Требования
Node.js >= 18.0.0
TypeScript проект (анализирует файлы
.tsи.tsx)Git (опционально, для анализа горячих точек)
ripgrep (опционально, для более быстрого поиска файлов)
Технологический стек
Компонент | Технология |
Язык | TypeScript 5.5+ |
Парсинг AST | ts-morph 21 |
Протокол | Model Context Protocol (MCP) SDK 1.0 |
Транспорт | Stdio (совместимо с Claude Desktop / IDE) |
Валидация | Zod schemas |
Вывод | ANSI terminal, Markdown, SARIF |
Лицензия
MIT © 2025 EliotShift
Available Tools
3 toolsget_contextA
Get all architectural decisions for this project. Call this at the START of every session to understand the codebase.
Inputs: category, query.
get_gapsB
Find architectural gaps — decisions that were made but may not be fully implemented.
Inputs: no named parameters.
record_decisionA
Record an architectural decision. Call this whenever you make a technical choice that affects the codebase structure.
Inputs: category (required), decision (required), reason (required), alternatives, +2 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
Each tool has a clearly distinct purpose: get_context retrieves existing decisions, get_gaps identifies implementation issues, and record_decision logs new choices. There is no overlap in functionality, making tool selection straightforward for an agent.
All tools follow a consistent verb_noun pattern (get_context, get_gaps, record_decision) with clear, descriptive names. The naming style is uniform and predictable throughout the set.
Three tools are appropriate for the server's purpose of managing architectural decisions, covering retrieval, gap analysis, and recording. While slightly minimal, each tool serves a distinct and necessary function without redundancy.
The tool set covers the core lifecycle of architectural decisions: retrieving context, identifying gaps, and recording new decisions. A minor gap exists in updating or deleting decisions, but agents can likely work around this for basic workflows.
Maintenance
Related MCP Connectors
Codebase intelligence for AI coding agents: graph, git history, docs, decisions, code health.
One shared project memory for your AI coding tools: recall, save and brief decisions anywhere.
Code intelligence platform for AI agents. 20 tools for architecture, security & impact analysis.
AI Agent with Architectural Memory. Impact analysis (free), tests and code from the graph (pro).
Related MCP Servers
AlicenseNot gradedqualityCmaintenanceProvides persistent memory for AI coding assistants, storing and retrieving architectural decisions, patterns, and solutions across sessions using semantic search, while also offering git integration for commit messages and code expertise mapping.MIT- AlicenseNot gradedqualityDmaintenanceAutomatically extracts architectural decisions, patterns, and insights from Git commits to build a local, structured project memory. It exposes this living context to AI tools via MCP, allowing them to understand the historical reasoning and evolution behind your codebase.6MIT
- AlicenseAqualityAmaintenanceLocal-first memory layer for AI coding agents — captures issues, attempts, fixes, and decisions, and warns at git commit before you repeat a mistake.192,236 PyPI885MIT
- AlicenseNot gradedqualityDmaintenanceProvides AI coding assistants with persistent, context-rich memory of a codebase, including documentation and git history, enabling recall across sessions.105Apache 2.0