FinClaw

FinClaw

MCP server that provides AI agents with financial tools including real-time quotes, backtesting, technical analysis, and multi-exchange data via a simple CLI interface.

Category
Visit Server

README

<h1 align="center">๐Ÿฆ€ FinClaw</h1>

<p align="center"> <strong>AI-powered quantitative finance in your terminal</strong> </p>

<p align="center"> <a href="https://pypi.org/project/finclaw-ai/"><img src="https://img.shields.io/pypi/v/finclaw-ai?color=blue" alt="PyPI"></a> <a href="https://github.com/NeuZhou/finclaw/actions/workflows/ci.yml"><img src="https://github.com/NeuZhou/finclaw/actions/workflows/ci.yml/badge.svg" alt="CI"></a> <a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="License"></a> <a href="https://www.python.org/"><img src="https://img.shields.io/badge/python-3.9%2B-blue" alt="Python"></a> <a href="https://github.com/NeuZhou/finclaw/stargazers"><img src="https://img.shields.io/github/stars/NeuZhou/finclaw?style=social" alt="Stars"></a> </p>

<p align="center"> <img src="https://raw.githubusercontent.com/NeuZhou/finclaw/master/docs/demo.gif" alt="FinClaw Demo" width="700"> </p>

$ finclaw quote AAPL
  AAPL  $252.82  +2.31 +0.92%
  Bid: 252.82  Ask: 252.83  Vol: 30,091,880

$ finclaw analyze TSLA --indicators rsi,macd,bollinger
  ๐Ÿ”ฌ Technical Analysis: TSLA
  Price: $175.21  |  52w High: $299.29  |  52w Low: $138.80

  RSI(14)        62.4  NEUTRAL     momentum balanced
  MACD          +4.82  BULLISH     histogram expanding
  Bollinger      72%B  NEUTRAL     upper half of band

$ finclaw backtest -t NVDA --start 2023-01-01
  ๐Ÿš€ NVDA | momentum
  Return: +142.3% (+55.2%/yr) | Alpha: +18.7%
  MaxDD: -12.1% | Sharpe: 1.85 | Trades: 47

Why FinClaw?

Most quant tools make you configure databases, install heavy dependencies, and write boilerplate before you see your first result. FinClaw gets you from zero to insight in one command. Zero API keys needed โ€” it uses Yahoo Finance by default. A pure NumPy core means it installs in seconds, not minutes. And when you're ready for AI-powered strategy generation, MCP agent integration, or multi-exchange live trading โ€” it's all built in.


Quick Start

pip install finclaw-ai
finclaw demo              # See all features โ€” no API key needed
finclaw quote AAPL        # Real-time stock quote
finclaw copilot           # AI financial assistant

Feature Comparison

Feature FinClaw Backtrader Zipline Freqtrade
Zero-config install โœ… โŒ โŒ โŒ
CLI interface โœ… โŒ โŒ โœ…
AI strategy generation โœ… โŒ โŒ โŒ
Natural language copilot โœ… โŒ โŒ โŒ
MCP server (AI agents) โœ… โŒ โŒ โŒ
A2A protocol โœ… โŒ โŒ โŒ
Paper trading โœ… โŒ โœ… โœ…
Backtesting โœ… โœ… โœ… โœ…
Multi-exchange (12+) โœ… โŒ โŒ โœ…
Strategy plugins โœ… โœ… โŒ โœ…
No heavy deps (pure NumPy) โœ… โŒ โŒ โŒ
Crypto + Stocks + CN Stocks โœ… โœ… โŒ โœ…*
Terminal charts โœ… โŒ โŒ โŒ
YAML strategy DSL โœ… โŒ โŒ โŒ
BTC on-chain metrics โœ… โŒ โŒ โŒ
Funding rate dashboard โœ… โŒ โŒ โœ…
Lightning Network monitor โœ… โŒ โŒ โŒ

What You Can Do

๐Ÿ“Š Quotes & Analysis

finclaw quote AAPL,MSFT,NVDA        # Multi-ticker quotes
finclaw analyze TSLA --indicators rsi,macd,bollinger,sma50
finclaw chart AAPL --type candle     # Terminal candlestick chart
finclaw news AAPL                    # Financial news
finclaw sentiment TSLA               # Sentiment analysis

๐Ÿš€ Backtesting

finclaw backtest -t AAPL,MSFT --strategy momentum --start 2023-01-01
finclaw backtest -t NVDA --benchmark SPY    # Compare to benchmark
finclaw strategy list                        # 20+ built-in strategies
finclaw strategy backtest trend-following --symbol AAPL

๐Ÿ“‹ Paper Trading

finclaw paper start --balance 100000
finclaw paper buy AAPL 50
finclaw paper sell MSFT 20
finclaw paper dashboard
finclaw paper run-strategy golden-cross --symbols AAPL,MSFT

๐Ÿค– AI Features

# Generate strategies from plain English or ไธญๆ–‡
finclaw generate-strategy "buy when RSI < 30 and MACD golden cross"
finclaw generate-strategy --market crypto --risk high "momentum on volume spike"

# Interactive AI assistant
finclaw copilot
> ๅˆ†ๆž็‰นๆ–ฏๆ‹‰ๆœ€่ฟ‘่ตฐๅŠฟ
> ๅธฎๆˆ‘ๅˆ›ๅปบไธ€ไธชๅ‡ๅ€ผๅ›žๅฝ’็ญ–็•ฅ

