Skip to main content
Glama
GeorgeTsakonas

code-atlas-mcp

  ██████╗ ██████╗ ██████╗ ███████╗      █████╗ ████████╗██╗      █████╗ ███████╗
 ██╔════╝██╔═══██╗██╔══██╗██╔════╝     ██╔══██╗╚══██╔══╝██║     ██╔══██╗██╔════╝
 ██║     ██║   ██║██║  ██║█████╗ █████╗███████║   ██║   ██║     ███████║███████╗
 ██║     ██║   ██║██║  ██║██╔══╝ ╚════╝██╔══██║   ██║   ██║     ██╔══██║╚════██║
 ╚██████╗╚██████╔╝██████╔╝███████╗     ██║  ██║   ██║   ███████╗██║  ██║███████║
  ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝     ╚═╝  ╚═╝   ╚═╝   ╚══════╝╚═╝  ╚═╝╚══════╝
                                 [ M C P ]

高性能AST対応Model Context Protocolサーバー

License: MIT TypeScript Node.js MCP Standard Vitest

Claude Code、Claude Desktop、自律型AIエージェントを、構造的なASTコードマップ、トークン効率の高いスケルトン、PRの影響範囲分析に直接接続します。


📖 概要

最新のLLMコーディングエージェントは、コンテキストウィンドウの**最大70%**を、生のファイルツリーや冗長なファイル内容の読み込みに費やしています。大規模なコードベースを変更する際、AIアシスタントは以下の点を把握できないことがよくあります。

  1. 下流の呼び出し元と依存先: エクスポートされた関数シグネチャを変更すると、5ディレクトリ先の呼び出し元が壊れます。

  2. トークンの肥大化: ファイル全体のダンプは、型定義やシグネチャではなく実装本体にコンテキストを浪費します。

  3. PRのリグレッション影響範囲: 変更されたASTノードをどのユニットテストおよび統合テストスイートがカバーしているかについての認識が不足しています。

code-atlas-mcp、標準の**Model Context Protocol(MCP)**を介してAST対応のインテリジェンスレイヤーを公開することで、この問題を解決します。ソースファイルを構造的なシンボルツリーに解析し、関数本体をトークン効率の高いコードスケルトンに刈り込み、git diff全体で変更されたASTノードを特定し、推移的なリグレッション影響範囲を計算します。


Related MCP server: MCP Filesystem Server

🏛️ アーキテクチャ

┌────────────────────────────────────────────────────────────────────────┐
│                        AI Coding Clients                               │
│        (Claude Code CLI / Claude Desktop / Cursor / Custom Agents)     │
└──────────────────────────────────┬─────────────────────────────────────┘
                                   │  MCP Protocol (JSON-RPC over stdio)
                                   ▼
┌────────────────────────────────────────────────────────────────────────┐
│                          code-atlas-mcp                                │
│  ┌───────────────────────────────┬──────────────────────────────────┐  │
│  │      MCP Request Router       │      Tool Schema Validators      │  │
│  │ (ListTools / CallTool Handler)│          (Zod Runtime)           │  │
│  └───────────────┬───────────────┴──────────────────┬───────────────┘  │
│                  ▼                                  ▼                  │
│  ┌───────────────────────────────┐  ┌───────────────────────────────┐  │
│  │          AST Engine           │  │          Git Engine           │  │
│  │   • TypeScript Compiler API   │  │   • Unified Diff Parser       │  │
│  │   • Symbol & Hierarchy Extr.  │  │   • Line-to-AST Correlation   │  │
│  │   • Token-Efficient Skeletons │  │   • Working Tree / Ref Diffs  │  │
│  └───────────────┬───────────────┘  └───────────────┬───────────────┘  │
│                  └───────────────┬──────────────────┘                  │
│                                  ▼                                     │
│  ┌──────────────────────────────────────────────────────────────────┐  │
│  │                      Impact Analyzer                             │  │
│  │   • Downstream Callers Graph  • Transitive Dependency BFS        │  │
│  │   • Test Suite Coverage Map   • Risk Scoring & Assessment Engine │  │
│  └──────────────────────────────────────────────────────────────────┘  │
└──────────────────────────────────┬─────────────────────────────────────┘
                                   ▼
┌────────────────────────────────────────────────────────────────────────┐
│                          Local Codebase                                │
│               Filesystem (.ts, .tsx, .js, .jsx) & .git                 │
└────────────────────────────────────────────────────────────────────────┘

