Coinbase Chat MCP

Access cryptocurrency data, market information, and trading insights from Coinbase's public API.

Coinbase Chat MCP

MIT License TypeScript Model Context Protocol

An open-source Model Context Protocol (MCP) server and web application for seamless integration with Coinbase's public API. This project enables AI agents, LLMs, and developers to interact with cryptocurrency data, market information, and trading insights through a standardized, secure interface.

🌟 Features

šŸ”Œ MCP Server

  • Full MCP Compliance - Implements complete Model Context Protocol specification
  • 8 Powerful Tools - Real-time prices, historical data, market stats, asset search, and technical analysis
  • Cursor Integration - Pre-configured for Cursor IDE with .cursor/mcp.json
  • Claude Desktop Compatible - Works with any MCP-compatible client
  • Secure & Fast - Built-in rate limiting and intelligent caching

šŸ’¬ Interactive Chat Interface

  • AI-Powered Conversations - GPT-4 integration for intelligent crypto discussions
  • Session Persistence - Chat history saved across browser tabs and restarts
  • Session Management - Create, switch, and manage multiple chat sessions
  • Auto-Titling - Sessions automatically titled from first user message
  • Real-time Sync - Live updates when switching between sessions

šŸš€ API Explorer

  • Interactive Documentation - Live testing interface for all 8 MCP tools
  • Real-time Testing - Execute API calls directly from the browser
  • Code Generation - Auto-generated cURL and JavaScript examples
  • Copy-to-Clipboard - Easy code sharing and integration
  • Comprehensive Coverage - All endpoints documented with parameters and examples

šŸŽØ Modern Frontend

  • Beautiful UI - Clean, responsive design with TailwindCSS
  • Real-time Data - Live cryptocurrency prices and market updates
  • Multiple Pages - Dashboard, Markets, Assets, Analysis, Chat, and API Explorer
  • Mobile Friendly - Responsive design works on all devices

šŸš€ Quick Start

Prerequisites

  • Node.js 18+
  • npm 9+

Installation

  1. Clone the repository

    git clone https://github.com/your-username/coinbase-chat-mcp.git
    cd coinbase-chat-mcp
    
  2. Install dependencies

    npm install
    # Install dependencies for all workspaces
    cd mcp-server && npm install && cd ..
    cd frontend && npm install && cd ..
    cd api-server && npm install && cd ..
    
  3. Build the MCP server

    cd mcp-server
    npm run build
    cd ..
    
  4. Start development servers

    # Start API server (port 3002)
    cd api-server && npm run dev &
    
    # Start frontend (port 5173)
    cd frontend && npm run dev &
    

šŸ¤– MCP Integration

Cursor IDE Setup (Recommended)

The project includes pre-configured Cursor MCP settings:

  1. Automatic Configuration - .cursor/mcp.json is already configured
  2. Restart Cursor - MCP server will auto-load with 8 tools available
  3. Test Integration - Try asking: "What's the current Bitcoin price?"

Claude Desktop Setup

Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json):

{
  "mcpServers": {
    "coinbase-mcp": {
      "command": "node",
      "args": ["/path/to/coinbase-chat-mcp/mcp-server/dist/index.js"],
      "env": {
        "COINBASE_API_URL": "https://api.coinbase.com/v2",
        "LOG_LEVEL": "info"
      }
    }
  }
}

Available MCP Tools

  1. get_spot_price - Current cryptocurrency prices
  2. get_historical_prices - Historical price data with time ranges
  3. get_exchange_rates - Fiat currency exchange rates
  4. search_assets - Find cryptocurrencies and assets
  5. get_asset_details - Detailed asset information
  6. get_market_stats - 24-hour market statistics
  7. get_popular_pairs - Popular trading pairs
  8. analyze_price_data - Technical analysis (volatility, trends, support/resistance)

šŸ—ļø Architecture

coinbase-chat-mcp/
ā”œā”€ā”€ mcp-server/          # MCP Protocol Server (8 tools)
ā”œā”€ā”€ api-server/          # Express REST API Server  
ā”œā”€ā”€ frontend/            # React + TypeScript Frontend
│   ā”œā”€ā”€ src/pages/       # Dashboard, Chat, API Explorer, etc.
│   ā”œā”€ā”€ src/components/  # Reusable UI components
│   └── src/services/    # Chat sessions & AI integration
ā”œā”€ā”€ docs/                # Documentation & MCP setup notes
└── .cursor/             # Cursor IDE MCP configuration

MCP Server

The core MCP server exposes Coinbase data through 8 specialized tools:

  • Price Tools: Real-time and historical cryptocurrency prices
  • Market Tools: Trading statistics and popular pairs
  • Asset Tools: Search and detailed asset information
  • Analysis Tools: Technical analysis and market insights
  • Exchange Tools: Fiat currency exchange rates