# AI-optimize existing strategies
finclaw optimize-strategy my_strategy.py --data AAPL --period 1y

Supports: OpenAI, Anthropic, DeepSeek, Gemini, Ollama (local), Groq, Mistral, Moonshot.

โ›“๏ธ BTC Metrics & Crypto Tools

finclaw btc-metrics                  # On-chain dashboard (hashrate, MVRV, miner outflow)
finclaw funding-rates                # Multi-exchange funding rate comparison + arbitrage
finclaw fear-greed --history 7       # Fear & Greed Index with history

Features:

  • BTC On-Chain Metrics โ€” Hashrate, difficulty, mempool, MVRV ratio, miner outflow (via Blockchain.info)
  • Multi-Exchange Funding Dashboard โ€” Binance, Bybit, OKX funding rates with arbitrage detection
  • Lightning Network Monitor โ€” Network capacity, node count, channel stats (via 1ML.com)
  • Fear & Greed Index โ€” Current and historical data (via Alternative.me)
  • Liquidation Tracker โ€” Track liquidation events across exchanges
  • On-Chain Analytics โ€” Transaction volume, active addresses

๐Ÿ”Œ MCP Server (for AI Agents)

Expose FinClaw as tools for Claude, Cursor, VS Code, or OpenClaw:

{
  "mcpServers": {
    "finclaw": {
      "command": "finclaw",
      "args": ["mcp", "serve"]
    }
  }
}

10 MCP tools available: get_quote, get_history, list_exchanges, run_backtest, analyze_portfolio, get_indicators, screen_stocks, get_sentiment, compare_strategies, get_funding_rates.

๐Ÿ“ˆ Strategy Plugin Ecosystem

# Create a plugin in 5 minutes
finclaw init-strategy my_strategy
cd finclaw-strategy-my_strategy
pip install -e .
finclaw backtest --strategy plugin:my_strategy -t AAPL

# Or use YAML DSL
finclaw strategy create     # Interactive builder
finclaw strategy dsl-backtest my_strategy.yaml --symbol AAPL
finclaw strategy optimize my_strategy.yaml --param rsi_period:10:30:5

Compatible with Backtrader strategies, TA-Lib indicators, and basic Pine Script.

๐ŸŒ 12+ Exchange Adapters

Crypto: Binance, Bybit, OKX, Coinbase, Kraken (with WebSocket for Binance/Bybit/OKX) US Stocks: Yahoo Finance, Alpaca, Polygon, Alpha Vantage CN Stocks: AkShare, BaoStock, Tushare

finclaw exchanges list               # See all adapters
finclaw exchanges compare yahoo binance alpaca
finclaw quote BTCUSDT --exchange binance
finclaw history ETHUSDT --exchange bybit --timeframe 1h --limit 50

๐Ÿค A2A Protocol (Agent-to-Agent)

FinClaw implements the A2A protocol for inter-agent communication:

finclaw a2a serve --port 8081        # Start A2A server
finclaw a2a card                      # Print agent card

Python API

from finclaw import FinClaw

fc = FinClaw()

# Quote
quote = fc.quote("AAPL")
print(f"AAPL: ${quote['price']:.2f} ({quote['change_pct']:+.1f}%)")

# Backtest
result = fc.backtest(strategy="momentum", ticker="NVDA", start="2023-01-01")
print(f"Return: {result.total_return:.1%} | Sharpe: {result.sharpe_ratio:.2f}")

Full API documentation: docs/API.md


Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚               User Interfaces                     โ”‚
โ”‚  CLI  โ”‚  MCP Server  โ”‚  A2A  โ”‚  Copilot  โ”‚  API  โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚           AI Strategy Engine                      โ”‚
โ”‚  Generator โ”‚ Optimizer โ”‚ Copilot Chat โ”‚ Pine DSL  โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚            Strategy Layer                         โ”‚
โ”‚   Built-in (20+)  โ”‚  Plugins  โ”‚  YAML DSL        โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚   Backtester  โ”‚  Paper Trading  โ”‚  Risk Engine    โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚              Data Layer                           โ”‚
โ”‚  Yahoo โ”‚ Binance WS โ”‚ 12+ Exchanges โ”‚  Cache      โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚            Crypto Layer                           โ”‚
โ”‚  BTC Metrics โ”‚ Funding Rates โ”‚ Lightning โ”‚ DeFi   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Examples

See examples/ for runnable strategies:

python examples/simple_momentum.py AAPL
python examples/crypto_rsi.py BTC-USD
python examples/ai_generated.py TSLA

Contributing

git clone https://github.com/NeuZhou/finclaw.git
cd finclaw && pip install -e ".[dev]"
pytest

See CONTRIBUTING.md for guidelines.


License

MIT โ€” Built by Kang Zhou

๐Ÿ”— NeuZhou Ecosystem

FinClaw is part of the NeuZhou open source toolkit for AI agents:

Project What it does Link
repo2skill Convert any repo into an AI agent skill GitHub
ClawGuard Security scanner for AI agents GitHub
AgentProbe Behavioral testing framework for agents GitHub
FinClaw AI-powered financial intelligence engine You are here

The workflow: Generate skills with repo2skill โ†’ Scan for vulnerabilities with ClawGuard โ†’ Test behavior with AgentProbe โ†’ See it in action with FinClaw.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured