MCP Source Relation Server
MCP 源关系服务器
这是一个分析指定目录的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:无需扩展即可要求
Related MCP server: QoutaMCP
设置
先决条件
Python 3.10 或更高版本
紫外线
安装
# uvのインストール
$ curl -LsSf https://astral.sh/uv/install.sh | sh
$ cd /path/to/mcp-source-relation
# ライブラリのインストール
$ uv syncClaude 用于桌面设置
将以下内容添加到claude_desktop_config.json :
{
"mcpServers": {
"source-relation": {
"command": "uv",
"args": [
"--directory",
"/path/to/mcp-source-relation", # このプロジェクトディレクトリの絶対パスに書き換えてください
"run",
"source_relation.py"
]
}
}
}如何使用
克劳德使用
/Users/xxx/GitHub/xxx/ のソースの依存関係を確認して并像这样指示它,它将起作用
`/Users/owa/GitHub/mcp-source-relation/` のソースコードの依存関係を確認してみましょう。
依存関係の分析結果から、以下のような構造が確認できます:
1. メインの解析モジュール: `src/source_analyzer.py`
- 各言語固有の解析モジュールを利用しています(Ruby, Python, TypeScript, Rust)
2. 言語別の解析モジュール:
- `src/analyzers/ruby.py`
- `src/analyzers/python.py`
- `src/analyzers/typescript.py`
- `src/analyzers/rust.py`
- すべて `src/analyzers/base.py` を継承しています
3. 共通基盤:
- `src/analyzers/base.py`: 基本的な解析機能を提供
- `src/utils/path.py`: パス操作のユーティリティ
- `src/configs/typescript.py`: TypeScript固有の設定
特徴的な点:
- 各言語の解析モジュールは共通の基底クラス(base.py)を継承しており、一貫性のある設計になっています
- TypeScriptのみ独自の設定ファイル(configs/typescript.py)を持っています
- パス操作は共通のユーティリティモジュール(utils/path.py)に集約されています
この構造から、新しい言語のサポートを追加する場合は、`src/analyzers/` に新しいモジュールを追加し、`base.py` を継承することで実現できる設計になっていることがわかります。如果指定目录,则会分析其下的src目录。如果您指定一个文件,则分析将基于该文件。它还支持从提示符输入路径。要与提示一起使用它,请选择Attach from MCP -> Choose an integration -> source-relation 。
输出格式
分析结果以JSON格式输出如下:
{
"dependencies": {
"components/Button.tsx": [
"types/index.ts",
"utils/theme.ts"
],
"pages/index.tsx": [
"components/Button.tsx",
"utils/api.ts"
]
}
}所有路径都相对于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
红宝石
require 'module'require_relative './module'需要无扩展名
锈
mod module;use crate::module;use super::module;use self::module;
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Tools
Related MCP Servers
- AlicenseAqualityDmaintenanceAnalyzes codebases to generate dependency graphs and architectural insights across multiple programming languages, helping developers understand code structure and validate against architectural rules.66119MIT
- AlicenseAqualityDmaintenanceEnables inspection and analysis of project structures to detect languages, frameworks, entry points, and dependencies across multiple programming languages including Node.js, Python, PHP, Go, Java, and Rust.3101ISC
- Alicense-qualityDmaintenanceGenerates and queries a graph representation of a codebase to identify entities and their relationships, such as function calls and inheritance. It supports multiple languages including Python, JavaScript, and Rust to help users navigate and understand complex code structures.2822MIT
- AlicenseBqualityCmaintenanceEnables token-efficient semantic search and analysis over any directory of files through hybrid search, directory overview, structural analysis, and dependency graphs.14MIT
Related MCP Connectors
Generate SBOMs, scan vulnerabilities, and analyze dependencies from local projects or Git repos.
Enterprise code intelligence for M&A, security audits, and tech debt. Hosted server with 200k free.
Scan code for quantum-vulnerable cryptography and get NIST post-quantum migration guidance.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/owayo/mcp-source-relation'
If you have feedback or need assistance with the MCP directory API, please join our Discord server