Skip to main content

MCP server

mcp-name: io.github.whatevercat-creator/crypto-sentiment-x402

The crypto_sentiment_x402_mcp package exposes the sentiment API as MCP tools (get_sentiment for the current reading, get_sentiment_history for past hourly readings, get_movers for the biggest 24-hour shifts, plus four free tools) so Claude Desktop, Claude Code, or any other MCP client can call it directly as part of an agent's normal tool use — no separate HTTP client code needed on the caller's side.

What it returns: sentiment for a ticker symbol (e.g. BTC, ETH, SOL) from 9 crypto news RSS outlets (CoinDesk, Cointelegraph, Decrypt, Bitcoin Magazine, The Block, CryptoSlate, NewsBTC, CryptoPotato, The Defiant) and the Fear & Greed Index. Only headlines from the last 72 hours are scored, weighted toward the newest. Each call returns a bullish/bearish/neutral label (or "insufficient recent news"), a compound score, a per-source breakdown and the headlines behind each score.

Payment model: the MCP server itself holds a wallet (via Coinbase Developer Platform) and pays the API's x402 price out of that wallet for every call, entirely inside your own local process — invisible to the MCP protocol layer, so it works in Claude Desktop (or any other stock MCP client) exactly like a normal, unpaid MCP server would. The paid reading has no free tier — whoever runs this MCP server funds the wallet it uses. If you're handing it to someone else to run, they fund their own wallet, not you.

Try it free

Four tools need no wallet, no CDP key and pay nothing. The server starts without any CDP variables, so you can install it and try these first:

  • list_supported_coins — the 24 supported ticker symbols and names (the symbol inputs of get_sentiment and get_call_price are typed as this list).
  • get_market_sentiment — one market-wide sentiment index across all 24 coins (GET /market-sentiment), refreshed at most hourly.
  • get_archive_coverage — what the hourly archive holds (GET /archive): first reading, row counts and missing hours per symbol.
  • get_call_price(symbol) — makes one unpaid request and reads the 402 payment requirements: price, network, asset and the payTo address.

Three tools are paid, from your own CDP wallet in USDC on Base:

  • get_sentiment(symbol) — the current reading, $0.01 per call. Unsupported coins and coins with too little recent news are refused and not charged.
  • get_sentiment_history(symbol, start, end) — past hourly readings (GET /history/{symbol}), $0.05 per call. Recorded live and never backfilled; start/end are ISO 8601, default the last 7 days, at most 30 days per call. The symbol has to be one get_archive_coverage lists as logged. Unlogged symbols, invalid ranges and ranges with no readings are refused and not charged.
  • get_movers(limit) — the coins whose sentiment rose or fell most over the last ~24 hours (GET /movers), $0.02 per call. limit (1 to 24, default 10) caps each list. Coins without enough news are left out; a call that can rank no coin is refused and not charged.

Spend cap: the server signs for at most $0.50 in total per run by default. A paid call that would go over it is refused and not charged. Set MAX_SPEND_USD_PER_SESSION to change it (0 turns the cap off); the count resets when the server restarts.

Renamed in 0.2.0: crypto_sentiment → get_sentiment, get_hourly_history → get_sentiment_history, archive_coverage → get_archive_coverage, price_quote → get_call_price. The old names are gone; see CHANGELOG.md.

Wallet setup is below.

1. Install

pip install crypto-sentiment-x402-mcp

(uvx crypto-sentiment-x402-mcp works too, and needs no separate install step.)

Don't install this into the same environment as the FastAPI service (requirements.txt). mcp>=2 pulls in a much newer starlette than FastAPI 0.115.0 tolerates (starlette<0.39.0,>=0.37.2) — mixing the two in one venv breaks app/main.py at import time (Router.__init__() got an unexpected keyword argument 'on_startup'). If you're hacking on this repo and want both, give the MCP package its own venv:

python3 -m venv .venv-mcp && source .venv-mcp/bin/activate
pip install -r requirements-mcp.txt cdp-sdk x402

