MCP Source Relation Server
The MCP Source Relation Server analyzes dependencies between source code files in a specified directory to identify import relationships across multiple programming languages.
Capabilities:
Analyzes entire directories or specific files
Supports TypeScript/JavaScript, Python, Ruby, and Rust
Handles language-specific features like path aliases,
__init__.py,mod.rs, and extension-less requiresGenerates dependency relationships in structured JSON format
Provides results with paths relative to the source directory
Extensible through a base analyzer class for adding new language support
Analyzes JavaScript files for import statements and require statements to determine file dependencies
Analyzes Python files for import statements, from...import statements, init.py, and relative imports to determine file dependencies
Analyzes Ruby files for require statements and require_relative statements, including those without extensions, to determine file dependencies
Analyzes Rust files for mod declarations, use statements, and mod.rs patterns to determine file dependencies
Analyzes TypeScript files for import statements, require statements, and supports path aliases (like @/components/...) to determine file dependencies
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., "@MCP Source Relation Serveranalyze dependencies in my project's src folder"
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.
MCP Source Relation Server
This is an MCP server that analyzes the relationships of source code under src directory of a specified directory. It analyzes import statements for each language and identifies dependencies between files. By incorporating it into Claude, Claude can quickly check the dependencies of a project and help identify related files.
function
Supports multi-language import parsing
TypeScript/JavaScript:
importstatement,requirestatementPython:
importstatement,from ... importstatementRuby:
requirestatement,require_relativestatementRust:
moddeclaration,usestatement
Corresponds to path aliases in tsconfig.json (such as
@/components/...)Supports special features for each language
Python:
__init__.py, relative importsRust:
mod.rspatternTypeScript: alias,
index.tsRuby: require without extension
Related MCP server: QoutaMCP
set up
Prerequisites
Python 3.10 or later
uv
install
# uvのインストール
$ curl -LsSf https://astral.sh/uv/install.sh | sh
$ cd /path/to/mcp-source-relation
# ライブラリのインストール
$ uv syncClaude for Desktop Settings
Add the following to claude_desktop_config.json :
{
"mcpServers": {
"source-relation": {
"command": "uv",
"args": [
"--directory",
"/path/to/mcp-source-relation", # このプロジェクトディレクトリの絶対パスに書き換えてください
"run",
"source_relation.py"
]
}
}
}How to use
Use by Claude
/Users/xxx/GitHub/xxx/ のソースの依存関係を確認してand instruct it like this, it will work
`/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` を継承することで実現できる設計になっていることがわかります。If you specify a directory, the src directory under it will be analyzed. If you specify a file, the analysis will be based on that file. It also supports path input from the prompt. To use it with a prompt, select Attach from MCP -> Choose an integration -> source-relation .
Output Format
The analysis results are output in JSON format as follows:
{
"dependencies": {
"components/Button.tsx": [
"types/index.ts",
"utils/theme.ts"
],
"pages/index.tsx": [
"components/Button.tsx",
"utils/api.ts"
]
}
}All paths are relative to the src directory.
Supported import formats
TypeScript/JavaScript
import { Component } from './Component'import type { Type } from '@/types'import './styles.css'require('./module')Alias paths (
@/components/...)
Python
import modulefrom module import namefrom .module import namefrom ..module import name
Ruby
require 'module'require_relative './module'Require without extension
Rust
mod module;use crate::module;use super::module;use self::module;
Available Tools
1 toolget_source_relationC
Analyze dependencies between source files
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. The description only states what the tool does at a high level ('analyze dependencies'), but doesn't disclose behavioral traits like whether this is a read-only operation, what format the analysis returns, whether it has side effects, performance characteristics, or error conditions.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise at just 5 words with no wasted language. It's front-loaded with the core purpose and uses efficient phrasing. Every word earns its place in conveying the basic function.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool has no annotations, no output schema, and 0% schema description coverage, the description is completely inadequate. For a tool that performs analysis (potentially complex), the description provides minimal context about what analysis means, what results to expect, or how to interpret them.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The description provides no information about parameters. With 0% schema description coverage and a single required parameter 'path', the description doesn't compensate at all - it doesn't explain what the path parameter represents, what format it expects, or how it relates to the dependency analysis.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description 'Analyze dependencies between source files' states a general purpose (analyzing dependencies) and resource (source files), but lacks specificity about what kind of analysis is performed or what 'dependencies' means in this context. It doesn't distinguish from siblings, but there are no sibling tools to differentiate from.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus alternatives, prerequisites, or constraints. The description implies it's for dependency analysis, but doesn't specify scenarios where this is appropriate or what problems it solves.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
1 tool update
- First observed
get_source_relation
TDQS
With only one tool, there is no possibility of ambiguity or overlap between tools. The single tool has a clearly defined purpose of analyzing dependencies between source files, making it impossible for an agent to misselect between non-existent alternatives.
A single tool inherently exhibits perfect naming consistency, as there are no other tools to compare against. The tool name 'get_source_relation' follows a clear verb_noun pattern, which would be consistent if more tools existed.
A single tool is generally too few for most server purposes, as it limits functionality and suggests an incomplete or overly narrow scope. While it might be appropriate for a highly specialized task, it feels thin and insufficient for comprehensive source dependency analysis, which typically involves multiple operations like listing, updating, or visualizing relations.
The tool set is severely incomplete for the inferred domain of source dependency analysis. With only a 'get' operation, there are obvious gaps such as creating, updating, deleting, or listing source relations, and no support for lifecycle management or advanced queries. This will likely cause agent failures when more complex operations are needed.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Generate SBOMs, scan vulnerabilities, and analyze dependencies from local projects or Git repos.
AI-powered codebase analysis — call graphs, security, dead code, complexity. 150+ tools.
Code intelligence for coding agents: semantic, AST, graph, and full-text search. 279+ languages.
Ground-truth code graph for your codebase: exact callers, callees, symbols & dependencies.
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.66020MIT
- 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.3181ISC
- AlicenseNot gradedqualityDmaintenanceGenerates 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
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