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

# Cursor

> Connect Cursor to DeFi Orbit AI and verify with one tool call.

Cursor connects to DeFi Orbit AI over streamable HTTP through an `mcp.json` file. You need an active API key from [API Keys](https://platform.defiorbit.xyz/dashboard/keys).

## Add the server

Create `.cursor/mcp.json` in the project root (or `~/.cursor/mcp.json` to make it global):

```json theme={null}
{
  "mcpServers": {
    "defiorbit": {
      "url": "https://mcp.defiorbit.xyz/mcp",
      "headers": {
        "Authorization": "Bearer <API_KEY>"
      }
    }
  }
}
```

Then open **Cursor Settings → MCP** and make sure `defiorbit` is enabled. The server list should show its tools once the connection is up.

The project-level file is the right place when the key is personal; keep `.cursor/mcp.json` out of version control, or use the global file instead.

## Verify the first call

In a new Agent chat, ask:

> Call the defiorbit usage-credits tool.

A working setup returns the organization's balance:

```json theme={null}
{ "data": { "credits_remaining": 123242, "grants": 119259, "purchased_credits": 3983 } }
```

That call costs 1 credit, the same as [Get Remaining Credits](/api-reference/usage/credits) over REST, and confirms the key, billing, and rate limit are all wired to your organization.

## If it fails

The one to know: an invalid key still connects and lists all 54 tools — authentication is only checked when a tool runs. If the MCP settings page shows the server with its tools but every call returns `INVALID_API_KEY`, the key is wrong or revoked, not the connection. All failure cases are on [Troubleshooting](/ai/troubleshooting).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.