local-only server
The server can only run on the client’s local machine because it depends on local resources.
Integrations
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
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:
import
statement,require
statement - Python:
import
statement,from ... import
statement - Ruby:
require
statement,require_relative
statement - Rust:
mod
declaration,use
statement
- TypeScript/JavaScript:
- Corresponds to path aliases in tsconfig.json (such as
@/components/...
) - Supports special features for each language
- Python:
__init__.py
, relative imports - Rust:
mod.rs
pattern - TypeScript: alias,
index.ts
- Ruby: require without extension
- Python:
set up
Prerequisites
- Python 3.10 or later
- uv
install
Claude for Desktop Settings
Add the following to claude_desktop_config.json
:
How to use
Use by Claude
/Users/xxx/GitHub/xxx/ のソースの依存関係を確認して
and instruct it like this, it will work
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:
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 module
from module import name
from .module import name
from ..module import name
Ruby
require 'module'
require_relative './module'
- Require without extension
Rust
mod module;
use crate::module;
use super::module;
use self::module;
You must be authenticated.
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.