⚡ コアMCPツール

1. get_repo_structure

リポジトリの階層的なAST刈り込み構造マップを、オプションのトークン効率の高いコードスケルトン付きで返します。関数本体を除去しつつ、完全なシグネチャ、エクスポートされたインターフェース、型、docstringを保持します。

パラメータ

パラメータ

必須

説明

デフォルト

rootDir

string

いいえ

対象のリポジトリディレクトリ。

現在の作業ディレクトリ

includeSkeletons

boolean

いいえ

関数本体を除去したトークン効率の高いコードスケルトンを生成するかどうか。

true

maxDepth

number

いいえ

ディレクトリ走査の最大深度(1〜20)。

5

ignorePatterns

string[]

いいえ

無視するフォルダ/ファイルのglobパターンの配列。

[]

fileExtensions

string[]

いいえ

許可する拡張子の配列(例: ['.ts', '.tsx'])。

標準のTS/JS

ツール出力の例

{
  "rootDir": "/workspace/my-app",
  "totalFiles": 42,
  "totalSymbols": 318,
  "fileTree": {
    "name": "src",
    "type": "directory",
    "children": [
      {
        "name": "auth.ts",
        "type": "file",
        "symbolsCount": 4,
        "summary": {
          "language": "typescript",
          "linesOfCode": 120,
          "symbols": [
            {
              "name": "verifyJwt",
              "kind": "function",
              "signature": "export function verifyJwt(token: string): Promise<JwtPayload>",
              "startLine": 15,
              "endLine": 42,
              "isExported": true
            }
          ],
          "astSkeleton": "import { JwtPayload } from \"./types.js\";\n\nexport function verifyJwt(token: string): Promise<JwtPayload>;"
        }
      }
    ]
  }
}

2. analyze_diff_impact

ブランチ、コミット、または未コミットの作業ツリー間で変更されたASTノードを分析し、影響を受ける下流の関数、クラス、コンポーネントを特定します。

パラメータ

パラメータ

必須

説明

デフォルト

baseRef

string

いいえ

ベースとなるgitリビジョンまたはブランチ(例: 'main''HEAD~1')。

未コミットの作業ツリー

headRef

string

いいえ

ヘッドとなるgitリビジョンまたはブランチ(例: 'feature-auth''HEAD')。

作業ツリーの状態

repoPath

string

いいえ

gitリポジトリのルートへのパス。

現在の作業ディレクトリ

ツール出力の例

{
  "baseRef": "main",
  "headRef": "HEAD",
  "changedFilesCount": 2,
  "modifiedFiles": ["src/auth/jwt.ts"],
  "modifiedAstNodes": [
    {
      "filePath": "src/auth/jwt.ts",
      "symbol": {
        "name": "verifyJwt",
        "kind": "function",
        "signature": "export function verifyJwt(token: string, options?: VerifyOptions): Promise<JwtPayload>",
        "startLine": 12,
        "endLine": 35,
        "isExported": true
      },
      "changeType": "modified",
      "modifiedLines": [12, 13, 14]
    }
  ],
  "affectedDownstream": [
    {
      "symbolName": "verifyJwt",
      "sourceFile": "src/auth/jwt.ts",
      "dependentFile": "src/middleware/auth.ts",
      "impactType": "direct_import",
      "reason": "File 'src/middleware/auth.ts' directly imports symbol 'verifyJwt' modified in 'src/auth/jwt.ts'"
    }
  ],
  "summary": "Diff Impact Analysis: 1 file(s) modified across 1 distinct AST symbol(s). Identified 1 downstream dependent reference(s) that require verification."
}

3. inspect_blast_radius

対象ファイルの変更について、潜在的なリグレッションポイント、推移的な下流依存先(BFS走査)、壊れたテストスイートを特定します。重要因子を含む0〜100のリスクスコアを計算します。

パラメータ

パラメータ

必須

説明

デフォルト

targetFile

string

はい

対象ソースファイルへのパス(例: 'src/services/ast-engine.ts')。

repoPath

string

いいえ

リポジトリのルートへのパス。

現在の作業ディレクトリ

ツール出力の例

