Crypto-News-Intelligence-Server-MCP

KaayaanAi/Crypto-News-Intelligence-Server-MCP

3.2

If you are the rightful owner of Crypto-News-Intelligence-Server-MCP and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

CNiS-MCP is an advanced crypto news intelligence server offering triple protocol support for enhanced news analysis and integration.

Tools
5
Resources
0
Prompts
0

πŸ“° CNiS-MCP: Crypto News Intelligence Server

License: MIT Node.js TypeScript MCP Protocol Docker n8n Compatible

Advanced crypto news intelligence with triple protocol support and enterprise security

πŸ”„ STDIO MCP | 🌐 HTTP REST | πŸ”— HTTP MCP Protocol | ⚑ WebSocket MCP

πŸš€ Features

πŸ“Š Intelligence Analysis

  • Credibility Scoring: AI-powered source verification and fact-checking
  • Impact Analysis: Market impact prediction with price effect estimates
  • Sentiment Analysis: Multi-dimensional sentiment scoring
  • Cross-Reference Verification: News validation across multiple sources

πŸ”— Triple Protocol Support

  • STDIO MCP: Direct integration with Claude Desktop
  • HTTP REST API: Standard REST endpoints for web applications
  • HTTP MCP Protocol: Full n8n-nodes-mcp compatibility with JSON-RPC 2.0
  • WebSocket MCP: Real-time streaming support for live updates

πŸ“‘ Free Data Sources

  • 100% Free RSS Feeds: No API keys required for basic functionality
  • 11 Trusted Sources: CoinDesk, Cointelegraph, The Block, and more
  • Official Sources: SEC, Federal Reserve regulatory updates
  • On-Chain Analytics: Glassnode and CryptoQuant insights

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   RSS Feeds     │───▢│  News Collector  │───▢│ Intelligence    β”‚
β”‚ (11 Sources)    β”‚    β”‚  & Aggregator    β”‚    β”‚ Engine          β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                                         β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”            β–Ό
β”‚ STDIO MCP       │◄────                  β”‚    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ HTTP REST API   β”‚    β”‚  Triple Protocol │◄───│ Analyzed News   β”‚
β”‚ HTTP MCP        β”‚    β”‚  Server          β”‚    β”‚ + Scoring       β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ† MCP Standards Compliance

CNiS-MCP Server is fully compliant with MCP Protocol 2024-11-05 standards:

βœ… Required Methods

  • initialize - Server handshake and capability exchange (< 500ms)
  • tools/list - List all available news analysis tools (< 1s)
  • tools/call - Execute crypto news analysis tools (< 30s)

βœ… Optional Methods (Implemented)

  • resources/list - List available news data resources
  • resources/read - Access live crypto news streams
  • prompts/list - List available analysis prompt templates
  • prompts/get - Generate specialized crypto analysis prompts

βœ… JSON-RPC 2.0 Compliance

  • Strict JSON-RPC 2.0 format validation
  • Proper error codes (-32700 to -32099)
  • Batch request support
  • Response time SLAs met

βœ… n8n Integration Ready

  • Full compatibility with n8n-nodes-mcp
  • CORS headers configured
  • Request/response validation
  • Production-grade error handling

βœ… Enterprise Security

  • Environment-based authentication: No hardcoded credentials
  • JWT token authentication: 32+ character secrets required
  • WebSocket authentication: Authenticated real-time connections
  • Input validation: Comprehensive Zod schema validation
  • Rate limiting: Configurable request limiting (100 req/15min default)
  • Request sanitization: XSS and injection protection
  • Security headers: CORS, CSP, XSS protection
  • Zero vulnerabilities: No npm security issues
  • Production hardening: Docker health checks and security scanning

⚑ Quick Start

1. Installation

# Clone the repository
git clone <repository-url>
cd cnis-mcp

# Install dependencies
npm install

# Build the project
npm run build

2. Security Configuration ⚠️ Required

Create and configure your environment file:

# Copy environment template
cp .env.example .env

# Configure required security variables
nano .env

Required Environment Variables:

# Authentication (REQUIRED for production)
JWT_SECRET="your-secure-jwt-secret-minimum-32-characters-long"
ADMIN_USERNAME="your-admin-username"
ADMIN_PASSWORD="your-secure-admin-password"
ADMIN_API_KEY="your-admin-api-key-for-authentication"

