# MCP

Divigent MCP is a Model Context Protocol server for Divigent on Base Sepolia. It gives AI clients read-only protocol tools and unsigned transaction planning tools.

The MCP server never loads a private key, never signs transactions, and never broadcasts transactions. Planning tools return unsigned calldata for a user-controlled wallet to review, sign, and submit.

## What You Need

* Node.js 20 or newer.
* `npm` / `npx` available on your machine.
* A Claude Code, Claude Desktop, Cursor, or MCP-compatible client.
* A Base Sepolia RPC URL.

The public default RPC URL is `https://sepolia.base.org`.

## Install In Your Client

{% tabs %}
{% tab title="Claude Code" %}
Run this from the project where you want Claude Code to use Divigent MCP:

```bash
claude mcp add --transport stdio divigent \
  --env BASE_SEPOLIA_RPC_URL=https://sepolia.base.org \
  --env MCP_LOG_LEVEL=error \
  -- npx -y @divigent/mcp-server@beta
```

Verify the MCP server is configured:

```bash
claude mcp list
claude mcp get divigent
```

Then open Claude Code and run:

```
/mcp
```

Confirm that `divigent` is connected.
{% endtab %}

{% tab title="Claude Desktop" %}
Add this to `claude_desktop_config.json`, then fully quit and reopen Claude Desktop.

macOS path:

```bash
~/Library/Application Support/Claude/claude_desktop_config.json
```

Configuration:

```json
{
  "mcpServers": {
    "divigent": {
      "command": "npx",
      "args": ["-y", "@divigent/mcp-server@beta"],
      "env": {
        "BASE_SEPOLIA_RPC_URL": "https://sepolia.base.org",
        "MCP_LOG_LEVEL": "error"
      }
    }
  }
}
```

{% endtab %}

{% tab title="Cursor" %}
Add this to your Cursor MCP configuration, then restart Cursor.

```json
{
  "mcpServers": {
    "divigent": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@divigent/mcp-server@beta"],
      "env": {
        "BASE_SEPOLIA_RPC_URL": "https://sepolia.base.org",
        "MCP_LOG_LEVEL": "error"
      }
    }
  }
}
```

{% endtab %}
{% endtabs %}

## First Prompts

### Check Protocol Status

```
Use the Divigent MCP server to check Divigent protocol status on Base Sepolia.
```

Tool used: `divigent_status`. Returns oracle freshness, treasury status, pause flag, TVL cap, total assets, allocation, and withdrawal capacity.

### Check A Wallet Position

```
Use Divigent MCP to get the Divigent position for wallet 0xYourWalletAddress.
```

Tool used: `divigent_get_position`. Returns the wallet's USDC balance, dvUSDC shares, router allowance, deposited value, current value, and accrued yield.

### Plan A Deposit

```
Use Divigent MCP to plan, but not submit, a 1 USDC deposit for wallet 0xYourWalletAddress with 50 bps slippage.
```

Tool used: `divigent_plan_deposit`. Returns unsigned calldata for the wallet to review and submit.

## Available Tools

| Tool                         | Type              |
| ---------------------------- | ----------------- |
| `divigent_status`            | Read-only         |
| `divigent_check_yield`       | Read-only         |
| `divigent_get_position`      | Read-only         |
| `divigent_plan_approve_usdc` | Unsigned planning |
| `divigent_plan_deposit`      | Unsigned planning |
| `divigent_plan_withdraw`     | Unsigned planning |

See [MCP Reference](/divigent-docs/mcp/overview.md) for full tool inputs, return shapes, safety model, environment variables, and troubleshooting.

{% hint style="info" %}
There is intentionally no private key environment variable. The MCP server cannot sign or broadcast.
{% endhint %}

## Next Steps

* [MCP Reference](/divigent-docs/mcp/overview.md) for full tool inputs, prompts, env vars, and troubleshooting.
* [SDK Reference](/divigent-docs/sdk/api-reference.md) if you want to sign and broadcast from a backend (instead of planning only).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://divigent.gitbook.io/divigent-docs/quick-start/mcp.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
