MCP Source Relation Server
指定されたディレクトリの src
配下のソースコードの関連性を解析するMCPサーバーです。
言語ごとのインポート文を解析し、ファイル間の依存関係を特定します。
Claudeに組み込むことで、Claudeがプロジェクトの依存関係を素早く確認でき、関連するファイルの特定に役立ちます。
機能
- 複数言語のインポート解析をサポート
- TypeScript/JavaScript:
import
文、require
文 - Python:
import
文、from ... import
文 - Ruby:
require
文、require_relative
文 - Rust:
mod
宣言、use
文
- TypeScript/JavaScript:
- tsconfig.jsonのパスエイリアス(
@/components/...
など)に対応 - 言語ごとの特殊な機能に対応
- Python:
__init__.py
、相対インポート - Rust:
mod.rs
パターン - TypeScript: エイリアス、
index.ts
- Ruby: 拡張子なしのrequire
- Python:
セットアップ
必要条件
- 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 module
from module import name
from .module import name
from ..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
- AsecurityAlicenseAqualityProvides tools for collecting and documenting code from directories.Last updated -48112TypeScriptMIT License
- -securityAlicense-qualityA Model Context Protocol tool for analyzing code repositories, performing security scans, and assessing code quality across multiple programming languages.Last updated -PythonMIT License
- -securityFlicense-qualityAnalyzes codebases to generate dependency graphs and architectural insights across multiple programming languages, helping developers understand code structure and validate against architectural rules.Last updated -5JavaScript
- -securityAlicense-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.Last updated -2TypeScriptGPL 3.0