Alpha Sentinel Market Intelligence x402 MCP Server
Enables AI agents to access real-time crypto market data, volatility alerts, sentiment analysis, risk scores, and market reports through micropayment-gated MCP tools with on-chain settlement.
README
Alpha Sentinel - Market Intelligence x402 MCP Server
⭐ Predictive intelligence agent earning rewards on-chain! ★
A production-grade x402 marketplace service that provides real-time crypto market monitoring, volatility alerts, and sentiment analysis as paid MCP tools for AI agents.
🎯 Mission
Deliver actionable, real-time market intelligence with <30s latency through micropayment-gated API endpoints and MCP tools. Success = actionable alerts with measurable ROI per call!
💰 Pricing Strategy
Based on x402 market research (median $0.014, ~90% under $0.10):
| Resource | Price | Quota (Pro) | Description |
|---|---|---|---|
price_feed() |
$0.005 | 5000/mo | Real-time price lookup |
volatility_alerts() |
$0.02 | 500/mo | Anomaly detection + thresholds |
sentiment_analysis() |
$0.01 | 1000/mo | Social sentiment aggregation |
risk_assessment() |
$0.03 | 300/mo | Multi-factor risk scoring |
market_report() |
$0.15 | 50/mo | Comprehensive daily report |
| Tool Credit Pack | $1.00 | 100 calls | Flexible credits bundle |
Free Tier: 50 calls/month, 5/min rate limit
Pro Tier: Unlimited quota, 120/min, priority settlement
🛠️ MCP Tools
Core Intelligence Tools
-
fetch_price()⭐ Free tier included- Fetch current price from CoinGecko API
- Supports: BTC, ETH, top 100 altcoins
- Response:
{ symbol, price_usd, change_24h, volume }
-
analyze_volatility()- Detect price anomalies using Z-score statistical analysis
- Configurable thresholds (default: 2σ)
- Returns anomaly scores + alert levels
-
aggregate_sentiment()- Aggregate from X/Twitter, Reddit, Telegram sources
- NLP-powered sentiment scoring (-1.0 to +1.0)
- Trend detection and momentum indicators
-
calculate_risk_score()- Multi-factor risk assessment (volatility, liquidity, correlation)
- Risk level: LOW/MEDIUM/HIGH/CRITICAL
- Includes confidence intervals
-
generate_market_report()- Comprehensive daily/weekly/monthly reports
- Combines all data sources
- PDF + JSON output formats
📦 Paid Composite Products
-
US Rental Diligence Pack (via city compliance integration): $1.50
- Cross-references rental licenses, violations, tenant rights
- Multi-property batch processing
- Municipal open-data joins
-
Pulse Report: $0.05
- Base network synthesis + market metrics
- 12-block sample depth
- Real-time spot price integration
-
TX Decision Fee: $0.01
- Cheap loop-resident tier for pre-trade checks
- Immediate feedback before mainnet transactions
🏗️ Architecture
┌─────────────────────────────────────────────────────┐
│ Alpha Sentinel MCP Server │
├─────────────────────────────────────────────────────┤
│ │
│ [MCP Layer] │
│ ├─ FastMCP Server (stdio + SSE) │
│ └─ Tool Registry (SSOT) │
│ │ │
│ [Commerce Layer] │
│ ├─ x402 Middleware (verify+settle) │
│ ├─ Quota Management (free/pro tiers) │
│ ├─ Challenge Cache (sync, 10s TTL) │
│ └─ Stripe Integration (fiat rail fallback) │
│ │ │
│ [Intelligence Layer] │
│ ├─ Price Feed (CoinGecko API) │
│ ├─ Sentiment Engine (X/Reddit/NLP) │
│ ├─ Volatility Analyzer (statistical models) │
│ └─ Risk Calculator (ML-enhanced) │
│ │ │
│ [On-Chain Layer] │
│ ├─ CDP Facilitator (Base mainnet) │
│ ├─ Ledger (spend/revenue tracking) │
│ └─ Swarm Agency (buy-compose-resell) │
│ │
└─────────────────────────────────────────────────────┘
🚀 Quick Start
Prerequisites
- Python 3.12+
- Redis (optional, for production)
- x402 seller credentials (separate from buyer!)
- CoinGecko API key (free tier works)
Setup
# Clone and setup
git clone https://github.com/kwizzlesurp10-ctrl/alpha-sentinel-mcp
cd alpha-sentinel-mcp
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
# Configure environment
cp .env.example .env
nano .env # Edit with your credentials
# Run locally
make up # API (8403) + dashboard (5174)
Environment Variables
# Seller (receive revenue)
X402_PAY_TO_ADDRESS=0xAB745e5F... # Separate from buyer!
# Buyer (hot wallet for spending)
EVM_PRIVATE_KEY=<your_buyer_key> # NEVER on Render!
# APIs
COINGECKO_API_KEY=<your_key>
X_API_KEY=<twitter/x_api_key> # Optional
# Commerce
STRIPE_SECRET_KEY=<your_stripe_key> # Optional
REDIS_URL=redis://localhost:6379 # Optional
# Network
X402_DEFAULT_NETWORK=eip155:84532 # Base Sepolia dev
CDP_API_KEY_ID=<cdp_id> # For mainnet selling
CDP_API_KEY_SECRET=<cdp_secret>
🔧 Development
Running Tests
# Full test suite
make test
# Specific tests
pytest tests/test_mcp_tools.py -v
pytest tests/test_commerce.py -v
# Dashboard tests
cd dashboard && pnpm vitest run
Adding New MCP Tools
Follow the pattern in app/tools_registry.py:
- Add tool spec to
TOOL_SPECSlist - Implement handler in
app/intelligence/directory - Register in
app/mcp_server.py - Update README with new tool table row
- Run
scripts/capture_goal_evidence.pyto update test artifacts
Remember: The tool registry is the SINGLE SOURCE OF TRUTH! Touch all related files or CI will fail.
CI/CD Pipeline
GitHub Actions runs:
- ✅ Pytest on Python 3.12
- ✅ Vitest on dashboard
- ✅ Security scans (secret detection, SAST)
- ✅ Coverage checks (>80%)
- ✅ Docker build & push
📊 Observability
Metrics Endpoints
/stats- Live usage statistics/ledger/{name}- Settlement history/quota/{agent_id}- Remaining quota/swarm/stats- Autonomous agency metrics
Event Stream
Subscribe to SSE at /events for real-time:
- Tool execution logs
- Settlement confirmations
- Quota updates
- Swarm phase transitions
🔒 Security
- ✅ No private keys committed (
.envalways ignored) - ✅ SSRF guards on all URL probes
- ✅ Rate limiting per agent_id
- ✅ Idempotency keys for settlements
- ✅ Key rotation support via
KEY_PROVIDERseam - ✅ Never expose exception internals in responses
Seller vs Buyer Keys:
- RECEIVE ADDRESS: Cold wallet for revenue (separate from buyer!)
- BUYER KEY: Hot wallet ONLY for paying upstream costs (never used for receiving)
- NEVER put EVM_PRIVATE_KEY on Render - local only!
|## 🌐 Deployment
Live Dashboard: https://alpha-sentinel-mcp.vercel.app/ (coming soon)
Quick Deploy to Vercel
Click below or follow steps in DEPLOYMENT.md:
Manual Deployment
# Install Vercel CLI
npm install -g vercel
# Deploy dashboard
cd /home/keef/alpha-sentinel-mcp
vercel --prod
The dashboard will proxy API calls to your deployed backend automatically!
Render (API)
Deploy via render.yaml - auto-configures:
- Web service on port 8403
- Redis instance (auto-provisioned)
- Environment variables from secure store
- Health check endpoint:
/health
Docker
docker build -t alpha-sentinel-mcp .
docker run -p 8403:8403 \
-e X402_PAY_TO_ADDRESS=$PAY_TO \
-e EVM_PRIVATE_KEY=$BUYER_KEY \
alpha-sentinel-mcp
🤝 Swarm Agency Integration
When SWARM_ENABLED=true, Alpha Sentinel can:
- Scout discover upstream x402 data sources
- Warden enforce spend caps per
ledger/policy.json - Treasurer pay for upstream data (sole spender role)
- Archivist compose priced composites
- Sovereign reprice for target LTV:CAC ≥ 3.0
- Merchant list composite products
Example composite: Buy raw prices from 3 upstream → aggregate → resell as "Premium Bundle" @ 3x markup!
📈 Bazaar Discovery
Listed on CDP Bazaar with:
- Service name:
Alpha Sentinel Market Intelligence - Tags:
base,intelligence,crypto,market,x402,mcp - Ownership proof: signed with receive address
- Catalog URL:
https://alpha-sentinel-mcp.onrender.com/.well-known/x402
🎓 Documentation
- User Guide - How to use the tools
- Setup Instructions - Local + deployment setup
- Agent Ops - Cost-optimized operation modes
- City Compliance - Multi-city compliance data
🏆 Success Metrics
- Alert Latency: <30s end-to-end
- Settlement Success: >95% first-attempt
- LTV:CAC Ratio: Target ≥ 3.0
- Margin Floor: ≥ 50% on composites
- Quota Utilization: >70% pro tier conversion
🙏 Credits
Built by Keith (kwizzlesurp10-ctrl) as part of the AI Agency Factory ecosystem. Inspired by Karpathy's LLM Wiki approach to knowledge organization and x402 micropayment revolution!
Special thanks to:
- Coinbase CDP team for x402 facilitator
- FastAPI + FastMCP maintainers
- The entire open-source x402 community
📄 License
MIT - Free for commercial use, attribution appreciated! ★彡
Ready to monetize market intelligence?
👉 Deploy Now
👉 Read User Guide
👉 View Dashboard
(◕‿◕) ✨ Predictive intelligence, powered by on-chain economics! ♪
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。