Skip to main content
Glama

LOREは、TypeScriptプロジェクト向けのプラグインベースのコード考古学エンジンです。ASTを解析し、依存関係をマッピングし、循環参照を検出し、非同期チェーンを追跡し、型の安全性をスコアリングします。そして、Model Context Protocol (MCP) を通じて、AIコーディングアシスタントにアーキテクチャの知見を提供します。

EliotShiftによって構築 · 16の実プロジェクトで実戦テスト済み · 合格率100%


なぜLOREなのか?

AIコーディングアシスタントは高速にコードを書きますが、アーキテクチャの記憶が欠けています。以下のようなことを記憶できません:

  • どのファイルが密結合しているか

  • 循環依存がどこにあるか

  • どの型が境界を越えて広がっているか

  • どのファイルが頻繁に変更されているか(ホットスポット)

  • アーキテクチャのレイヤーがどうなっているか

LOREは、CLI分析とMCPサーバー統合を通じて、AIアシスタントにコードベースのアーキテクチャに対する深い理解を与えることで、この問題を解決します。


Related MCP server: Continuum

機能

13の分析機能

#

アナライザー

機能

1

ASTパーサー

ts-morphと正規表現を組み合わせた完全なTypeScript/TSX解析

2

依存関係グラフ

プロジェクト全体のすべてのインポート、エクスポート、再エクスポートをマッピング

3

循環依存検出器

循環参照を見つけ、深刻度順にランク付け

4

依存関係方向チェッカー

レイヤー規則の強制(例:コントローラーからDBへのインポート禁止)

5

シャノンエントロピー

ファイルごとの複雑性スコアリング(単純 → 非常に複雑)

6

ホットスポット分析

Gitチャーン検出 — 変更頻度が高すぎるファイルを特定

7

インポート影響分析

すべてのインポートの爆発半径(影響範囲)を表示

8

型安全性スコアラー

anyの使用、明示的な型、厳格さを評価

9

隠れた結合検出器

共有型を通じた暗黙的な依存関係を見つける

10

AI推奨事項

優先順位付けされた修正提案(P0–P3)

11

ツール設定チェッカー

ESLint、Prettier、tsconfigの設定を検証

12

破壊的変更検出器

リスクの高い非推奨パターンにフラグを立てる

13

アーキテクチャギャップファインダー

不足している抽象化やパターンを特定

MCP統合 (8つのツール + 3つのリソース)

LOREをClaude Desktop、VS Code、Cursor、または任意のMCPクライアントに公開します:

ツール

説明

analyze

プロジェクト全体の分析 — スコア、違反、複雑性、ホットスポット

get-scores

ヘルススコア:全体、型安全性、ツール、アーキテクチャ

get-violations

循環参照、レイヤー違反、アーキテクチャのギャップ

get-recommendations

AIによる改善提案(P0–P3)

get-hotspots

Gitチャーンが高いファイル(赤/黄/緑)

get-entropy

シャノンエントロピー複雑性レポート

query-file

ファイルのインポート、エクスポート、コンシューマー、複雑性

analyze_architecture

詳細なTS分析:フレームワーク、レイヤー、非同期チェーン、型フロー

リソース

説明

lore://analysis

最新の分析結果 (JSON)

lore://architecture

詳細なアーキテクチャグラフ (JSON)

lore://config

環境およびキャッシュの状態 (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など

MCP統合

Claude Desktop、Cursor、Windsurfの設定

例

Express、NestJS、Next.jsなどの実プロジェクト分析例

FAQ

よくある質問


クイックスタート

インストール

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を再起動し、以下のように尋ねてください:

"プロジェクトのアーキテクチャを分析して" → LOREが analyze_architecture を実行 "循環依存関係はどこにある?" → LOREが get-violations を実行 "ホットスポットになっているファイルはどれ?" → LOREが get-hotspots を実行 "AIからの推奨事項は何?" → 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。


仕組み

  1. 解析 (Parse) — LOREは、ts-morphと正規表現を組み合わせたハイブリッドパーサーを使用して、すべての .ts/.tsx ファイルを解析します

  2. グラフ構築 (Build Graph) — 型付きエッジ(import, type-ref, decorator, async-chain, implements, extends)を持つ依存関係グラフを構築します

  3. プラグイン実行 (Run Plugins) — 13のアナライザーがプラグインパイプラインを通じて並列実行されます

  4. スコアリング (Score) — ヘルススコア(型安全性、ツール、アーキテクチャ、総合0–100)を計算します

  5. 推奨 (Recommend) — AIエンジンが優先順位付けされた提案(P0 致命的 → P3 あれば望ましい)を生成します

  6. 提供 (Serve) — 結果はCLI出力、MCPツール、またはSARIF形式で利用可能です


検証

プロジェクト

ファイル数

結果

Express

42

100% 合格

Next.js

68

100% 合格

Fastify

55

100% 合格

NestJS

38

100% 合格

Prisma

45

100% 合格

Zod

35

100% 合格

TypeORM

60

100% 合格

+ 他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 スキーマ

出力

ANSIターミナル, Markdown, SARIF


ライセンス

MIT © 2025 EliotShift


Available Tools

3 tools
get_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

    A3.7/5.0

    Scored across 3 tools

    Disambiguation5/5

    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.

    Naming Consistency5/5

    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.

    Tool Count4/5

    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.

    Completeness4/5

    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

    ActivityNo data
    ResponsivenessSyncing

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      Provides 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
    • A
      license
      Not graded
      quality
      D
      maintenance
      Automatically 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.
      6
      MIT
    • A
      license
      A
      quality
      A
      maintenance
      Local-first memory layer for AI coding agents — captures issues, attempts, fixes, and decisions, and warns at git commit before you repeat a mistake.
      19
      2,236 PyPI
      885
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Provides AI coding assistants with persistent, context-rich memory of a codebase, including documentation and git history, enabling recall across sessions.
      105
      Apache 2.0