# Server configuration
NODE_ENV=production
PORT=3000
HOST=0.0.0.0

# Security settings
AUTH_ENABLED=true
RATE_LIMIT_ENABLED=true

πŸ”’ Security Note: Never use default or weak credentials in production. Generate strong, unique values for all authentication variables.

3. Development Mode

# STDIO MCP Mode (for Claude Desktop) - Auth disabled by default
NODE_ENV=development npm run dev

# HTTP Server Mode (for web applications) - Auth disabled by default
NODE_ENV=development npm run dev:http

# WebSocket Mode (for real-time applications)
NODE_ENV=development npm run dev:websocket

# Full Protocol Mode (all protocols enabled)
NODE_ENV=development npm run dev:full

4. Production Deployment πŸ”’

Pre-deployment Security Checklist:

  • Strong JWT_SECRET configured (32+ characters)
  • Admin credentials set (no defaults)
  • AUTH_ENABLED=true
  • NODE_ENV=production
  • All environment variables validated
# Build and validate
npm run build
npm audit  # Should show 0 vulnerabilities

# STDIO mode (secure)
npm start

# HTTP mode (with authentication)
HTTP_MODE=true npm start

# WebSocket mode (with authentication)
WEBSOCKET_MODE=true npm start

# Full mode (all protocols with authentication)
FULL_MODE=true npm start

5. Docker Deployment 🐳

Create secure environment file for Docker:

# Copy and configure environment
cp .env.example .env.docker
# Edit .env.docker with production values
# Build secure image
docker build -t cnis-mcp:1.1.0 .

# STDIO mode (secure)
docker run --env-file .env.docker cnis-mcp:1.1.0

# HTTP mode (with authentication)
docker run --env-file .env.docker -p 3000:3000 -e HTTP_MODE=true cnis-mcp:1.1.0

# Using docker-compose (recommended)
docker-compose --env-file .env.docker up

Docker Security Features:

  • Non-root user (nodejs:1001)
  • Minimal Alpine base image
  • Health checks enabled
  • Secure environment variable handling

πŸ”’ Security Configuration

Authentication Methods

1. JWT Token Authentication
# Generate and set JWT secret (32+ characters required)
JWT_SECRET="your-super-secure-jwt-secret-key-32-chars-minimum"

# Admin credentials for JWT generation
ADMIN_USERNAME="your-admin-username"
ADMIN_PASSWORD="your-secure-admin-password"
2. API Key Authentication
# Set admin API key for direct access
ADMIN_API_KEY="your-generated-admin-api-key-here"

# Optional demo key (development only)
DEMO_API_KEY="your-demo-key-here"  # Only when NODE_ENV=development
3. WebSocket Authentication

WebSocket connections support both authentication methods:

// JWT Token (preferred)
const ws = new WebSocket('ws://localhost:3000/mcp/ws?token=YOUR_JWT_TOKEN');

// API Key
const ws = new WebSocket('ws://localhost:3000/mcp/ws?apiKey=YOUR_API_KEY');

// Header-based (alternative)
const ws = new WebSocket('ws://localhost:3000/mcp/ws', {
  headers: {
    'Authorization': 'Bearer YOUR_JWT_TOKEN',
    // or
    'x-api-key': 'YOUR_API_KEY'
  }
});

Production Security Checklist

  • Strong JWT Secret: 32+ characters, randomly generated
  • Secure Admin Credentials: No default usernames/passwords
  • Environment Variables: All credentials in environment, not code
  • HTTPS Enabled: Use reverse proxy (nginx/Apache) for HTTPS
  • Rate Limiting: Enabled and configured for your use case
  • CORS Policy: Configured for your allowed origins
  • Firewall Rules: Restrict access to necessary IPs only
  • Regular Updates: Keep dependencies updated (npm audit)

πŸ”§ Configuration

Environment Variables

# Security Configuration (REQUIRED)
JWT_SECRET="your-jwt-secret-32-chars-minimum"
ADMIN_USERNAME="your-admin-username"
ADMIN_PASSWORD="your-secure-admin-password"
ADMIN_API_KEY="your-admin-api-key"
AUTH_ENABLED=true

