Skip to content

155143783/mcp-data-api

Repository files navigation

MCP Data API Server

License: MIT TypeScript Node.js

Production-ready MCP Server with 16 powerful data tools for AI agents. Query GitHub trending, NPM stats, HackerNews, crypto prices, weather, news, and more.

🎯 Features

16 Built-in Tools

Category Tools
GitHub github_trending - Get trending repositories by language/timeframe
NPM npm_downloads - Download stats, npm_package_info - Package details
Social hackernews_top, reddit_trending - Top posts from tech communities
Crypto crypto_price - Real-time prices, crypto_news - Latest news
Weather weather_current, weather_forecast - Current & forecast data
News news_headlines - Top headlines by category/country
Finance stock_quote - Stock prices, forex_rate - Currency exchange
Utilities ip_lookup, qr_generate, url_shorten, base64_encode, hash_generate

Deployment Modes

  • MCP Protocol - Native MCP server for AI agent integration
  • HTTP Mode - REST API server for direct HTTP access
  • x402 Support - Optional micro-payment for API access (USDC on Base)

πŸš€ Quick Start

Installation

npm install
npm run build

Configuration

Create config.json:

{
  "mcp": {
    "port": 3000,
    "auth": {
      "type": "bearer",
      "token": "your-api-key"
    }
  },
  "x402": {
    "enabled": true,
    "maxPrice": 1000000,
    "paymentAddress": "0x..."
  }
}

Run MCP Server

# MCP Protocol mode
npm start

# HTTP mode
npm run http

Docker Deployment

# Build
docker build -t mcp-data-api .

# Run
docker run -p 3000:3000 -v ./config.json:/app/config.json mcp-data-api

πŸ’³ x402 Micro-Payment

The x402 protocol enables pay-per-request API access using USDC on Base chain.

// Request with x402 payment
const response = await fetch('https://api.example.com/github/trending', {
  headers: {
    'Authorization': 'Bearer your-key',
    'X-402-Payment': 'amount=1000000&address=0x...&signature=...'
  }
});

πŸ“– API Documentation

MCP Tools

Tool Parameters Description
github_trending language, timeframe Trending repos
crypto_price symbol Current price
weather_current city Current weather
news_headlines category, country Top headlines

HTTP Endpoints

GET /api/github/trending?language=typescript
GET /api/crypto/price?symbol=BTC
GET /api/weather?city=Beijing
GET /api/news?category=technology

🀝 Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Submit a pull request

πŸ“„ License

MIT License - see LICENSE for details.

πŸ”— Links

🌐 Live Demo

Try the MCP Server right now:

🧩 Coze Skills (Try Online)

Related skills deployed on Coze platform:

Skill URL
πŸ“Š Data Visualization https://rvpk8hwp7f.coze.site
πŸ“ˆ Stock Technical Analysis https://x9pbf5fcrh.coze.site
πŸ” Hotspot Research https://nq495w538h.coze.site

πŸ“° Blog

Read our technical guides: