Spring Architecture Analyzer MCP
Analyzes Java Spring Boot repositories by scanning source code, building a dependency graph, and providing tools for architecture overview, change impact analysis, cycle detection, architecture rule validation, and refactoring target ranking.
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., "@Spring Architecture Analyzer MCPShow me the architecture overview and any dependency cycles in the Spring Boot repo"
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.
Spring Architecture Analyzer MCP Server 🏛️🔍
A high-performance, local Model Context Protocol (MCP) server for deep static analysis, dependency mapping, and architectural governance of Java Spring Boot (Maven) repositories.
Analyzes Java code directly using Tree-sitter AST parsing, builds a directed dependency graph in SQLite, and generates high-resolution architectural diagrams in dark mode.
🤖 For AI Agents & LLMs: Operational Guide & Tool Contracts
Recommended Execution Sequence
When analyzing a Spring Boot codebase, follow this standard tool sequence:
graph TD
A[index_repository] --> B[get_architecture_overview]
B --> C[generate_dependency_graph]
B --> D[validate_architecture_rules]
B --> E[find_dependency_cycles]
B --> F[rank_refactoring_targets]
D --> G[get_change_impact]Always call
index_repository(repo_path)first: All other tools rely on the cached SQLite graph populated by this call. If not indexed, tools return an error payload:{"error": "No repository has been indexed yet..."}.Call
get_architecture_overview(): To quickly inspect packages, layer distribution, and high-level structure.Call
validate_architecture_rules(): To detect layer skipping (e.g.Controller -> RepositorybypassingService).Call
generate_dependency_graph(layout="layered"): To produce the visual PNG artifact saved locally atoutputs/{repo_name}_dependency_graph.png.Call
get_change_impact(class_name): When asked about the blast radius or risk of modifying a specific class.
Available Tools Specification
Tool Name | Parameters | Returns | Description & Behavior |
|
|
| Scans |
| None |
| Returns high-level architectural metrics and layer distribution ( |
|
|
| Calculates reverse-dependency blast radius (direct & transitive dependents) for a given class. |
| None |
| Identifies circular dependencies (strongly connected components with size > 1). |
| None |
| Checks compliance with clean layering rules. Flags Controller -> Repository direct access. |
|
|
| Ranks classes by refactoring risk score using coupling, cycles, violations, and transitive impact. |
|
|
| Renders a high-resolution, dark-mode PNG architecture diagram to |
Risk Scoring Formula
$$\text{Risk} = 2 \cdot \text{fan_in} + \text{fan_out} + 3 \cdot \text{transitive_impact} + (10 \text{ if in_cycle else } 0) + 8 \cdot \text{violations}$$
Related MCP server: mcp-codebase-oracle
👤 For Developers: Installation & Setup
Prerequisites
Python 3.11+ installed.
Git.
A local Java Maven Spring Boot repository with
src/main/java(e.g.spring-petclinic).
1. Clone & Setup Virtual Environment
# Clone the repository
git clone https://github.com/jcdiegolopez/spring-architecture-analyzer-mcp.git
cd spring-architecture-analyzer-mcp
# Create and activate virtual environment
# Windows (PowerShell):
python -m venv .venv
.\.venv\Scripts\Activate.ps1
# Linux / macOS:
python3 -m venv .venv
source .venv/bin/activate
# Install dependencies
pip install -r requirements.txt2. Verify Installation
Run the automated test suite to ensure Tree-sitter and FastMCP are operational:
pytest⚙️ MCP Host Configuration
Add this server to your MCP host configuration file.
For Custom Hosts (e.g. mcp_servers.json)
{
"mcpServers": {
"architecture": {
"command": "C:/Users/<USER>/.../spring-architecture-analyzer-mcp/.venv/Scripts/python.exe",
"args": [
"C:/Users/<USER>/.../spring-architecture-analyzer-mcp/server.py"
],
"cwd": "C:/Users/<USER>/.../spring-architecture-analyzer-mcp"
}
}
}For Claude Desktop (claude_desktop_config.json)
Windows: %APPDATA%\Claude\claude_desktop_config.json
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"spring-architecture": {
"command": "C:\\path\\to\\spring-architecture-analyzer-mcp\\.venv\\Scripts\\python.exe",
"args": [
"C:\\path\\to\\spring-architecture-analyzer-mcp\\server.py"
]
}
}
}📊 Visual Graph Generator
When generate_dependency_graph is called:
Saved directly to disk: Stored in
outputs/{repo_name}_dependency_graph.png.Architectural Tiers: Organizes classes into colored visual bands:
🟣 Presentation Tier: Controllers (
@Controller,@RestController) & Configurations.🔵 Business Logic: Services (
@Service) & Components (@Component, formatters, validators).🟠 Data Access: Repositories (
@Repository,JpaRepository,CrudRepository).🟢 Domain Models: Entities (
@Entity,MappedSuperclass, tables).
Tech Card Badges: Clean rounded cards displaying component names and coupling metrics (
in:X | out:Y).Curved Directed Edges: Color-coded arcs indicating dependency flow.
🔗 Related Repositories
RD-PR01: Interactive Console MCP Client & Chatbot host (Google Gemini Interactions API).
github-spring-profiler-mcp: Remote Cloudflare Worker MCP for fast remote repository pre-screening.
📄 License
MIT License. See LICENSE for details.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
No tool schema history has been recorded yet.
This server cannot be installed
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
Code intelligence for LLMs. Analyze, search, and retrieve code from any public git repository.
Code intelligence platform for AI agents. 20 tools for architecture, security & impact analysis.
AI Agent with Architectural Memory. Impact analysis (free), tests and code from the graph (pro).
Generate SBOMs, scan vulnerabilities, and analyze dependencies from local projects or Git repos.
Related MCP Servers
- AlicenseAqualityCmaintenanceEnables AI assistants to understand and analyze Spring Boot codebases through static analysis, allowing natural language queries about endpoints, classes, dependencies, and architecture without running the application.13MIT
- AlicenseAqualityDmaintenanceAnalyzes software projects to extract architecture, build dependency graphs, and predict the impact of code changes.241MIT
- AlicenseNot gradedqualityDmaintenanceAnalyzes GitHub and local repositories to automatically generate visual architectural diagrams such as dependency graphs, class diagrams, and data flow diagrams.2MIT
- AlicenseNot gradedqualityAmaintenanceProvides a dependency graph of any local repository with tools for change impact, transitive dependents, health audits, and more, enabling AI coding agents to see structure and refactor safely.4,9124MIT
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/jcdiegolopez/spring-architecture-analyzer-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server