# Rohan Protocol MCP server

> Enables AI agents to perform confidential state transitions, inspect ledger states, and verify cryptographic commitments on the Midnight blockchain.

- Repository: https://github.com/rohan-protocol/sdk
- Page: https://hostedmcp.org/servers/rohan-protocol/mcp
- Transport: stdio
- Stars: 8
- License: MIT
- Latest version: 0.8.1

## Install

### Claude Code

```sh
claude mcp add mcp -- npx -y @rohan-protocol/mcp
```

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

```json
{
  "mcpServers": {
    "mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@rohan-protocol/mcp"
      ]
    }
  }
}
```

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

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

### VS Code CLI

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

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

```json
{
  "mcpServers": {
    "mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@rohan-protocol/mcp"
      ]
    }
  }
}
```

### Codex

```sh
codex mcp add mcp -- npx -y @rohan-protocol/mcp
```

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

```toml
[mcp_servers.mcp]
command = "npx"
args = ["-y", "@rohan-protocol/mcp"]
```

### Gemini CLI

```sh
gemini mcp add -s user mcp npx -- -y @rohan-protocol/mcp
```

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

```json
{
  "mcpServers": {
    "mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@rohan-protocol/mcp"
      ]
    }
  }
}
```

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `ROHAN_AGENT_PRIVATE_KEY` | no | no | Optional 32-byte Ed25519 seed as 64 hex characters to override the auto-provisioned local identity. Keep it in a secret store; never provide it as a tool argument. |
| `ROHAN_API_KEY` | no | no |  |
| `ROHAN_CONTRACT_ADDRESS` | no | no | Midnight Preprod Contract Address for Rohan Trust Gateway |
| `ROHAN_RELAYER_URL` | no | no | Rohan Relayer API URL |

## Tools (4)

- `rohan_execute_handshake`: Executes a confidential zero-knowledge state transition on Midnight Blockchain. Confidential parameters are automatically canonicalized (RFC 8785) and hashed in client RAM—never exposed on-chain or in model logs.
- `rohan_get_ledger_state`: Reads the current anchored state of the Rohan Protocol smart contract on Midnight Preprod L1. Returns the state root, block height, and last mined transaction hash from memory cache.
- `rohan_get_transaction_history`: Lists historical settlement transactions and receipts anchored on Midnight Preprod L1.
- `rohan_verify_commitment`: Verifies a plaintext confidential payload against its SHA-256 digest using RFC 8785 JSON Canonicalization. Supply the inner payload digest, not the outer on-chain intentHash. Zero gas cost; runs in local memory.

## FAQ

### How does the server handle local agent identity and signing?

The server loads identity from a ROHAN_AGENT_PRIVATE_KEY environment variable or a local keystore file at ~/.rohan/agent-identity.json.
