# J2C Java to C++ MCP server

> Translates Java 17 source code to C++20, identifies translation problems, and provides automated fixes for compatible code.

- Repository: https://github.com/juangp3/j2cpp
- Page: https://hostedmcp.org/servers/juangp3/j2cpp
- Transport: stdio
- Stars: 0
- License: EPL-1.0
- Latest version: 0.6.1

## Install

### Claude Code

```sh
claude mcp add j2cpp -- npx -y @juangp3/j2c-mcp
```

### Cursor (`~/.cursor/mcp.json`)

```json
{
  "mcpServers": {
    "j2cpp": {
      "command": "npx",
      "args": [
        "-y",
        "@juangp3/j2c-mcp"
      ]
    }
  }
}
```

### VS Code (`.vscode/mcp.json`)

```json
{
  "servers": {
    "j2cpp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@juangp3/j2c-mcp"
      ]
    }
  }
}
```

### VS Code CLI

```sh
code --add-mcp '{"name":"j2cpp","type":"stdio","command":"npx","args":["-y","@juangp3/j2c-mcp"]}'
```

### Claude Desktop (`claude_desktop_config.json`)

```json
{
  "mcpServers": {
    "j2cpp": {
      "command": "npx",
      "args": [
        "-y",
        "@juangp3/j2c-mcp"
      ]
    }
  }
}
```

### Codex

```sh
codex mcp add j2cpp -- npx -y @juangp3/j2c-mcp
```

### Codex config.toml (`~/.codex/config.toml`)

```toml
[mcp_servers.j2cpp]
command = "npx"
args = ["-y", "@juangp3/j2c-mcp"]
```

### Gemini CLI

```sh
gemini mcp add -s user j2cpp npx -- -y @juangp3/j2c-mcp
```

### Gemini settings.json (`~/.gemini/settings.json`)

```json
{
  "mcpServers": {
    "j2cpp": {
      "command": "npx",
      "args": [
        "-y",
        "@juangp3/j2c-mcp"
      ]
    }
  }
}
```

## FAQ

### Can J2C automatically fix translation issues?

Yes, the `j2c fix` command can apply mechanical fixes to Java source code for specific problems like anonymous lambda 'this' references.

### Does J2C support Maven and Gradle projects?

Yes, you can pass a project directory containing a pom.xml or build.gradle file, and J2C will automatically set itself up from the build.

### Is J2C a complete Java compiler?

No, it is a source translator and does not provide a complete Java runtime or compiler functionality.
