With the SourceSage MCP server, you can generate detailed documentation of a project's directory structure and file contents in Markdown format. Features include:
📁 Directory Structure Visualization: Output an ASCII tree view of the directory structure
📝 File Content Documentation: Automatically document file contents with syntax highlighting based on file type
🔍 Flexible File Exclusion: Exclude specific files and directories using patterns defined in
.SourceSageignore🚀 Implementation: Built with TypeScript using strict type checking for high reliability
💫 Usage Options: Specify target directory and optional ignore file path using absolute paths
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.
Provides visualization for npm packages with integrated badges showing npm version and download statistics, while automatically handling npm-specific files like package-lock.json through built-in ignore patterns.
Specializes in TypeScript project visualization with proper syntax highlighting for TypeScript files and intelligent documentation of TypeScript configuration settings.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@SourceSage MCPvisualize the directory structure of my current project"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
🌟 SourceSage MCP
📖 概要
SourceSageは、プロジェクトのディレクトリ構造を美しいマークダウン形式で可視化するMCPサーバーです。TypeScriptで実装され、高度なカスタマイズ性と柔軟な除外パターン機能を提供します。また、各ファイルの内容を自動的にドキュメント化し、プロジェクトの全体像を把握しやすくします。
Related MCP server: Markdown Sidecar MCP Server
🎯 主な特徴
📁 ディレクトリ構造のマークダウン形式での出力
🎨 美しい木構造表示(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