SourceSage MCP
local-only server
The server can only run on the client’s local machine because it depends on local resources.
Integrations
Provides project directory structure visualization, excluding Git-related files and directories through built-in .SourceSageignore patterns to prevent unnecessary Git metadata from appearing in the structure output.
Enables visualization of GitHub repositories with automatic handling of GitHub-specific files through customizable ignore patterns, while providing badges that link back to the GitHub repository's license, issues, and pull requests.
Offers Node.js project visualization with special handling for Node.js module structures and automatic documentation of Node.js-specific configuration files.
🌟 SourceSage MCP
📖 概要
SourceSageは、プロジェクトのディレクトリ構造を美しいマークダウン形式で可視化するMCPサーバーです。TypeScriptで実装され、高度なカスタマイズ性と柔軟な除外パターン機能を提供します。また、各ファイルの内容を自動的にドキュメント化し、プロジェクトの全体像を把握しやすくします。
🎯 主な特徴
- 📁 ディレクトリ構造のマークダウン形式での出力
- 🎨 美しい木構造表示(ASCII art)
- 📝 ファイル内容の自動ドキュメント化(言語別のシンタックスハイライト付き)
- 🔍 柔軟な除外パターン(.SourceSageignore)
- 🚀 ES2022とNode16モジュールシステムによる最新の実装
- 💫 厳格な型チェックによる高い信頼性
🛠️ 技術スタック
- 🔷 TypeScript (ES2022ターゲット)
- 📦 Model Context Protocol SDK (v0.6.0)
- 🌐 Node.js (Node16モジュールシステム)
- 📚 glob (v11.0.0) - ファイルパターンマッチング
- 🎭 ignore (v6.0.2) - 柔軟なファイル除外機能
📂 プロジェクト構造
⚙️ TypeScript設定
⚙️ インストール
npmからインストール
ソースからビルド
🔧 使用方法
MCPサーバーとしての設定
- MCPの設定ファイルに以下を追加:
🎮 使用可能なツール
generate_structure
プロジェクトのディレクトリ構造を生成し、ファイル内容も含めた詳細なドキュメントを作成します。
使用例
出力サンプル
実際のプロジェクト構造の出力例:
この出力には以下の情報が含まれます:
- 📁 プロジェクト名とOS情報
- 🌳 ディレクトリツリー構造
- 📝 各ファイルの役割と説明
- 🔍 .SourceSageignoreによる不要ファイルの除外
📝 .SourceSageignoreの設定
プロジェクトのルートに.SourceSageignore
ファイルを作成し、除外したいパターンを記述します。デフォルトで以下のような除外パターンが含まれています:
🔄 出力例
👨💻 開発者向け情報
主要な実装詳細
- Server Class:
SourceSageServer
クラスがMCPサーバーの中核機能を提供 - Tree Building:
buildTree
メソッドが再帰的にディレクトリ構造を解析- ディレクトリとファイルを適切にソートして表示
- File Filtering:
ignore
パッケージを使用して柔軟なファイル除外を実現- 豊富なデフォルト除外パターンとカスタム設定をサポート
- Content Generation:
- ファイルタイプに応じた適切なシンタックスハイライト
- ファイルの種類に基づく追加情報の提供
- Async Processing:
glob
パッケージを使用した効率的なファイル走査- 非同期処理による大規模プロジェクトのサポート
開発環境のセットアップ
利用可能なnpmスクリプト
npm run build
: TypeScriptのコンパイルと実行権限の設定npm run prepare
: インストール時の自動ビルドnpm run watch
: 開発時の自動コンパイルnpm run inspector
: MCPインスペクターの起動
🤝 コントリビューション
- このリポジトリをフォーク
- 新しいブランチを作成 (
git checkout -b feature/amazing-feature
) - 変更をコミット (
git commit -m '✨ feat: 素晴らしい機能を追加'
) - ブランチにプッシュ (
git push origin feature/amazing-feature
) - プルリクエストを作成
📄 ライセンス
MIT License - 詳細は LICENSE ファイルを参照してください。
🔗 関連リンク
👥 メンテナー
- Sunwood AI Labs Team
You must be authenticated.
A TypeScript-based server that visualizes project directory structures in Markdown format, automatically documenting file contents with syntax highlighting and supporting customizable exclusion patterns.
- 📖 概要
- 🎯 主な特徴
- 🛠️ 技術スタック
- 📂 プロジェクト構造
- ⚙️ TypeScript設定
- ⚙️ インストール
- 🔧 使用方法
- 📝 .SourceSageignoreの設定
- 🔄 出力例
- 👨💻 開発者向け情報
- 🤝 コントリビューション
- 📄 ライセンス
- 🔗 関連リンク
- 👥 メンテナー