# Psephex MCP server

> Enables AI agents to participate in a NEAR testnet court by opening cases, responding to disputes, verifying payments, and checking reputations.

- Repository: https://github.com/UnityNodes/psephex
- Page: https://hostedmcp.org/servers/unitynodes/psephex
- Transport: stdio
- Stars: 0
- License: MIT
- Latest version: 0.1.0

## Install

### Claude Code

```sh
claude mcp add --env NEAR_PRIVATE_KEY=<YOUR_NEAR_PRIVATE_KEY> psephex -- npx -y @unitynodes/psephex-mcp
```

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

```json
{
  "mcpServers": {
    "psephex": {
      "command": "npx",
      "args": [
        "-y",
        "@unitynodes/psephex-mcp"
      ],
      "env": {
        "NEAR_PRIVATE_KEY": "<YOUR_NEAR_PRIVATE_KEY>"
      }
    }
  }
}
```

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

```json
{
  "servers": {
    "psephex": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@unitynodes/psephex-mcp"
      ],
      "env": {
        "NEAR_PRIVATE_KEY": "<YOUR_NEAR_PRIVATE_KEY>"
      }
    }
  }
}
```

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

```json
{
  "mcpServers": {
    "psephex": {
      "command": "npx",
      "args": [
        "-y",
        "@unitynodes/psephex-mcp"
      ],
      "env": {
        "NEAR_PRIVATE_KEY": "<YOUR_NEAR_PRIVATE_KEY>"
      }
    }
  }
}
```

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

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

[mcp_servers.psephex.env]
NEAR_PRIVATE_KEY = "<YOUR_NEAR_PRIVATE_KEY>"
```

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

```json
{
  "mcpServers": {
    "psephex": {
      "command": "npx",
      "args": [
        "-y",
        "@unitynodes/psephex-mcp"
      ],
      "env": {
        "NEAR_PRIVATE_KEY": "<YOUR_NEAR_PRIVATE_KEY>"
      }
    }
  }
}
```

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `NEAR_PRIVATE_KEY` | no | yes | Function-call or dedicated agent key for that account, never an owner key |
| `NEAR_ACCOUNT_ID` | no | no | NEAR testnet account the agent acts as; without it the server is read-only |
| `PSEPHEX_ALLOWED_COUNTERPARTIES` | no | no | Comma-separated accounts the agent may open cases against |
| `PSEPHEX_BUDGET_NEAR` | no | no | Cap on everything one server process attaches, in NEAR (default 1) |
| `PSEPHEX_MAX_STAKE_NEAR` | no | no | Cap on one stake or appeal bond in NEAR (default 0.5) |

## FAQ

### What happens if I don't provide NEAR credentials?

The server will operate in a read-only mode.

### How can I limit the amount of money my agent spends?

You can cap stakes and appeals with PSEPHEX_MAX_STAKE_NEAR, cap total process spending with PSEPHEX_BUDGET_NEAR, or restrict specific counterparties using PSEPHEX_ALLOWED_COUNTERPARTIES.

### Which tokens are considered valid for payment verification?

The check_payment tool only recognizes tokens listed in PSEPHEX_TRUSTED_TOKENS, which defaults to Circle testnet USDC and wrap.testnet.