2. Create a CDP API key and fund a wallet

  1. Free account + API key at https://portal.cdp.coinbase.com
  2. Pick a network:
    • testnet — free Base Sepolia USDC from https://docs.base.org/tools/network-faucets, good for trying this out with no real money.
    • mainnet — real USDC on Base; the wallet needs actual USDC (plus a little ETH for gas) before calls will succeed.
  3. The wallet is created automatically the first time the server runs (named by CDP_WALLET_NAME, default crypto-sentiment-mcp-wallet) — run it once locally and check the logs/tool output for the address it prints, then send that address USDC (+ ETH on mainnet) before relying on it inside an agent.

3. Register it with an MCP client

Claude Desktop — add to claude_desktop_config.json:

{
  "mcpServers": {
    "crypto-sentiment": {
      "command": "crypto-sentiment-x402-mcp",
      "env": {
        "CDP_API_KEY_ID": "your-key-id",
        "CDP_API_KEY_SECRET": "your-key-secret",
        "CDP_WALLET_NAME": "crypto-sentiment-mcp-wallet",
        "SENTIMENT_API_URL": "https://crypto-sentiment-x402.onrender.com",
        "X402_NETWORK": "testnet",
        "MAX_SPEND_USD_PER_SESSION": "0.50"
      }
    }
  }
}

(That assumes pip install crypto-sentiment-x402-mcp put the console script on PATH for whatever Python Claude Desktop launches with. If you'd rather not rely on PATH, point command at the interpreter and args: ["-m", "crypto_sentiment_x402_mcp"], or, from a repo clone, at mcp_server.py directly, same as before — both still work.)

Claude Code — same shape, either via claude mcp add or a project .mcp.json with the same mcpServers block.

Any other MCP-compatible client works the same way: it just needs a command to launch the server with those env vars set.

4. Use it

Once registered, an agent can call the get_sentiment tool with a symbol argument (e.g. BTC), get_sentiment_history with a symbol and optional start/end, or get_movers with an optional limit, like any other tool — the payment happens transparently inside the call. If a call returns an error field, it's almost always the wallet needing more funds; the response includes the paying wallet's address to check.

Notes

  • SENTIMENT_API_URL defaults to the hosted deployment; point it at http://localhost:8000 to test against a local uvicorn app.main:app instead.
  • This is a separate process/wallet from client.py (a one-off test script) — both pay the same API, just for different purposes.

License

MIT (see LICENSE-MCP) — this package only. The rest of this repository, including the hosted API in app/, remains All Rights Reserved under the root LICENSE.

Metadata

Release files for crypto-sentiment-x402-mcp 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for crypto-sentiment-x402-mcp 0.2.0
File Size Uploaded Provenance Actions
crypto_sentiment_x402_mcp-0.2.0.tar.gz 21.8 kB Without provenance Details for crypto_sentiment_x402_mcp-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for crypto-sentiment-x402-mcp 0.2.0
File Interpreter ABI Platform Actions
crypto_sentiment_x402_mcp-0.2.0-py3-none-any.whl Python 3 none any Details for crypto_sentiment_x402_mcp-0.2.0-py3-none-any.whl

Total release size: 37.5 kB

Release files / crypto_sentiment_x402_mcp-0.2.0.tar.gz

Download URL crypto_sentiment_x402_mcp-0.2.0.tar.gz
Size 21.8 kB
Tags Source
SHA-256 checksum
How to use checksums
52fb655cdc7a3895c6a2603da1c4db59e852fef5fed6a0af639820cb4c7f984c
BLAKE2b-256 checksum
How to use checksums
bac0d8d4baf9a1b19b5cad366b8eb893da4e8c8b2a1ba60aede94c4a9a321592
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Release files / crypto_sentiment_x402_mcp-0.2.0-py3-none-any.whl

Download URL crypto_sentiment_x402_mcp-0.2.0-py3-none-any.whl
Size 15.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b733897e4f8b2b2d8b0757e66a17f125cb1fe11ecccafb598255242d59d397e5
BLAKE2b-256 checksum
How to use checksums
da08f14fdff3a982761ee475be9fc7ceaeef7a95b3a75f0214e8d1891f20c076
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Security for crypto-sentiment-x402-mcp 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page