{"id":30467926,"url":"https://github.com/salitaba/maven-decoder-mcp","last_synced_at":"2026-06-20T12:32:34.993Z","repository":{"id":311276594,"uuid":"1043186464","full_name":"salitaba/maven-decoder-mcp","owner":"salitaba","description":"MCP server for inspecting, searching, and decompiling Maven .m2 JARs for Java AI coding agents.","archived":false,"fork":false,"pushed_at":"2026-05-10T11:43:37.000Z","size":3779,"stargazers_count":18,"open_issues_count":1,"forks_count":3,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-10T12:39:39.574Z","etag":null,"topics":["agentic-coding","ai-agents","bytecode","cursor-ide","decompiler","dependency-analysis","docker","jar","java","maven","maven-repository","mcp","mcp-server","model-context-protocol","python","skills"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/salitaba.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-08-23T10:15:40.000Z","updated_at":"2026-05-10T11:20:01.000Z","dependencies_parsed_at":"2025-08-23T19:36:04.874Z","dependency_job_id":"d8ab2436-4c5f-43bd-a685-aaa9aa56c0d2","html_url":"https://github.com/salitaba/maven-decoder-mcp","commit_stats":null,"previous_names":["salitaba/maven-decoder-mcp"],"tags_count":25,"template":false,"template_full_name":null,"purl":"pkg:github/salitaba/maven-decoder-mcp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salitaba%2Fmaven-decoder-mcp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salitaba%2Fmaven-decoder-mcp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salitaba%2Fmaven-decoder-mcp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salitaba%2Fmaven-decoder-mcp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/salitaba","download_url":"https://codeload.github.com/salitaba/maven-decoder-mcp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salitaba%2Fmaven-decoder-mcp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34570534,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-20T02:00:06.407Z","response_time":98,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agentic-coding","ai-agents","bytecode","cursor-ide","decompiler","dependency-analysis","docker","jar","java","maven","maven-repository","mcp","mcp-server","model-context-protocol","python","skills"],"created_at":"2025-08-24T06:20:07.930Z","updated_at":"2026-06-20T12:32:34.989Z","avatar_url":"https://github.com/salitaba.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Maven Decoder MCP Server\n\n[![skills.sh](https://skills.sh/b/salitaba/maven-decoder-mcp)](https://skills.sh/salitaba/maven-decoder-mcp)\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## 🚀 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- **Response Management**: Intelligent pagination and summarization for large responses\n- **Method Extraction**: Extract specific methods from large Java classes\n\n## 📦 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### 🚀 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### 📋 Installation Methods\n\n#### Method 1: uvx (Recommended)\n```bash\n# Install uv (if not installed)\ncurl -Ls https://astral.sh/uv/install.sh | sh\n# Ensure your shell PATH is updated (restart shell or eval as printed by installer)\n\n# Run the server via uvx (isolated, fast, no venv needed)\nuvx maven-decoder-mcp\n\n# Optional: pick a specific Python\n# uvx --python 3.12 maven-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  ali79taba/maven-decoder-mcp: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 A: 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 B: System-wide Installation (not recommended)\n./setup_decompilers.sh\n```\n\n## 🔧 Configuration\n\n### For Cursor IDE\nAdd to your `~/.cursor/mcp_servers.json`:\n\n```json\n{\n  \"maven-decoder\": {\n    \"command\": \"uvx\",\n    \"args\": [\"maven-decoder-mcp\"]\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## 🧠 AI Agent Skill\n\nThis repository includes a `maven-code-search` agent skill that tells AI coding agents when and how to use this MCP for searching installed Maven package code.\n\n```bash\nnpx skills add https://github.com/salitaba/maven-decoder-mcp --skill maven-code-search\n```\n\nThe skill is located at `skills/maven-code-search` and is ready for skills.sh indexing after the repository is pushed.\n\n## 🛠️ 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| `extract_jar_resource` | Extract text resources such as `.proto` files, services, and metadata |\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| `extract_method_info` | Extract specific method information from Java classes |\n\n## 💡 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### Inspecting Compiled-Only Artifacts\n```\n\"The sources jar is missing. Use extract_class_info for bytecode-backed fields and methods.\"\n\"Find and read .proto resources from com.example:protobuf-lib:1.0.0\"\n```\n\nWhen a dependency has no sources jar, `extract_class_info` uses `javap` internally and returns parsed fields, methods, bytecode version, and optional verbose bytecode output. Agents should use `analyze_jar`, `extract_class_info`, `extract_source_code`, and `extract_jar_resource` through this MCP instead of running `jar` or `javap` directly.\n\n### Working with Large Responses\n```\n\"List all Spring classes with pagination (page 2, 10 items per page)\"\n\"Extract source code for a large class with summarization\"\n\"Get method information for specific patterns in a class\"\n```\n\n## 🔄 Response Management\n\n### Pagination Support\nThe server automatically handles large responses through intelligent pagination:\n\n- **Automatic Detection**: Responses exceeding 50KB are automatically paginated\n- **Configurable Page Size**: Default 20 items per page, customizable per request\n- **Pagination Metadata**: Each response includes pagination information\n- **Supported Tools**: `list_artifacts`, `extract_class_info`, `search_classes`, `get_dependencies`, `find_dependents`, `get_version_info`\n\n### Summarization Features\nLarge text content is automatically summarized to improve readability:\n\n- **Smart Summarization**: Preserves important parts (package declarations, method signatures, closing braces)\n- **Configurable Limits**: Default 10KB text limit, customizable\n- **Java-Specific**: Optimized for Java source code structure\n- **Metadata Preservation**: Original structure and metadata are maintained\n\n### Method Extraction\nNew tool for targeted access to specific methods:\n\n- **Pattern Matching**: Use regex patterns to find specific methods\n- **Limited Results**: Control the number of methods returned\n- **Full Context**: Includes method signatures, bodies, and line numbers\n- **Efficient Processing**: Only extracts requested methods, not entire classes\n\n## 🏗️ Architecture\n\nThe server is built with a modular architecture:\n\n- **`MavenDecoderServer`**: Main MCP server implementation\n- **`ResponseManager`**: Handles pagination and summarization\n- **`JavaDecompiler`**: Handles multiple decompilation strategies\n- **`MavenDependencyAnalyzer`**: Analyzes Maven dependencies and metadata\n- **Decompilers**: CFR, Procyon, Fernflower, and javap integration\n\n## 🧪 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## 📝 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- `MCP_MAX_RESPONSE_SIZE`: Maximum response size in bytes (default: 50000)\n- `MCP_MAX_ITEMS_PER_PAGE`: Default items per page (default: 20)\n- `MCP_MAX_TEXT_LENGTH`: Maximum text length before summarization (default: 10000)\n- `MCP_MAX_LINES`: Maximum lines before summarization (default: 500)\n\n### Advanced Configuration\nThe server automatically detects and configures:\n- Maven repository location\n- Available Java decompilers\n- System capabilities\n\n## 🔍 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\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## 🤝 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## 📄 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## 🙏 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## 📊 Stats\n\n![GitHub Stars](https://img.shields.io/github/stars/salitaba/maven-decoder-mcp)\n![PyPI Downloads](https://img.shields.io/pypi/dm/maven-decoder-mcp)\n![Docker Pulls](https://img.shields.io/docker/pulls/ali79taba/maven-decoder-mcp)\n\n---\n\n**Made with ❤️ for the Java development community**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsalitaba%2Fmaven-decoder-mcp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsalitaba%2Fmaven-decoder-mcp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsalitaba%2Fmaven-decoder-mcp/lists"}