Skip to main content

What is MCP

MCP (Model Context Protocol) is an open protocol proposed by Anthropic to standardize how AI applications connect to external data sources.
Simply put, MCP enables AI to:
  • Discover available tools and data sources
  • Call external tools to perform operations
  • Understand returned structured data

Traditional vs MCP

MethodFlow
TraditionalUser → Write code → Call API → Parse data → Input to AI → Get answer
MCPUser → Natural language question → AI auto-calls tools → Get answer

Core Concepts

ConceptDescription
MCP ServerServer providing tools and data, like ChainStream MCP Server
MCP ClientClient using tools, like Claude Desktop, Cursor
ToolsFunctions callable by AI, like query balance, analyze wallet
ResourcesData resources accessible by AI

Why MCP Matters

AI Agents Need “Hands and Eyes”

AI large models have powerful reasoning capabilities, but they:
  • ❌ Cannot directly access real-time data
  • ❌ Cannot execute external operations
  • ❌ Have knowledge cutoff dates
MCP solves this by enabling AI to:
  • ✅ Get real-time on-chain data
  • ✅ Call professional tools for analysis
  • ✅ Interact with the external world
AnalogyMCP to AI is like:
  • Eyes → Let AI see real-time data
  • Hands → Let AI execute operations
  • Tools → Let AI use professional capabilities

ChainStream MCP Capabilities

ChainStream MCP Server exposes blockchain data and analysis capabilities to AI applications via the MCP protocol. MCP Endpoint: https://mcp.chainstream.io/mcp

Capability Matrix

ChainStream MCP Server supports all REST API and WebSocket subscription features in API Reference:
FeatureDescription
Token SearchSearch tokens by name/symbol
Token InfoGet token basic info and metadata
Token PriceReal-time and historical prices
Token StatsVolume, market cap statistics
Holder AnalysisHolder distribution and top holders
Candlestick DataOHLCV data for various periods
Market DataLiquidity, trading pair info
Security CheckToken contract security analysis
Creation InfoToken creator and time
Mint/Burn HistoryToken minting and burning records
Liquidity SnapshotsHistorical liquidity data

Supported Blockchains

ChainIdentifierStatus
Ethereumethereum
BNB Chainbsc
Polygonpolygon
Arbitrumarbitrum
Optimismoptimism
Basebase
Avalancheavalanche

Supported Platforms

Claude Desktop

Officially supported MCP client with the most complete feature support.
FeatureStatus
Tool Calling
Multi-turn Dialog
Streaming Response
// claude_desktop_config.json
{
  "mcpServers": {
    "chainstream": {
      "url": "https://mcp.chainstream.io/mcp",
      "headers": {
        "Authorization": "Bearer your-access-token"
      }
    }
  }
}

Cursor IDE

Developer-friendly AI coding assistant with MCP integration.
FeatureStatus
Tool Calling
Code Context
// .cursor/mcp.json
{
  "mcpServers": {
    "chainstream": {
      "url": "https://mcp.chainstream.io/mcp",
      "headers": {
        "Authorization": "Bearer your-access-token"
      }
    }
  }
}

Custom Agent

Any client following MCP protocol can integrate.
import { Client } from '@modelcontextprotocol/sdk/client/index.js';
import { SSEClientTransport } from '@modelcontextprotocol/sdk/client/sse.js';

const transport = new SSEClientTransport(
  new URL('https://mcp.chainstream.io/sse'),
  {
    requestInit: {
      headers: {
        'Authorization': `Bearer ${process.env.CHAINSTREAM_ACCESS_TOKEN}`
      }
    }
  }
);

const client = new Client({
  name: 'my-agent',
  version: '1.0.0'
});

await client.connect(transport);

// List available tools
const { tools } = await client.listTools();

// Call a tool
const result = await client.callTool({
  name: 'get_token_balance',
  arguments: {
    address: '0x...',
    chain: 'ethereum'
  }
});

Typical Use Cases

Case 1: AI Research Assistant

Need: Use AI to analyze a specific wallet’s trading behavior
1

User Question

Analyze the trading style of address 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045
2

AI Calls Tool

Calls analyze_wallet tool
3

AI Returns Analysis

Based on analysis, this address (Vitalik) characteristics:
  • Wallet age: Over 5 years
  • Main holdings: ETH, various ERC-20 Tokens
  • Trading style: Long-term holding, occasional donations and project support
  • Active protocols: Uniswap, ENS, Gitcoin
  • Labels: Core developer, Philanthropist

Case 2: Smart Money Tracking

Need: Track Smart Money large trades
1

User Question

Which Smart Money addresses have been buying ARB in the last 24 hours?
2

AI Calls Tool

Calls get_smart_money_activities tool
3

AI Returns Results

In the past 24 hours, the following Smart Money addresses bought ARB:
  1. 0xabc...123 (Labels: whale, defi_expert)
    • Amount: 500,000 ARB
    • Value: $450,000
    • Time: 2 hours ago
  2. 0xdef...456 (Labels: institution)
    • Amount: 200,000 ARB
    • Value: $180,000
    • Time: 5 hours ago
Overall trend: Smart Money net buying ARB

Case 3: Token Security Analysis

Need: Analyze token security
1

User Question

Help me check if this token 0x... is safe
2

AI Calls Tool

Calls get_token_security tool
3

AI Returns Results

Token security check results:
Check ItemResult
Contract Verified
No Malicious Functions
Liquidity Locked
Holder Distribution⚠️ Top 10 hold 45%
Trading TaxBuy 1% / Sell 1%
Risk Level: Medium (watch holder concentration)

Technical Architecture

Data Flow

1

User Question

Natural language input to AI client
2

Intent Recognition

AI understands user intent, selects appropriate tool
3

Tool Call

MCP Client sends request to MCP Server
4

Data Retrieval

MCP Server calls ChainStream API
5

Result Return

Structured data returned to AI
6

Generate Response

AI generates natural language response based on data

Difference from Traditional API

FeatureTraditional APIMCP
Call MethodHTTP RESTProtocol Standardized
Target UserDevelopersAI Models
Parameter HandlingManual ConstructionAI Auto-inference
Error HandlingStatus CodesSemantic Errors
ContextStatelessSession Context Maintained

Authentication

ChainStream MCP Server uses Access Token for authentication.

Getting Access Token

  1. Create an App in ChainStream Dashboard
  2. Get Client ID and Client Secret
  3. Use credentials to generate Access Token (see Authentication docs)
  4. Configure Access Token in MCP Server environment variables

Environment Variables

VariableDescription
CHAINSTREAM_ACCESS_TOKENJWT Access Token
Access Token is valid for 24 hours. After expiration, you need to regenerate. We recommend implementing an automatic refresh mechanism in your application.

Permission Control

Control tool access through API Scope:
ScopeDescription
DefaultRead-only data query tools
webhook.readWebhook read permission
webhook.writeWebhook write permission
kyt.readKYT read permission
kyt.writeKYT write permission

Security Model

MCP Server uses JWT Access Token for authentication. Access Token is obtained from the Auth service using Client ID and Client Secret. All API requests require a valid token.
Control tool access through API Scope:
  • Read-only tools: Available by default
  • Trading tools: Require explicit authorization
  • KYT tools: Require kyt.read scope
All tool calls are fully logged and viewable in Dashboard.

Next Steps