repo-architecture
An MCP server that provides architecture insights by creating diagrams of class, service, and data-flow relationships across the codebase.
claude mcp add --transport stdio vinit-devops-repo-architecture-mcp repo-architecture-mcp --log-level INFO \
--env GITHUB_TOKEN="${GITHUB_TOKEN}"How to use
This MCP server analyzes GitHub repositories (public or private, via a GitHub token) or local repositories to generate architectural diagrams. It supports multiple languages (Python, JavaScript/TypeScript, Java, and Go) and can produce dependency diagrams, UML class diagrams, and data flow diagrams. Outputs can be exported in Mermaid, SVG, or PNG formats. Use the provided MCP tools to analyze a repository, then generate the corresponding visualizations. You can run the server with standard logging or enable DEBUG logs for troubleshooting. The available tools include: analyze_repository to inspect repository structure and code, generate_dependency_diagram to visualize module and service dependencies, generate_class_diagram to depict class relationships and inheritance, generate_data_flow_diagram to show data movement, and get_repository_summary for high-level statistics. You can point tools at either GitHub URLs or local paths, and you can save diagrams to files with save_to_file and output_path options when supported by each tool.
How to install
Prerequisites:
- Python 3.8+ and pip
- A GitHub personal access token (for GitHub repository analysis)
Installation steps:
- Ensure Python and pip are installed
- Install the MCP server in editable mode (for development):
pip install -e .
- (Optional) Install development dependencies to enable dev features:
pip install -e ".[dev]"
- Verify installation by listing the CLI help:
repo-architecture-mcp --help
- Start with basic usage to confirm the server runs:
repo-architecture-mcp --log-level INFO
- For local repository analysis (no GitHub token needed):
repo-architecture-mcp --analyze-local /path/to/your/project
Additional notes
Tips and notes:
- Environment variable GITHUB_TOKEN is required when analyzing GitHub repositories. Export it before starting the MCP server.
- You can adjust logging with --log-level (DEBUG, INFO, WARNING, ERROR).
- Use --max-workers to control parallel processing; default is 4.
- Memory and cache settings can be tuned with --memory-limit and --cache-ttl.
- Output format can be set globally or per tool to mermaid, svg, or png using --output-format or tool-specific options.
- For local analysis, you can set cwd or work directly in the current directory. The repository tools support saving diagrams to files via save_to_file and output_path where supported.
- Ensure network access for GitHub token-based operations if analyzing private repositories; verify token scopes (repo, read:repo_hook, etc.) as needed.
Related MCP Servers
Gitingest
mcp server for gitingest
github-chat
A Model Context Protocol (MCP) for analyzing and querying GitHub repositories using the GitHub Chat API.
nautex
MCP server for guiding Coding Agents via end-to-end requirements to implementation plan pipeline
mcp-yfinance
Real-time stock API with Python, MCP server example, yfinance stock analysis dashboard
storyblok
A modular, extensible MCP Server for managing Storyblok spaces, stories, components, assets, workflows, and more via the Model Context Protocol (MCP).
the -company
TheMCPCompany: Creating General-purpose Agents with Task-specific Tools