Labsco
CoinStatsHQ logo

CoinStats

β˜… 15

from CoinStatsHQ

Access cryptocurrency market data, portfolio tracking, and news from the CoinStats API.

πŸ”₯πŸ”₯πŸ”₯πŸ”₯βœ“ VerifiedAccount requiredAdvanced setup

CoinStats MCP Server

Hosted Model Context Protocol server for the CoinStats API. Lets AI agents (Claude, Cursor, Codex, ChatGPT β€” anything that speaks MCP) read and act on the same crypto 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.

<a href="https://glama.ai/mcp/servers/@CoinStatsHQ/coinstats-mcp"> <img width="380" height="200" src="https://glama.ai/mcp/servers/@CoinStatsHQ/coinstats-mcp/badge" alt="CoinStats Server MCP server" /> </a>

Server URL

Copy & paste β€” that's it
https://mcp.coinstats.app/mcp

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: https://coinstats.app/api-docs/mcp/tools.

Authentication

Discovery + OAuth flow follows the standard MCP / RFC pattern:

EndpointSpecPurpose
GET /.well-known/oauth-protected-resourceRFC 9728Points at the authorization server (https://api.coin-stats.com)
GET /.well-known/oauth-authorization-serverRFC 8414AS metadata (also mirrored on the MCP host so older clients can find it without the indirection)
POST /v1/oauth/register (on AS)RFC 7591Dynamic Client Registration
GET /v1/oauth/authorize β†’ consent UIOAuth 2.1 Β§4.1User approves access
POST /v1/oauth/token (on AS)OAuth 2.1 Β§4.1PKCE code exchange
POST /v1/oauth/revoke (on AS)RFC 7009Per-client disconnect

Token transport: Authorization: Bearer <token>. Single coinstats scope today; granular scopes are on the roadmap.

Self-host / stdio fallback (developer mode)

If you want to run the MCP server yourself (no per-user OAuth, just a developer API key), the legacy stdio entry point is published on npm:

Copy & paste β€” that's it
npx @coinstats/coinstats-mcp

with COINSTATS_API_KEY set in the env. Wire into a client like this:

Copy & paste β€” that's it
{
  "mcpServers": {
    "coinstats": {
      "command": "npx",
      "args": ["-y", "@coinstats/coinstats-mcp"],
      "env": { "COINSTATS_API_KEY": "<YOUR_API_KEY>" }
    }
  }
}

Or via Docker:

Copy & paste β€” that's it
{
  "mcpServers": {
    "coinstats": {
      "command": "docker",
      "args": ["run", "-i", "--rm", "-e", "COINSTATS_API_KEY", "coinstats/coinstats-mcp"],
      "env": { "COINSTATS_API_KEY": "<YOUR_API_KEY>" }
    }
  }
}

This path is the right choice for headless / unattended integrations where there's no human to click "Approve". Get a key from the CoinStats API Dashboard.

Architecture

The hosted server is a stateless Cloudflare Worker (~225 KiB / ~41 KiB gzipped) that:

  1. Exposes the RFC 9728 + RFC 8414 discovery endpoints.
  2. Gates POST /mcp on a Authorization: Bearer … token.
  3. Dispatches MCP JSON-RPC (initialize / tools/list / tools/call / ping) without session state.
  4. Forwards each tool call to https://openapiv1.coinstats.app carrying the same bearer.

Source: src/worker.ts. Config: wrangler.jsonc.

Local development

The repo ships two entry points:

  • src/worker.ts β€” Cloudflare Worker. Run with wrangler dev (port 8787 by default).
  • src/index.ts β€” stdio server. Run with node dist/index.js after building, or via the published npm package.
Copy & paste β€” that's it
# Build the stdio CLI
npm run build

# Run the Worker locally (requires `wrangler login` first)
npm run dev

# Deploy the Worker β€” needs CLOUDFLARE_ACCOUNT_ID exported in the env
# (the account ID isn't committed to wrangler.jsonc; pull it from the
# Cloudflare dashboard sidebar or the CI deploy job's secrets).
export CLOUDFLARE_ACCOUNT_ID=<your-cf-account-id>
npm run deploy

# Tail production logs
npm run tail

For local Worker development you can override env vars:

Copy & paste β€” that's it
wrangler dev --var OAUTH_ISSUER:http://localhost:1337 \
             --var COINSTATS_API_BASE_URL:http://localhost:9999

Related

License

MIT β€” see LICENSE.