# Server Configuration
NODE_ENV=production               # production/development
MCP_MODE=stdio                    # stdio/http/websocket/full
PORT=3000                         # HTTP server port
HOST=0.0.0.0                      # Bind address

# Security Settings
RATE_LIMIT_ENABLED=true          # Enable rate limiting
RATE_LIMIT_MAX_REQUESTS=100      # Requests per window
RATE_LIMIT_WINDOW_MS=900000      # 15 minutes window
CORS_ORIGIN=*                    # Allowed CORS origins

# News Settings
CACHE_TTL_MINUTES=15              # Cache duration
MAX_NEWS_AGE_HOURS=24            # News age limit
CREDIBILITY_THRESHOLD=40          # Minimum credibility score
IMPACT_THRESHOLD=50               # Minimum impact score

RSS News Sources

TierSourceURLStatus
Tier 1CoinDeskcoindesk.com/rssβœ… Active
Tier 1Cointelegraphcointelegraph.com/rssβœ… Active
Tier 1The Blocktheblock.co/rss.xmlβœ… Active
Tier 1Decryptdecrypt.co/feedβœ… Active
Tier 1Bitcoin Magazinebitcoinmagazine.com/rssβœ… Active
OfficialSEC Presssec.gov/rssβœ… Active
AnalyticsGlassnodeinsights.glassnode.com/rssβœ… Active

πŸ”— Integration Guides

Claude Desktop Integration

  1. Install the MCP server:
npm install -g cnis-mcp-server
# or via npx
claude mcp add cnis-mcp-server npx -s user cnis-mcp-server
  1. Restart Claude Desktop:
# Press Ctrl+C twice, then:
claude --continue
  1. Available tools in Claude:
  • get_top_crypto_news - Get analyzed top news
  • search_crypto_news - Search by keywords
  • get_market_impact_news - High-impact news only
  • analyze_news_credibility - Credibility analysis
  • get_news_by_source - Source-specific news

HTTP REST API πŸ”

Base URL: http://localhost:3000

Authentication Required

Option 1: API Key Authentication

# Get top crypto news
curl -X POST http://localhost:3000/api/news/top \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{"count": 10, "filter_impact": "high"}'

# Search news
curl -X POST http://localhost:3000/api/news/search \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{"query": "bitcoin ETF", "count": 5}'

Option 2: JWT Token Authentication

# First, get JWT token
curl -X POST http://localhost:3000/auth/login \
  -H "Content-Type: application/json" \
  -d '{"username": "your-admin-username", "password": "your-admin-password"}'

# Use JWT token for API calls
curl -X POST http://localhost:3000/api/news/top \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -d '{"count": 10, "filter_impact": "high"}'

# Get high-impact news with JWT
curl -X POST http://localhost:3000/api/news/impact \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -d '{"min_impact_score": 70, "count": 10}'
WebSocket MCP Protocol
# Authenticated WebSocket connection
wscat -c "ws://localhost:3000/mcp/ws?token=YOUR_JWT_TOKEN"

# Send MCP request
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "get_top_crypto_news",
    "arguments": {"count": 10, "filter_impact": "high"}
  }
}

Health check

curl http://localhost:3000/health


### **n8n Integration**

