# Maven Decoder MCP Server
A comprehensive Model Context Protocol (MCP) server for analyzing Maven jar files in your local repository (`~/.m2`). This server provides powerful tools for agentic coding assistance in Java projects, enabling AI agents to understand dependencies, analyze bytecode, extract source code, and navigate the Maven ecosystem.
## ๐ Features
### Core Functionality
- **Jar File Analysis**: Deep inspection of jar files including metadata, manifests, and structure
- **Dependency Resolution**: Complete dependency tree analysis with transitive dependencies
- **Source Code Extraction**: Extract source code from source jars or decompile bytecode
- **Class Information**: Detailed class signatures, methods, fields, and annotations
- **Search Capabilities**: Find classes, methods, and dependencies across all artifacts
- **Version Management**: Compare versions, find dependents, and track version conflicts
### Advanced Features
- **Decompilation Support**: Integrated support for multiple Java decompilers (CFR, Fernflower, Procyon)
- **Conflict Analysis**: Detect and analyze dependency version conflicts
- **Repository Navigation**: Browse and explore the local Maven repository structure
- **Metadata Parsing**: Extract and parse Maven POM files and metadata
- **Service Discovery**: Find and analyze Java services and SPI implementations
## ๐ฆ Installation
### Prerequisites
- Java 8+ (for decompilation features)
- Maven local repository (`~/.m2/repository`)
- One of: **Python 3.8+**, **Node.js 14+**, or **Docker**
### ๐ Quick Install
#### One-Line Install (Recommended)
```bash
curl -fsSL https://raw.githubusercontent.com/salitaba/maven-decoder-mcp/main/install.sh | bash
```
### ๐ Installation Methods
#### Method 1: Python/pip (Recommended)
```bash
# Install the package
pip install maven-decoder-mcp
# Install MCP SDK
pip install "git+https://github.com/modelcontextprotocol/python-sdk.git"
# Run the server
maven-decoder-mcp
```
#### Method 2: Node.js/npm
```bash
# Install globally
npm install -g maven-decoder-mcp
# Or install locally
npm install maven-decoder-mcp
# Run the server
maven-decoder-mcp
# or if installed locally: npx maven-decoder-mcp
```
#### Method 3: Docker
```bash
# Pull and run
docker run --rm -it \
-v ~/.m2:/home/mcpuser/.m2 \
-v $(pwd):/workspace \
maven-decoder/mcp-server:latest
```
#### Method 4: From Source (Development)
```bash
# Clone repository
git clone https://github.com/salitaba/maven-decoder-mcp.git
cd maven-decoder-mcp
# Option 4a: Using Virtual Environment
python3 -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
pip install -r requirements.txt
pip install "git+https://github.com/modelcontextprotocol/python-sdk.git"
./setup_decompilers.sh
# Option 4b: System-wide Installation
pip3 install -r requirements.txt
pip3 install "git+https://github.com/modelcontextprotocol/python-sdk.git"
./setup_decompilers.sh
```
## ๐ง Configuration
### For Cursor IDE
Add to your `~/.cursor/mcp_servers.json`:
```json
{
"maven-decoder": {
"command": "maven-decoder-mcp",
"args": []
}
}
```
### For Other MCP Clients
The server runs as a standard MCP server and can be integrated with any MCP-compatible client.
## ๐ ๏ธ Available Tools
| Tool | Description |
|------|-------------|
| `list_artifacts` | List artifacts in Maven repository with filtering |
| `analyze_jar` | Analyze jar file structure and contents |
| `extract_class_info` | Get detailed information about Java classes |
| `get_dependencies` | Retrieve Maven dependencies from POM files |
| `search_classes` | Search for classes across all jars |
| `extract_source_code` | Decompile and extract Java source code |
| `compare_versions` | Compare different versions of artifacts |
| `find_usage_examples` | Find usage examples in test code |
| `get_dependency_tree` | Get complete dependency tree |
| `find_dependents` | Find artifacts that depend on a specific artifact |
| `get_version_info` | Get all available versions of an artifact |
| `analyze_jar_structure` | Analyze overall jar structure and metadata |
## ๐ก Usage Examples
### Finding Dependencies
```
"Show me all dependencies of org.springframework:spring-core:5.3.21"
```
### Decompiling Classes
```
"Decompile the class com.example.MyService from my Maven repository"
```
### Analyzing Conflicts
```
"Find all version conflicts in my Maven repository"
```
### Exploring APIs
```
"Show me all public methods in the Jackson ObjectMapper class"
```
## ๐๏ธ Architecture
The server is built with a modular architecture:
- **`MavenDecoderServer`**: Main MCP server implementation
- **`JavaDecompiler`**: Handles multiple decompilation strategies
- **`MavenDependencyAnalyzer`**: Analyzes Maven dependencies and metadata
- **Decompilers**: CFR, Procyon, Fernflower, and javap integration
## ๐งช Development
### Running Tests
```bash
# Install development dependencies
pip install -e ".[dev]"
# Run tests
pytest
# Run specific test
python test_startup.py
```
### Building Package
```bash
# Build distribution
python setup.py sdist bdist_wheel
# Install locally
pip install dist/maven_decoder_mcp-*.whl
```
### Docker Development
```bash
# Build Docker image
docker build -t maven-decoder-mcp .
# Run container
docker run --rm -it maven-decoder-mcp
```
## ๐ Configuration Options
### Environment Variables
- `MAVEN_HOME`: Custom Maven repository location (default: `~/.m2/repository`)
- `MCP_LOG_LEVEL`: Logging level (DEBUG, INFO, WARNING, ERROR)
### Advanced Configuration
The server automatically detects and configures:
- Maven repository location
- Available Java decompilers
- System capabilities
## ๐ Troubleshooting
### Common Issues
**Server won't start**
```bash
# Check Python installation
python --version
# Check Maven repository
ls ~/.m2/repository
# Check logs
maven-decoder-mcp --debug
```
**Decompilation fails**
```bash
# Check Java installation
java -version
# Setup decompilers manually
maven-decoder-setup decompilers
```
**No artifacts found**
```bash
# Verify Maven repository location
ls ~/.m2/repository
# Run a Maven build to populate repository
mvn dependency:resolve
```
## ๐ค Contributing
1. Fork the repository
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request
## ๐ License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
## ๐ Acknowledgments
- [Model Context Protocol](https://github.com/modelcontextprotocol) - The protocol that powers this server
- [CFR](https://github.com/leibnitz27/cfr) - Java decompiler
- [Procyon](https://github.com/mstrobel/procyon) - Java decompiler
- [Maven](https://maven.apache.org/) - Dependency management
## ๐ Stats



---
**Made with โค๏ธ for the Java development community**
Raw data
{
"_id": null,
"home_page": null,
"name": "maven-decoder-mcp",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": "Ali Tabatabaei <ali79taba@gmail.com>",
"keywords": "mcp, maven, java, decompiler, jar, analysis, cursor, ide",
"author": null,
"author_email": "Ali Tabatabaei <ali79taba@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/a7/ea/02059378f99d3e369be32bb2735c75bc98380697ec07b7f7be3d67aa9f6a/maven_decoder_mcp-1.0.0.tar.gz",
"platform": null,
"description": "# Maven Decoder MCP Server\n\nA comprehensive Model Context Protocol (MCP) server for analyzing Maven jar files in your local repository (`~/.m2`). This server provides powerful tools for agentic coding assistance in Java projects, enabling AI agents to understand dependencies, analyze bytecode, extract source code, and navigate the Maven ecosystem.\n\n## \ud83d\ude80 Features\n\n### Core Functionality\n- **Jar File Analysis**: Deep inspection of jar files including metadata, manifests, and structure\n- **Dependency Resolution**: Complete dependency tree analysis with transitive dependencies\n- **Source Code Extraction**: Extract source code from source jars or decompile bytecode\n- **Class Information**: Detailed class signatures, methods, fields, and annotations\n- **Search Capabilities**: Find classes, methods, and dependencies across all artifacts\n- **Version Management**: Compare versions, find dependents, and track version conflicts\n\n### Advanced Features\n- **Decompilation Support**: Integrated support for multiple Java decompilers (CFR, Fernflower, Procyon)\n- **Conflict Analysis**: Detect and analyze dependency version conflicts\n- **Repository Navigation**: Browse and explore the local Maven repository structure\n- **Metadata Parsing**: Extract and parse Maven POM files and metadata\n- **Service Discovery**: Find and analyze Java services and SPI implementations\n\n## \ud83d\udce6 Installation\n\n### Prerequisites\n- Java 8+ (for decompilation features)\n- Maven local repository (`~/.m2/repository`)\n- One of: **Python 3.8+**, **Node.js 14+**, or **Docker**\n\n### \ud83d\ude80 Quick Install\n\n#### One-Line Install (Recommended)\n```bash\ncurl -fsSL https://raw.githubusercontent.com/salitaba/maven-decoder-mcp/main/install.sh | bash\n```\n\n### \ud83d\udccb Installation Methods\n\n#### Method 1: Python/pip (Recommended)\n```bash\n# Install the package\npip install maven-decoder-mcp\n\n# Install MCP SDK\npip install \"git+https://github.com/modelcontextprotocol/python-sdk.git\"\n\n# Run the server\nmaven-decoder-mcp\n```\n\n#### Method 2: Node.js/npm\n```bash\n# Install globally\nnpm install -g maven-decoder-mcp\n\n# Or install locally\nnpm install maven-decoder-mcp\n\n# Run the server\nmaven-decoder-mcp\n# or if installed locally: npx maven-decoder-mcp\n```\n\n#### Method 3: Docker\n```bash\n# Pull and run\ndocker run --rm -it \\\n -v ~/.m2:/home/mcpuser/.m2 \\\n -v $(pwd):/workspace \\\n maven-decoder/mcp-server:latest\n```\n\n#### Method 4: From Source (Development)\n```bash\n# Clone repository\ngit clone https://github.com/salitaba/maven-decoder-mcp.git\ncd maven-decoder-mcp\n\n# Option 4a: Using Virtual Environment\npython3 -m venv .venv\nsource .venv/bin/activate # On Windows: .venv\\Scripts\\activate\npip install -r requirements.txt\npip install \"git+https://github.com/modelcontextprotocol/python-sdk.git\"\n./setup_decompilers.sh\n\n# Option 4b: System-wide Installation\npip3 install -r requirements.txt\npip3 install \"git+https://github.com/modelcontextprotocol/python-sdk.git\"\n./setup_decompilers.sh\n```\n\n## \ud83d\udd27 Configuration\n\n### For Cursor IDE\nAdd to your `~/.cursor/mcp_servers.json`:\n\n```json\n{\n \"maven-decoder\": {\n \"command\": \"maven-decoder-mcp\",\n \"args\": []\n }\n}\n```\n\n### For Other MCP Clients\nThe server runs as a standard MCP server and can be integrated with any MCP-compatible client.\n\n## \ud83d\udee0\ufe0f Available Tools\n\n| Tool | Description |\n|------|-------------|\n| `list_artifacts` | List artifacts in Maven repository with filtering |\n| `analyze_jar` | Analyze jar file structure and contents |\n| `extract_class_info` | Get detailed information about Java classes |\n| `get_dependencies` | Retrieve Maven dependencies from POM files |\n| `search_classes` | Search for classes across all jars |\n| `extract_source_code` | Decompile and extract Java source code |\n| `compare_versions` | Compare different versions of artifacts |\n| `find_usage_examples` | Find usage examples in test code |\n| `get_dependency_tree` | Get complete dependency tree |\n| `find_dependents` | Find artifacts that depend on a specific artifact |\n| `get_version_info` | Get all available versions of an artifact |\n| `analyze_jar_structure` | Analyze overall jar structure and metadata |\n\n## \ud83d\udca1 Usage Examples\n\n### Finding Dependencies\n```\n\"Show me all dependencies of org.springframework:spring-core:5.3.21\"\n```\n\n### Decompiling Classes\n```\n\"Decompile the class com.example.MyService from my Maven repository\"\n```\n\n### Analyzing Conflicts\n```\n\"Find all version conflicts in my Maven repository\"\n```\n\n### Exploring APIs\n```\n\"Show me all public methods in the Jackson ObjectMapper class\"\n```\n\n## \ud83c\udfd7\ufe0f Architecture\n\nThe server is built with a modular architecture:\n\n- **`MavenDecoderServer`**: Main MCP server implementation\n- **`JavaDecompiler`**: Handles multiple decompilation strategies\n- **`MavenDependencyAnalyzer`**: Analyzes Maven dependencies and metadata\n- **Decompilers**: CFR, Procyon, Fernflower, and javap integration\n\n## \ud83e\uddea Development\n\n### Running Tests\n```bash\n# Install development dependencies\npip install -e \".[dev]\"\n\n# Run tests\npytest\n\n# Run specific test\npython test_startup.py\n```\n\n### Building Package\n```bash\n# Build distribution\npython setup.py sdist bdist_wheel\n\n# Install locally\npip install dist/maven_decoder_mcp-*.whl\n```\n\n### Docker Development\n```bash\n# Build Docker image\ndocker build -t maven-decoder-mcp .\n\n# Run container\ndocker run --rm -it maven-decoder-mcp\n```\n\n## \ud83d\udcdd Configuration Options\n\n### Environment Variables\n- `MAVEN_HOME`: Custom Maven repository location (default: `~/.m2/repository`)\n- `MCP_LOG_LEVEL`: Logging level (DEBUG, INFO, WARNING, ERROR)\n\n### Advanced Configuration\nThe server automatically detects and configures:\n- Maven repository location\n- Available Java decompilers\n- System capabilities\n\n## \ud83d\udd0d Troubleshooting\n\n### Common Issues\n\n**Server won't start**\n```bash\n# Check Python installation\npython --version\n\n# Check Maven repository\nls ~/.m2/repository\n\n# Check logs\nmaven-decoder-mcp --debug\n```\n\n**Decompilation fails**\n```bash\n# Check Java installation\njava -version\n\n# Setup decompilers manually\nmaven-decoder-setup decompilers\n```\n\n**No artifacts found**\n```bash\n# Verify Maven repository location\nls ~/.m2/repository\n\n# Run a Maven build to populate repository\nmvn dependency:resolve\n```\n\n## \ud83e\udd1d Contributing\n\n1. Fork the repository\n2. Create a feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\n## \ud83d\udcc4 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## \ud83d\ude4f Acknowledgments\n\n- [Model Context Protocol](https://github.com/modelcontextprotocol) - The protocol that powers this server\n- [CFR](https://github.com/leibnitz27/cfr) - Java decompiler\n- [Procyon](https://github.com/mstrobel/procyon) - Java decompiler\n- [Maven](https://maven.apache.org/) - Dependency management\n\n## \ud83d\udcca Stats\n\n\n\n\n\n---\n\n**Made with \u2764\ufe0f for the Java development community**\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "MCP server for reading and decompiling Maven .m2 jar files with comprehensive Java project analysis",
"version": "1.0.0",
"project_urls": {
"Bug Tracker": "https://github.com/salitaba/maven-decoder-mcp/issues",
"Documentation": "https://github.com/salitaba/maven-decoder-mcp#readme",
"Homepage": "https://github.com/salitaba/maven-decoder-mcp",
"Repository": "https://github.com/salitaba/maven-decoder-mcp.git"
},
"split_keywords": [
"mcp",
" maven",
" java",
" decompiler",
" jar",
" analysis",
" cursor",
" ide"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "44c35826ca46dffb826fb614dfcde56a72ffa5453083ba824366264e4ed450bf",
"md5": "561891d093ddf06357b8f18b68309c9e",
"sha256": "8ec1b56444b34cc7b281e156bc68754ca25c82e490a0ea8bc3ad078f2f8d88cb"
},
"downloads": -1,
"filename": "maven_decoder_mcp-1.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "561891d093ddf06357b8f18b68309c9e",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 25253,
"upload_time": "2025-08-23T16:21:09",
"upload_time_iso_8601": "2025-08-23T16:21:09.346639Z",
"url": "https://files.pythonhosted.org/packages/44/c3/5826ca46dffb826fb614dfcde56a72ffa5453083ba824366264e4ed450bf/maven_decoder_mcp-1.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "a7ea02059378f99d3e369be32bb2735c75bc98380697ec07b7f7be3d67aa9f6a",
"md5": "1b9624b5135ecbe22fef612c98ee1f4e",
"sha256": "5c3db56b18e0ce0ee4b35ac347434ad61f9b0f47b9695036a5b52c2fecee4e1c"
},
"downloads": -1,
"filename": "maven_decoder_mcp-1.0.0.tar.gz",
"has_sig": false,
"md5_digest": "1b9624b5135ecbe22fef612c98ee1f4e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 26670,
"upload_time": "2025-08-23T16:21:10",
"upload_time_iso_8601": "2025-08-23T16:21:10.662443Z",
"url": "https://files.pythonhosted.org/packages/a7/ea/02059378f99d3e369be32bb2735c75bc98380697ec07b7f7be3d67aa9f6a/maven_decoder_mcp-1.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-23 16:21:10",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "salitaba",
"github_project": "maven-decoder-mcp",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": null,
"specs": []
},
{
"name": "pydantic",
"specs": [
[
">=",
"2.0.0"
]
]
},
{
"name": "xmltodict",
"specs": [
[
">=",
"0.13.0"
]
]
},
{
"name": "javatools",
"specs": [
[
">=",
"1.4.0"
]
]
},
{
"name": "py4j",
"specs": [
[
">=",
"0.10.9"
]
]
},
{
"name": "aiofiles",
"specs": [
[
">=",
"23.0.0"
]
]
},
{
"name": "pathspec",
"specs": [
[
">=",
"0.11.0"
]
]
},
{
"name": "requests",
"specs": [
[
">=",
"2.25.0"
]
]
}
],
"lcname": "maven-decoder-mcp"
}