> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rubic.finance/llms.txt
> Use this file to discover all available pages before exploring further.

# Configuration

## **Quickstart**

Add to MCP config:

```json theme={null}
{
  "mcpServers": {
    "rubic": {
      "command": "npx",
      "args": ["-y", "@cryptorubic/mcp"],
      "env": {
        "EVM_WALLET_PRIVATE_KEY": "YOUR_PRIVATE_KEY"
      }
    }
  }
}
```

`EVM_WALLET_PRIVATE_KEY` - EVM private key without `0x`. Enables signing/broadcast tools.

## **Local Installation Options**

For read-only mode, omit `EVM_WALLET_PRIVATE_KEY`.

### **Option A: Node.js**

Requires [<u>Node.js v18+</u>](https://nodejs.org/).

```text theme={null}
git clone https://github.com/Cryptorubic/rubic-mcp.git
cd rubic-mcp
npm install
npm run build
```

### **Option B: Docker**

Pull the published image:

```text theme={null}
docker pull rubicfinance/rubic-mcp:latest
```

Or build from source:

```text theme={null}
git clone https://github.com/Cryptorubic/rubic-mcp.git
cd rubic-mcp
docker build -t rubicfinance/rubic-mcp .
```

## **Configuration**

In case of local Node.js installation, copy the example config:

```text theme={null}
cp .env.example .env
```

Main settings:

* `EVM_WALLET_PRIVATE_KEY` - EVM private key without `0x`. Enables signing/broadcast tools.
* `RUBIC_API_BASE_URL` - Rubic API base URL (default `https://rubic-api-v2.rubic.exchange`).
* `TOKENS_API_BASE_URL` - Rubic tokens API base URL (default `https://api.rubic.exchange/api`).
* `MCP_TRANSPORT` - `stdio` (default) or `http`.
* `MCP_HOST` / `MCP_PORT` - used in HTTP mode.
* `API_TIMEOUT_MS` / `MCP_TOOL_TIMEOUT_MS` - request and tool execution timeouts.

Without `EVM_WALLET_PRIVATE_KEY`, read-only and build tools work, but tools that sign transactions will return an error.

## **Connecting to MCP Clients**

[Quickstart](/mcp-docs/configuration#quickstart) section is enough for the most use cases. All of the instructions below are related to local installation options.

All examples below use **stdio** mode.

Replace `/full/path/to` with the actual path printed after `npm run build`.

**Claude Code**

```text theme={null}
# With private key
claude mcp add rubic -e EVM_WALLET_PRIVATE_KEY=YOUR_PRIVATE_KEY -- node /full/path/to/dist/index.js

# Read-only / unsigned mode
claude mcp add rubic -- node /full/path/to/dist/index.js
```

Using Docker:

```text theme={null}
claude mcp add rubic -e EVM_WALLET_PRIVATE_KEY=YOUR_PRIVATE_KEY -- docker run -i --rm rubicfinance/rubic-mcp:latest node dist/index.js
```

Verify: `claude mcp list`

**Claude Desktop**

Add to `claude_desktop_config.json`:

Node.js:

```json theme={null}
{
  "mcpServers": {
    "rubic": {
      "command": "node",
      "args": ["/full/path/to/dist/index.js"],
      "env": { "EVM_WALLET_PRIVATE_KEY": "YOUR_KEY" }
    }
  }
}
```

Docker:

```json theme={null}
{
  "mcpServers": {
    "rubic": {
      "command": "docker",
      "args": ["run", "-i", "--rm", "-e", "EVM_WALLET_PRIVATE_KEY=YOUR_KEY", "rubicfinance/rubic-mcp", "node", "dist/index.js"],
      "env": {}
    }
  }
}
```

**Cursor**

Add to `.cursor/mcp.json` (project) or `~/.cursor/mcp.json` (global):

```json theme={null}
{
  "mcpServers": {
    "rubic": {
      "command": "node",
      "args": ["/full/path/to/dist/index.js"],
      "env": {
        "EVM_WALLET_PRIVATE_KEY": "YOUR_PRIVATE_KEY"
      }
    }
  }
}
```

**Windsurf**

Add to `~/.codeium/windsurf/mcp_config.json`:

```json theme={null}
{
  "mcpServers": {
    "rubic": {
      "command": "node",
      "args": ["/full/path/to/dist/index.js"],
      "env": { "EVM_WALLET_PRIVATE_KEY": "YOUR_KEY" }
    }
  }
}
```

**GitHub Copilot (VS Code)**

Add to `.vscode/mcp.json`:

```json theme={null}
{
  "mcpServers": {
    "rubic": {
      "type": "stdio",
      "command": "node",
      "args": ["/full/path/to/dist/index.js"],
      "env": { "EVM_WALLET_PRIVATE_KEY": "YOUR_KEY" }
    }
  }
}
```

**Cline**

Open Cline settings → MCP Servers → Edit MCP Settings:

```json theme={null}
{
  "mcpServers": {
    "rubic": {
      "command": "node",
      "args": ["/full/path/to/dist/index.js"],
      "env": { "EVM_WALLET_PRIVATE_KEY": "YOUR_KEY" }
    }
  }
}
```

**Continue**

Add to `~/.continue/config.json`:

```json theme={null}
{
  "mcpServers": [
    {
      "name": "rubic",
      "command": "node",
      "args": ["/full/path/to/dist/index.js"],
      "env": { "EVM_WALLET_PRIVATE_KEY": "YOUR_KEY" }
    }
  ]
}
```

**Zed**

Add to `~/.config/zed/settings.json`:

```json theme={null}
{
  "context_servers": {
    "rubic": {
      "command": {
        "path": "node",
        "args": ["/full/path/to/dist/index.js"],
        "env": { "EVM_WALLET_PRIVATE_KEY": "YOUR_KEY" }
      }
    }
  }
}
```

### **Other clients (generic stdio)**

Use command `node` + args `["/full/path/to/dist/index.js"]`, or Docker command:

```text theme={null}
docker run -i --rm -e EVM_WALLET_PRIVATE_KEY=YOUR_PRIVATE_KEY rubicfinance/rubic-mcp:latest node dist/index.js
```

## **Hosted MCP**

Use hosted read-only MCP endpoint:

`https://mcp-api-v2.rubic.exchange/mcp`

Example generic MCP config:

```json theme={null}
{
  "mcpServers": {
    "rubic": {
      "url": "https://mcp-api-v2.rubic.exchange/mcp"
    }
  }
}
```

## **Transport modes**

### **Node.js**

```text theme={null}
# stdio (default)
npm start

# HTTP mode
MCP_TRANSPORT=http npm run start:http
```

### **Docker**

```text theme={null}
# stdio
docker run -i --rm -e EVM_WALLET_PRIVATE_KEY=YOUR_PRIVATE_KEY rubicfinance/rubic-mcp:latest node dist/index.js

# HTTP mode
docker run -d -p 3333:3333 -e MCP_TRANSPORT=http rubicfinance/rubic-mcp:latest
```

Or with Docker Compose:

```text theme={null}
docker compose up -d --build
```

## **Development**

```text theme={null}
npm run dev          # stdio dev mode
npm run dev:http     # HTTP dev mode
npm run lint
npm run typecheck
```
