Skip to main content

MCP server for AI-powered stock analysis and paper trading

Project description

financial-mcp

MCP server for AI-powered stock analysis and paper trading. Exposes 14 tools over SSE for any MCP-compatible AI agent.

No API keys required. All market data comes from yfinance (free). Portfolio state is stored locally in SQLite.

Install

pip install financial-mcp

Quick Start

financial-mcp

Server starts on http://0.0.0.0:8520/sse.

Claude Desktop / Claude Code

Add to your MCP config:

{
  "mcpServers": {
    "financial-mcp": {
      "command": "uvx",
      "args": ["financial-mcp"]
    }
  }
}

Tools

Orchestration (4)

Tool Description
analyze_ticker Full analysis: fundamentals + momentum + composite score
analyze_portfolio Portfolio summary with holdings, allocations, performance, risk
run_rebalance Score universe, generate buy/sell signals, execute trades
scan_universe Score a list of tickers and rank by composite score

Primitives (10)

Tool Description
create_portfolio Create a new paper trading portfolio
get_fundamentals PE, EV/EBITDA, P/B, dividend yield, market cap, sector
get_momentum 30d/90d momentum, volatility, relative strength, drawdown
get_price Current price for a ticker
score_ticker Composite score (0-100) with component breakdown
get_holdings Current portfolio holdings
get_trades Trade history with optional status filter
execute_buy Buy shares via paper broker
execute_sell Sell shares via paper broker
check_risk Stress score, scenario drawdowns, sector/geo allocation

Scoring Formula

3-signal composite (optional 4th with sentiment):

  • Valuation (40%): PE, EV/EBITDA, P/B, dividend yield relative to sector medians
  • Momentum (35%): 30d/90d price momentum, relative strength vs SPY, volatility
  • Risk penalty (25%): Sector concentration, geographic concentration, max drawdown

Scores range 0-100. Buy threshold: 65. Sell threshold: 35.

Configuration

Default config is built-in. Override by placing a config.yaml in your working directory:

server:
  host: "0.0.0.0"
  port: 8520

scoring:
  weights:
    valuation: 0.40
    momentum: 0.35
    risk: 0.25
  buy_threshold: 65
  sell_threshold: 35

position_limits:
  moderate:
    max_position: 0.08
    max_sector: 0.30
    min_cash: 0.10

Example Usage

Once connected, an AI agent can:

> Create a $100K moderate portfolio
> Scan AAPL, MSFT, GOOGL, NVDA, META, AMZN, JPM, V
> Buy the top 3 scored tickers
> Check portfolio risk
> Run a full rebalance

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

financial_mcp_server-0.1.0.tar.gz (22.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

financial_mcp_server-0.1.0-py3-none-any.whl (24.6 kB view details)

Uploaded Python 3

File details

Details for the file financial_mcp_server-0.1.0.tar.gz.

File metadata

  • Download URL: financial_mcp_server-0.1.0.tar.gz
  • Upload date:
  • Size: 22.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for financial_mcp_server-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7dd0070dcf859cd5d358d4a4a8a44bee3bf57e6e1e4ca7218ddee034d2b85824
MD5 bcac45fd37cca64cee3315a8b417c9fe
BLAKE2b-256 2e857d7c652cbd2d260e0712ca88351663e88f9417ddb0f1728f4b700aa4c51c

See more details on using hashes here.

File details

Details for the file financial_mcp_server-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for financial_mcp_server-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6e17ac501daae74fbfa4dc1b3c1f941568bcaf93fdcea86ee6990e6ae84ec48f
MD5 0ab72e59ac2fc3634326953858114e73
BLAKE2b-256 4ac82fbec1265f5d72fa0367921ff20ca0b0ecb0a268c4424d2da9c7f1674245

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page