Tutorials & SDKs
Tutorial: Connect Your AI Agent to Crypto Data via MCP
Most AI agents can't answer crypto questions with real data. Ask Claude "what's the TVL on Aave?" and you'll get a confident answer from its training data — not today's number. This tutorial fixes that. You'll connect your AI agent to Hive Intelligence — the managed crypto MCP server for AI agents — through one MCP endpoint, in about five minutes.
What you'll build
By the end of this tutorial, your Claude Desktop, Claude Code, or Cursor agent will be able to:
- Check real-time token prices across thousands of assets
- Analyze DeFi protocol yields, TVL, and fee revenue
- Audit wallet security and token contract risk
- Query prediction markets, NFT data, and on-chain DEX activity
All of this comes from market data, DeFi analytics, wallet intelligence, security checks, and more — normalized behind a single MCP connection. See Data Sources for the full list of upstream providers Hive unifies.
The problem: wiring up crypto data is painful
Imagine you want your AI agent to answer one question: "Is this token safe to buy?"
To answer that properly, the agent needs:
- Price data from CoinGecko - current price, market cap, volume
- Contract security from GoPlus - is the contract a honeypot? Is there a proxy? Can the owner mint?
- Liquidity depth from an on-chain DEX surface - is there enough liquidity to exit?
- Protocol TVL from a DeFi analytics surface - is the underlying protocol growing or bleeding?
That's four APIs. Four API keys. Four rate limiters. Four different authentication schemes. Four input schemas to learn. Four sets of error codes to handle.
Scale that across the full crypto data surface and you're managing:
- Many separate API keys and billing accounts
- Different rate limiting strategies per source (per-second, monthly credits, or both)
- Different response formats to parse per source
- Hundreds of individual endpoints, each with its own parameter schema
And when any of them ships a new API version or adds a field? You're updating integration code instead of building your product.
The solution: one endpoint, one key, every tool you need
Hive Intelligence sits between your AI agent and the entire crypto data surface. You connect to one MCP endpoint. You authenticate with one API key. Your agent gets access to hundreds of tools organized into 10 categories.
The MCP protocol means your agent discovers available tools automatically - no hardcoded function definitions, no manual schema updates. When Hive adds new tools or providers, your agent sees them on the next connection.
Step 1: Get your API key
- Go to hiveintelligence.xyz/dashboard
- Sign up or log in
- Navigate to API Keys and create a new key
- Copy the key - you'll need it in the next step
The Free Demo tier gives you 30 requests per minute and 10,000 monthly credits. That's enough to follow this tutorial and build a prototype. You can upgrade later if you need higher throughput.
Step 2: Configure your AI client
Pick the client you use. You only need to follow one of these sections.
Option A: Claude Desktop
Remote MCP servers are added through Claude Desktop's Custom Connectors UI, not via claude_desktop_config.json (which is stdio-only).
- Open Settings → Connectors.
- Hover Add custom, click Web.
- Name =
Hive, URL =https://mcp.hiveintelligence.xyz/mcp, Authentication = Bearer token, Token = your Hive API key from Step 1. - Click Add and wait for Claude to validate and list the tools.
Custom Connectors are available on Free (1 connector), Pro, Max, Team, and Enterprise plans. The Claude Desktop install page walks through the same flow with screenshots, plus a stdio fallback for air-gapped setups.
Option B: Claude Code
Run this command in your terminal:
claude mcp add --transport http hive "https://mcp.hiveintelligence.xyz/mcp" --header "Authorization: Bearer YOUR_HIVE_API_KEY"
Replace YOUR_HIVE_API_KEY with your actual key. The URL is a positional argument (there is no --url flag on claude mcp add). Claude Code will confirm the server was added; the tools will be available in your next session. See Install in Claude Code for the HTTP-transport variant and scope flags.
Option C: Cursor
Create or edit .cursor/mcp.json in your project root:
{
"mcpServers": {
"hive": {
"url": "https://mcp.hiveintelligence.xyz/mcp",
"headers": {
"Authorization": "Bearer YOUR_HIVE_API_KEY"
}
}
}
}
Replace YOUR_HIVE_API_KEY with your actual key. Restart Cursor or reload the MCP server list from the command palette.
Step 3: Try it
Your agent now has access to live crypto data. Try these prompts:
Price check
"What's the current price of Bitcoin and Ethereum?"
This calls get_price under the hood - one of the simplest tools. Your agent should return real-time prices from CoinGecko.
DeFi overview
"Show me the top DeFi protocols by TVL"
This uses get_defi_protocols from DeFiLlama. You'll get a ranked list of protocols with their current total value locked.
Token security audit
"Is the token at contract address 0x6982508145454Ce325dDbE47a25d4ec3d2311933 safe to interact with?"
This triggers GoPlus security detection tools. The agent will check for honeypot risk, proxy contracts, owner privileges, and other red flags. (That address is PEPE - a real token you can test with.)
Wallet balances
"What are my wallet balances at 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045?"
This uses Moralis wallet tools to pull token balances for any public wallet. (That address is vitalik.eth - publicly known.)
Prediction markets
"What prediction markets are active on Polymarket right now?"
This queries Polymarket data through Hive's prediction markets category.
Step 4: Use category endpoints for focused agents
The root endpoint (/mcp) exposes the compact discovery and routing layer - great for general-purpose agents. If you're building a focused agent that only needs market data, connect to a category endpoint so the direct tool list stays smaller.
Hive provides 10 category-scoped endpoints. Each exposes only the tools relevant to that domain:
| Category | Endpoint | Use case |
|---|---|---|
| Market Data | /hive_market_data/mcp | Prices, market caps, trending coins |
| DeFi Protocols | /hive_defi_protocol/mcp | TVL, yields, fees, protocol analytics |
| DEX Analytics | /hive_onchain_dex/mcp | On-chain trading, pools, liquidity |
| Security & Risk | /hive_security_risk/mcp | Contract audits, honeypot detection |
| Portfolio & Wallet | /hive_portfolio_wallet/mcp | Wallet balances, transaction history (EVM + Solana) |
| Token & Contract | /hive_token_contract/mcp | Token metadata, contract details, Solana DAS |
| NFT Analytics | /hive_nft_analytics/mcp | NFT collections, floor prices, compressed NFTs |
| Prediction Markets | /hive_prediction_markets/mcp | Polymarket events and outcomes |
| Search & Discovery | /hive_search_discovery/mcp | Cross-provider search |
| Network & Infrastructure | /hive_network_infrastructure/mcp | Chain info, gas, block data, Solana RPC |
To use a category endpoint, replace the URL in your configuration. For example, a market-data-only agent in Claude Desktop:
{
"mcpServers": {
"hive-market-data": {
"url": "https://mcp.hiveintelligence.xyz/hive_market_data/mcp",
"headers": {
"Authorization": "Bearer YOUR_HIVE_API_KEY"
}
}
}
}
You can also connect multiple category endpoints if your agent needs a specific combination - for example, market data plus security:
{
"mcpServers": {
"hive-market-data": {
"url": "https://mcp.hiveintelligence.xyz/hive_market_data/mcp",
"headers": {
"Authorization": "Bearer YOUR_HIVE_API_KEY"
}
},
"hive-security": {
"url": "https://mcp.hiveintelligence.xyz/hive_security_risk/mcp",
"headers": {
"Authorization": "Bearer YOUR_HIVE_API_KEY"
}
}
}
}
Troubleshooting
"Invalid API key" or 401 errors
- Verify your key is correct - copy it again from the dashboard
- Make sure you're using the
Authorization: Bearer YOUR_KEYheader (thex-api-keylegacy alias also works; don't send both at once) - Check that there are no trailing spaces or newline characters in your key
Rate limiting (429 errors)
The Free Demo tier allows 30 requests per minute and 10,000 monthly credits. If you hit the limit:
- Wait 60 seconds and retry
- Check your usage on the dashboard
- Upgrade your plan for higher limits
"Tool not found" errors
- The tool name may have changed. Use
tools/listor thehive://toolsresource to see the current catalog - Check that you're connected to the right endpoint - category endpoints only expose tools in that category
- Tool names use snake_case (e.g.,
get_price, notgetPrice)
MCP server not connecting
- Ensure your client supports MCP over HTTP (streamable HTTP or SSE transport)
- Check that you've restarted your client after editing the configuration
- Verify the endpoint URL has no typos:
https://mcp.hiveintelligence.xyz/mcp
Next steps
- API Integration - Full reference for MCP, REST, and discovery endpoints
- Tools Reference - Browse all tools with input schemas and descriptions
- Quick Start - Shorter setup guide if you just want the config snippets