{
  "targetFile": "src/services/user.ts",
  "targetSymbols": [ /* AST Symbols */ ],
  "directDependents": [
    {
      "filePath": "src/controllers/auth.ts",
      "importedSymbols": ["getUserById", "updateUser"]
    }
  ],
  "transitiveDependents": [
    {
      "filePath": "src/routes/api.ts",
      "depth": 2,
      "chain": ["src/services/user.ts", "src/controllers/auth.ts", "src/routes/api.ts"]
    }
  ],
  "affectedSuites": [
    {
      "testFile": "tests/auth.test.ts",
      "reliesOn": ["src/services/user.ts", "src/controllers/auth.ts"],
      "riskLevel": "HIGH",
      "potentialFailures": ["getUserById", "updateUser"]
    }
  ],
  "riskAssessment": {
    "score": 65,
    "level": "HIGH",
    "factors": [
      "Exports 4 symbol(s)",
      "High direct coupling: 3 direct dependent files",
      "Moderate cascade: 5 transitive dependents",
      "1 test suite(s) actively verify dependent code"
    ]
  }
}

🚀 インストールとクイックスタート

グローバルCLIインストール

npm install -g code-atlas-mcp

NPXで直接実行

npx code-atlas-mcp --root /path/to/your/project

🤖 Claude統合の設定

Claude Desktopのセットアップ

code-atlas-mcpclaude_desktop_config.jsonに追加します:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

  • Windows: %APPDATA%\Claude\claude_desktop_config.json

  • Linux: ~/.config/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "code-atlas": {
      "command": "npx",
      "args": [
        "-y",
        "code-atlas-mcp"
      ]
    }
  }
}

特定のリポジトリディレクトリを固定したい場合:

{
  "mcpServers": {
    "code-atlas": {
      "command": "npx",
      "args": [
        "-y",
        "code-atlas-mcp",
        "--root",
        "/absolute/path/to/your/repository"
      ]
    }
  }
}

Claude Code CLIのセットアップ

MCPサーバーを接続した状態でclaudeを起動します:

claude --mcp-server "npx -y code-atlas-mcp"

🛠️ 開発とテスト

前提条件

  • Node.js >= 18.0.0

  • npm >= 9.0.0

  • Git CLI

セットアップ

# Clone the repository
git clone https://github.com/GeorgeTsakonas/code-atlas-mcp.git
cd code-atlas-mcp

# Install dependencies
npm install

# Build TypeScript to dist/
npm run build

# Run unit and integration tests with Vitest
npm test

# Run tests in watch mode
npm run test:watch

# Type check
npm run lint

🗺️ ロードマップ

  • TypeScript Compiler APIによるAST抽出

  • トークン効率の高いスケルトン生成(本体の除去)

  • git diffの行からASTノードへの対応付け

  • 下流依存グラフと呼び出しサイトの影響分析

  • 推移的な影響範囲の検査とテストスイートの特定

  • MCP標準stdioトランスポート

  • Python ASTパーサーエンジンのサポート(ast / Tree-sitter)

  • RustおよびGoのAST解析モジュール

  • ASTシンボルに対するセマンティックベクトル検索


🤝 コントリビューション

コントリビューションを歓迎します!お気軽にプルリクエストを送信してください。

  1. プロジェクトをフォークする

  2. フィーチャーブランチを作成する(git checkout -b feature/AmazingFeature

  3. 変更をコミットする(git commit -m 'Add some AmazingFeature'

  4. ブランチにプッシュする(git push origin feature/AmazingFeature

  5. プルリクエストを開く


📄 ライセンス

MITライセンスの下で配布されています。詳細についてはLICENSEを参照してください。

Install Server
A
license - permissive license
B
quality
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    A
    quality
    D
    maintenance
    Enables AI assistants to understand and navigate codebases through structural analysis. Provides code mapping, symbol search, and impact analysis using ast-grep for accurate parsing of Python, JavaScript, TypeScript, and Go projects.
    4
    52
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Provides LLM-optimized tools for advanced code analysis, repository complexity evaluation, and call graph generation. It enables users to visualize directory structures, detect code patterns, and build semantic context with significant token savings.
    11
    MIT
  • A
    license
    B
    quality
    A
    maintenance
    Enables LLMs to efficiently read, write, and refactor code using precise AST-based operations, reducing token usage and context window waste.
    25
    57
    3
    MIT

View all related MCP servers

Related MCP Connectors

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/GeorgeTsakonas/code-atlas-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server