Frontend Application

Modern React application featuring:

  • MCP Chat - AI-powered crypto conversations with session persistence
  • MCP Tester - Interactive tool testing environment with parameter validation
  • API Explorer - Interactive documentation and testing for all MCP tools
  • Tutorial - Step-by-step guide for integrating and using MCP tools

šŸ”§ Configuration

Environment Variables

Create .env files for AI chat functionality:

# frontend/.env (Optional - for AI chat)
VITE_OPENAI_API_KEY=your_openai_api_key_here

Security Note: The frontend includes built-in warnings about client-side API key usage and only enables AI features in development mode.

šŸ¤– AI Chat Setup (Optional)

To enable the AI-powered chat interface:

  1. Get OpenAI API Key: Visit OpenAI Platform
  2. Create frontend/.env file:
    VITE_OPENAI_API_KEY=sk-your-actual-api-key-here
    
  3. Restart the frontend: Chat will use GPT-4 for intelligent crypto discussions!

Note: Without the API key, the chat interface provides a helpful setup message and basic functionality.

šŸ“š Usage Examples

MCP Tools in Cursor/Claude

User: "What's the current Bitcoin price?"
Response: Current BTC-USD price: $100,608.65 USD

User: "Show me Ethereum's price trend over the last 7 days"
Response: [Historical price data with analysis]

User: "Analyze Bitcoin's volatility this month"
Response: [Technical analysis with volatility metrics]

Frontend Web Application

  • Visit: http://localhost:3005
  • Chat: Persistent conversations with session management
  • API Explorer: Test all 8 MCP tools interactively
  • Dashboard: Real-time market overview
  • Markets: Detailed trading statistics

Direct API Usage

# Get current Bitcoin price
curl http://localhost:3002/api/v1/prices/BTC-USD

# Search for assets
curl http://localhost:3002/api/v1/assets/search?query=bitcoin

šŸ› ļø Development

Key Features Implemented

  • āœ… MCP Server - 8 tools, full protocol compliance
  • āœ… Cursor Integration - Pre-configured MCP setup
  • āœ… Chat Sessions - Persistent conversations with localStorage
  • āœ… API Explorer - Interactive documentation for all tools
  • āœ… Session Management - Create, switch, delete chat sessions
  • āœ… AI Integration - GPT-4 powered conversations
  • āœ… Security - Client-side API key warnings and protections

Development Scripts

# Build MCP server
cd mcp-server && npm run build

# Start API server (development)
cd api-server && npm run dev

# Start frontend (development)  
cd frontend && npm run dev

# Test MCP server
cd mcp-server && npm test

Project Structure

  • mcp-server/: TypeScript MCP server with 8 Coinbase tools
  • api-server/: Express.js REST API server
  • frontend/: React + TypeScript with TailwindCSS
  • docs/: MCP setup notes and documentation
  • .cursor/: Cursor IDE MCP configuration

šŸ“– Documentation

✨ Recent Updates

Chat Session Management

  • Persistent chat sessions across browser tabs
  • Session history with auto-titling
  • Real-time session switching
  • localStorage-based persistence
  • Observer pattern for live updates

API Explorer

  • Interactive testing for all 8 MCP tools
  • Real-time API responses
  • Code generation (cURL, JavaScript)
  • Copy-to-clipboard functionality
  • Comprehensive parameter documentation

Cursor MCP Integration

  • Pre-configured .cursor/mcp.json
  • Auto-loading of 8 MCP tools
  • Ready-to-use cryptocurrency queries
  • Professional development workflow

šŸ¤ Contributing

We welcome contributions! Please see our Contributing Guide for details.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

šŸ“‹ Roadmap

  • v1.0: Core MCP server with 8 tools
  • v1.1: Chat session persistence
  • v1.2: Interactive API explorer
  • v1.3: Cursor IDE integration
  • v1.4: WebSocket real-time streaming
  • v1.5: Advanced charting and technical indicators
  • v2.0: Multi-exchange support

šŸ› Known Issues

  • Rate limiting on Coinbase public API (60 requests/hour for some endpoints)
  • Chat sessions limited to localStorage (10 sessions max for performance)
  • Client-side API keys should only be used in development

šŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

šŸ™ Acknowledgments

  • Model Context Protocol team for the excellent specification
  • Coinbase for providing robust public APIs
  • Cursor for excellent MCP integration
  • The open-source community for invaluable tools and libraries

šŸ“ž Support


Made with ā¤ļø by Vladimir Bichev for the crypto and AI communities

Related Servers