MCP Source Relation Server
指定されたディレクトリの src 配下のソースコードの関連性を解析するMCPサーバーです。
言語ごとのインポート文を解析し、ファイル間の依存関係を特定します。
Claudeに組み込むことで、Claudeがプロジェクトの依存関係を素早く確認でき、関連するファイルの特定に役立ちます。
機能
複数言語のインポート解析をサポート
TypeScript/JavaScript:
import文、require文Python:
import文、from ... import文Ruby:
require文、require_relative文Rust:
mod宣言、use文
tsconfig.jsonのパスエイリアス(
@/components/...など)に対応言語ごとの特殊な機能に対応
Python:
__init__.py、相対インポートRust:
mod.rsパターンTypeScript: エイリアス、
index.tsRuby: 拡張子なしのrequire
セットアップ
必要条件
Python 3.10以上
uv
インストール
Claude for Desktopでの設定
claude_desktop_config.json に以下の設定を追加してください:
使用方法
Claudeでの使用
/Users/xxx/GitHub/xxx/ のソースの依存関係を確認して のように指示すると動作します
ディレクトリを指定した場合はその下の src ディレクトリを解析します
ファイルを指定した場合はそのファイルを基準に解析します
promptからのパス入力にも対応しています
promptで利用する場合は、Attach from MCP->Choose an integration->source-relationを選択してください
出力形式
解析結果は以下のようなJSON形式で出力されます:
すべてのパスはsrcディレクトリを基準とした相対パスで表示されます。
サポートされるインポート形式
TypeScript/JavaScript
import { Component } from './Component'import type { Type } from '@/types'import './styles.css'require('./module')エイリアスパス(
@/components/...)
Python
import modulefrom module import namefrom .module import namefrom ..module import name
Ruby
require 'module'require_relative './module'拡張子なしのrequire
Rust
mod module;use crate::module;use super::module;use self::module;
local-only server
The server can only run on the client's local machine because it depends on local resources.
Tools
Analyzes source code dependencies across multiple programming languages in the specified directory to identify file relationships, assisting in dependency management and project structure understanding.
Related Resources
Related MCP Servers
- Asecurity-licenseAqualityProvides tools for collecting and documenting code from directories.Last updated -47315MIT License
- Asecurity-licenseAqualityAnalyzes codebases to generate dependency graphs and architectural insights across multiple programming languages, helping developers understand code structure and validate against architectural rules.Last updated -6914
- -security-license-qualityA tool that helps rank codebase files by importance (1-10 scale), track file dependencies, and provide summaries, all accessible through a simple JSON-based interface.
- Asecurity-licenseAqualityProvides code context and analysis for AI assistants by extracting directory structures and code symbols using WebAssembly Tree-sitter parsers with zero native dependencies.Last updated -14318MIT License