Content
# Easy Jar MCP Server
A JAR/ZIP/WAR/EAR archive analysis tool based on Model Context Protocol (MCP), supporting Java decompilation, frontend project source code analysis, and SSH remote server inspection.
## Features
- **Archive Analysis**: Read JAR/ZIP/WAR/EAR file structure, manifest, and dependencies
- **Java Decompilation**: Support CFR/javap dual engines for decompiling JAR internal classes, JDK built-in classes, and Maven project classes
- **Frontend Source Code Analysis**: Analyze frontend project dependency structure, read node_modules module source code (supporting sourcemap restoration and Vue SFC parsing)
- **SSH Remote**: Find, read, and decompile JAR files on remote servers via SSH
## MCP Tool List
### Environment Check
| Tool | Description | Key Parameters |
|------|-------------|---------------|
| `check_environment` | Check Java/CFR/javap environment availability | None |
### Archive File Operations
| Tool | Description | Key Parameters |
|------|-------------|---------------|
| `list_entries` | List all entries in an archive file | `filePath`, `filter`, `type` |
| `read_entry` | Read the content of a specified entry in an archive file | `filePath`, `entryPath`, `encoding` |
| `read_manifest` | Read MANIFEST.MF and pom.properties | `filePath` |
| `search_entries` | Search for entries in an archive file | `filePath`, `pattern`, `includePackages` |
| `analyze_jar` | Analyze archive file structure, dependencies, and metadata | `filePath` |
| `extract_entry` | Extract a specified entry from an archive file to local | `filePath`, `entryPath`, `outputPath` |
### Java Decompilation
| Tool | Description | Key Parameters |
|------|-------------|---------------|
| `decompile_class` | Decompile Java class files | `className`, `jarPath`, `projectPath`, `decompiler` |
| `decompile_jar` | Batch decompile entire JAR files | `filePath`, `filter`, `decompiler` |
> **Decompiler Selection**: `cfr` (default, generate Java source code) or `javap` (bytecode view, JDK built-in classes auto fallback)
### Frontend Source Code Analysis
| Tool | Description | Key Parameters |
|------|-------------|---------------|
| `analyze_frontend_project` | Analyze frontend project structure, list dependencies and installation status | `projectPath` |
| `read_module_source` | Read node_modules module source code (supporting sourcemap/Vue SFC) | `projectPath`, `moduleName`, `filePath` |
### SSH Remote Operations
| Tool | Description | Key Parameters |
|------|-------------|---------------|
| `set_ssh_config` | Configure SSH server connection | `name`, `host`, `port`, `username`, `password`/`privateKey` |
| `list_ssh_servers` | List configured SSH servers | None |
| `ssh_find_jars` | Find JAR files on remote servers | `serverName`, `searchPath`, `maxDepth` |
| `ssh_list_entries` | List remote JAR file entries | `serverName`, `archivePath` |
| `ssh_read_entry` | Read remote JAR file entry content | `serverName`, `archivePath`, `entryPath` |
| `ssh_decompile_class` | Decompile Java classes in remote JAR files | `serverName`, `archivePath`, `className` |
## Quick MCP Configuration
### Claude Desktop
Edit configuration file:
- **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
- **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
```json
{
"mcpServers": {
"jar": {
"command": "npx",
"args": ["-y", "@hyqf98/easy_jar_mcp_server"]
}
}
}
```
### Claude Code
```bash
claude mcp add jar -- npx -y @hyqf98/easy_jar_mcp_server
```
### Codex CLI
```bash
codex mcp add jar -- npx -y @hyqf98/easy_jar_mcp_server
```
### OpenCode
```bash
opencode mcp add jar -- npx -y @hyqf98/easy_jar_mcp_server
```
> **Local Development**: Replace command with `node /path/to/easy_jar_mcp_server/dist/index.js`
## Usage Examples
### Analyze JAR File
```
Analyze the structure of /path/to/app.jar
```
### Decompile Java Class
```
Decompile java.util.concurrent.ForkJoinPool
```
```
Decompile com.example.MyService class from /path/to/app.jar
```
### Frontend Project Analysis
```
Analyze the dependency structure of /path/to/frontend-project
```
```
Read axios module source code in /path/to/frontend-project
```
### SSH Remote Operations
```
Configure SSH server dev, address 192.168.1.100, user root, password xxxxxx
```
```
Find JAR files in /opt directory on dev server
```
## Prerequisites
- **Node.js** >= 18.0.0
- **Java** >= 8 (decompilation feature required, set JAVA_HOME)
- **CFR** 0.152 (automatically downloaded to `lib/` directory during build)
- **SSH** (only required for remote features, server supports SSH2 protocol)
## Development
```bash
npm install
npm run build # Build (including automatic CFR download)
npm run dev # Development mode (tsx direct run)
npm run start # Run build product
```
## License
MIT License