1. **Install n8n MCP Client node**
2. **Configure MCP connection**:
```json
{
  "nodeType": "MCP Client",
  "connection": {
    "type": "Command Line (STDIO)",
    "command": "docker exec -i cnis-mcp-server node /app/build/index.js"
  },
  "tools": [
    "get_top_crypto_news",
    "search_crypto_news", 
    "get_market_impact_news"
  ]
}
  1. HTTP MCP Protocol (alternative):
{
  "endpoint": "http://localhost:3000/mcp",
  "method": "POST",
  "headers": {"Content-Type": "application/json"}
}

πŸ“Š API Reference

Tools Overview

ToolDescriptionKey Parameters
get_top_crypto_newsAnalyzed top news with intelligence scoringcount, filter_impact, include_sentiment
search_crypto_newsSearch news by keywordsquery, count, source_tier
get_market_impact_newsHigh-impact market-moving newsmin_impact_score, affected_assets
analyze_news_credibilityCredibility analysis of specific URLnews_url
get_news_by_sourceNews from specific sourcesource, count

Response Format

{
  "timestamp": "2024-01-XX",
  "news_count": 10,
  "market_summary": {
    "overall_sentiment": "CAUTIOUS",
    "high_impact_count": 3,
    "verified_news_percentage": 78,
    "market_bias": "NEUTRAL",
    "dominant_narrative": "regulatory uncertainty"
  },
  "top_news": [
    {
      "rank": 1,
      "title": "SEC Delays Bitcoin ETF Decision",
      "source": "CoinDesk",
      "analysis": {
        "credibility_score": 95,
        "impact_score": 88,
        "sentiment": "NEGATIVE",
        "importance": "CRITICAL",
        "affected_assets": ["BTC", "MARKET_WIDE"],
        "price_impact": "HIGH (Β±5-15%)"
      },
      "recommendation": {
        "action": "BEARISH_SIGNAL",
        "reason": "High impact regulation news",
        "urgency": "HIGH"
      }
    }
  ]
}

Intelligence Scoring

Credibility Score (0-100)
  • 80-100: VERIFIED - Multiple trusted sources
  • 60-79: LIKELY_TRUE - Credible source, needs verification
  • 40-59: UNVERIFIED - Uncertain reliability
  • 0-39: LIKELY_FALSE - Poor source or suspicious content
Impact Score (0-100)
  • 80-100: CRITICAL - Major market impact expected (Β±5-15%)
  • 60-79: HIGH - Significant impact likely (Β±2-5%)
  • 40-59: MEDIUM - Moderate impact possible (Β±1-2%)
  • 0-39: LOW - Minimal impact expected (<1%)
Sentiment Analysis
  • VERY_POSITIVE: 80-100
  • POSITIVE: 65-79
  • NEUTRAL: 35-64
  • NEGATIVE: 20-34
  • VERY_NEGATIVE: 0-19

πŸ› οΈ Development

Project Structure

src/
β”œβ”€β”€ index.ts              # Main server (STDIO + HTTP)
β”œβ”€β”€ types.ts              # TypeScript interfaces
β”œβ”€β”€ config.ts             # Configuration & RSS sources
β”œβ”€β”€ news-collector.ts     # RSS aggregation & caching
└── news-analyzer.ts      # Intelligence analysis engine

Testing

# Build and test with MCP Inspector
npm run build
npm run inspector

# Test HTTP endpoints
npm run dev:http
curl http://localhost:3000/health

# Test specific functionality
node -e "
const { NewsCollector } = require('./build/news-collector.js');
const collector = new NewsCollector();
collector.collectAllNews().then(console.log);
"

Key Features Implementation

RSS Collection
  • Parallel fetching from 11 sources
  • 15-minute intelligent caching
  • Duplicate detection and merging
  • Source tier prioritization
Intelligence Analysis
  • Rule-based credibility scoring
  • Impact category detection
  • Sentiment keyword analysis
  • Cross-reference validation
Performance Optimization
  • In-memory caching with TTL
  • Parallel RSS processing
  • Optimized deduplication
  • Graceful error handling

πŸ”’ Security

Data Privacy

  • No API keys required for basic functionality
  • No external AI services - all analysis is local
  • No user data storage - stateless operation
  • Open source transparency

Production Security

  • Non-root Docker user
  • Environment variable isolation
  • Input validation with Zod
  • Rate limiting ready
  • CORS configuration

πŸ“ˆ Performance Metrics

  • News Sources: 11 RSS feeds
  • Update Frequency: 15 minutes (configurable)
  • Cache Duration: 15 minutes (configurable)
  • Response Time: <2 seconds for cached data
  • Memory Usage: ~50MB typical
  • Concurrent Support: 100+ requests/second

🀝 Contributing

  1. Fork the repository
  2. Create feature branch: git checkout -b feature/awesome-feature
  3. Commit changes: git commit -m 'Add awesome feature'
  4. Push branch: git push origin feature/awesome-feature
  5. Open Pull Request

πŸ“„ License

MIT License - see file for details.

πŸ”— Links


Built with ❀️ for the crypto community by Kaayaan Infrastructure

Empowering intelligent decision-making through advanced news analysis