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

# Connect to CoinStats MCP

> Hook AI agents into your CoinStats account through the Model Context Protocol — coin prices, portfolios, wallets, exchanges and news on tap.

export const title_0 = undefined

export const cards_0 = undefined

The CoinStats MCP server lets AI agents (Claude, Cursor, Codex, ChatGPT — anything that speaks the [Model Context Protocol](https://modelcontextprotocol.io/)) read and act on the same data the CoinStats apps use, over a single OAuth-protected HTTPS URL. There's no API key to copy and no env var to manage: each user authorises the agent against their own CoinStats account in the browser, and the agent gets a per-user token from then on.

<Note>
  This guide is for users hooking an agent into **their own** CoinStats account. If you're a developer building a server-to-server integration that uses an `X-API-KEY` header, see [Authentication](/authentication) for the API-key path instead.
</Note>

## Server URL

```
https://mcp.coinstats.app/mcp
```

## Installation

### Claude.ai / Claude Desktop

Settings → **Connectors** → **Add custom connector**. Paste the server URL and click **Add**:

```
https://mcp.coinstats.app/mcp
```

A browser window opens at `coinstats.app/openapi/consent`. Sign in (or recognise your existing session), review the requested access, click **Approve**. The connector turns green and CoinStats tools become available in the same chat.

### Cursor

Add to `~/.cursor/mcp.json`:

```json theme={null}
{
  "mcpServers": {
    "coinstats": {
      "url": "https://mcp.coinstats.app/mcp"
    }
  }
}
```

Restart Cursor. On first call, Cursor opens a browser window for the OAuth flow.

### Claude Code

```bash theme={null}
claude mcp add coinstats --transport http https://mcp.coinstats.app/mcp
```

Claude Code opens a browser to authorise. Verify with:

```bash theme={null}
claude mcp list
```

### Codex

`codex mcp add` registers the server URL but does **not** open a browser — you have to run `codex mcp login` separately to authorise:

```bash theme={null}
codex mcp add coinstats --url https://mcp.coinstats.app/mcp
codex mcp login coinstats
```

The login step opens `coinstats.app/openapi/consent` in your browser; approve and Codex finishes the token exchange. Verify with:

```bash theme={null}
codex mcp list
```

`coinstats` should show `Auth: OAuth` once authenticated. If it shows `Not logged in`, re-run `codex mcp login coinstats`.

### Other MCP clients

Any client that speaks the [Streamable HTTP](https://modelcontextprotocol.io/specification/2025-03-26/basic/transports#streamable-http) transport with OAuth 2.1 authorization will work. Point it at `https://mcp.coinstats.app/mcp` and let the OAuth machinery do the rest — Dynamic Client Registration ([RFC 7591](https://datatracker.ietf.org/doc/html/rfc7591)) is supported, so no pre-shared `client_id` is needed.

## What you can do

After authorising, your agent can:

* Look up real-time prices, charts and market data for 100,000+ coins
* Read your CoinStats portfolio coins, P/L and performance over time
* Query wallet balances and transactions across 120+ blockchains
* Compare ticker pricing across 200+ exchanges
* Pull crypto news (latest, trending, filtered by source or topic)

Full tool catalog: [MCP tools](/mcp/tools).

## Quick setup

1. Paste `https://mcp.coinstats.app/mcp` into your client's connector settings
2. Approve the consent screen in your browser
3. Ask your agent something — *"what's BTC at?"*, *"summarise today's crypto news"*, *"how is my portfolio doing?"*

The agent picks up the OAuth bearer token automatically; no API key to manage.

## Authentication details

For clients that want to walk through the flow manually:

* **Protocol:** OAuth 2.1 with PKCE (S256)
* **Authorization server:** `https://api.coin-stats.com`
* **Discovery:** `GET https://mcp.coinstats.app/.well-known/oauth-protected-resource` (RFC 9728)
* **Dynamic Client Registration:** supported, no pre-shared `client_id` needed
* **Scope:** `coinstats` — read access to your CoinStats data
* **Token transport:** `Authorization: Bearer <token>`
* **Revocation:** `POST https://api.coin-stats.com/v1/oauth/revoke`

## Stdio fallback (developer mode)

If you'd rather run the MCP server locally and authenticate with a developer API key (no per-user OAuth), you can still use the legacy stdio entry point:

```bash theme={null}
npx @coinstats/coinstats-mcp
```

Set `COINSTATS_API_KEY` in the env, or wire it through your client's MCP server config. This is the right path for headless / unattended integrations where there's no human to click "Approve" — get a key from the [CoinStats API dashboard](https://openapi.coinstats.app).

```json theme={null}
{
  "mcpServers": {
    "coinstats": {
      "command": "npx",
      "args": ["-y", "@coinstats/coinstats-mcp"],
      "env": { "COINSTATS_API_KEY": "${COINSTATS_API_KEY}" }
    }
  }
}
```

## Related

* [MCP tools](/mcp/tools) — full catalog of crypto data, portfolio, wallet, exchange and news tools
* [Authentication](/authentication) — `X-API-KEY` path for non-MCP / server-to-server integrations
* [Rate limits](/rate-limits) and [Credit multipliers](/multipliers) — usage rules apply identically to MCP and REST
* [API reference](/api-reference) — the REST surface every MCP tool wraps

## {title_0 || "Support"}

{cards_0 ? (
<CardGroup cols={2}>
<Card title="Support Documentation" icon="question" href="https://help.coinstats.app/en/articles/12002063">
  Check our comprehensive help center
</Card>

<Card title="Telegram Support" icon="telegram" href="https://t.me/+JPUMD1QAMTNmNGQy">
  Join our API support channel for real-time help
</Card>

 <Card title="Email Support" icon="telegram" href="mailto:api.support@coinstats.app">
  You can reach us directly at api.support@coinstats.app
</Card>
</CardGroup>
) : (
  <ul>
      <li><strong>Documentation</strong>: This site contains comprehensive API documentation</li>
      <li><strong>Telegram Chat</strong>: For quick help and to connect with other developers, join our <a href="https://t.me/+JPUMD1QAMTNmNGQy">API Support Telegram group</a></li>
      <li><strong>Email Support</strong>: You can reach us directly at <a href="mailto:api.support@coinstats.app"><strong><u>api.support@coinstats.app</u></strong></a> for personalized assistance.</li>
  </ul>
)}
