Skip to main content
Glama
osamadev

Financial MCP Server

by osamadev

金融MCPサーバー

高度な財務分析、株価モニタリング、リアルタイム市場情報を提供するカスタムモデルコンテキストプロトコル(MCP)サーバー。ポートフォリオ管理、市場サマリー、株価アラート、コンテキストベースの金融インサイトのためのツールとAPIエンドポイントを提供し、Claude Desktopやその他のMCP対応クライアントとのシームレスな統合を実現します。


主な特徴

  • リアルタイム株価モニタリング: ユーザー定義の株価としきい値の価格変動を追跡し、警告します。

  • ポートフォリオ管理: 永続的なポートフォリオで追跡対象の株式を追加、削除、表示します。

  • 市場概要: 指数、上昇銘柄/下落銘柄、ニュースの見出しなど、ライブの世界市場データを取得します。

  • コンテキスト金融インサイト: ユーザークエリを分析し、金融機関を抽出し、関連ニュースを取得して要約し、実用的なプロンプトを生成します。

  • 自動アラート: 価格しきい値、取引機会、システム エラーに関する Telegram 通知を受信します。

  • カスタマイズ可能な構成: 柔軟なアラートを実現する JSON ベースのセクターおよびストック構成。

  • 堅牢なログ記録とエラー処理: 透明性とトラブルシューティングのための詳細なログとエラー メッセージ。


Related MCP server: My Portfolio MCP Server

システムの概要

コアエンドポイントとツール

  • financial_context(クエリ: str)

    • ユーザークエリからティッカーとキーワードを抽出し、関連するニュースを取得して要約し、下流の分析のために構造化されたコンテキストとプロンプトを返します。

  • 市場概要()

    • 指数、主要銘柄、ニュースの見出しなど、世界の市場のライブ概要を返します。

  • get_portfolio()

    • ユーザーのポートフォリオで追跡されている株式の現在のリストを取得します。

  • add_stock(ティッカー: 文字列) / Remove_stock(ティッカー: 文字列)

    • キャッシュの無効化と検証を行いながら、ポートフォリオに株式を追加または削除します。

  • ポートフォリオアラート(ランダム文字列: str)

    • ポートフォリオに対してトリガーされたすべてのアラート、または提供されている場合は特定のティッカーに対してトリガーされたすべてのアラートを返します。

  • check_stock_alerts(ティッカー: str) / single_stock_alert(ティッカー: str)

    • 詳細なエラー処理とともに、特定の株に関するアラートを返します。

自動アラート

  • Telegram 統合: 構成された Telegram チャットにフォーマットされたアラートと概要を送信します。

  • 取引機会: 実行可能な取引シグナルを検出し、通知します。

文脈要約

  • News Summarizer : ローカル LLM (Ollama/Mistral) を使用して、金融ニュース記事の詳細な感情タグ付き要約を生成します。

  • プロンプト ビルダー: 下流の LLM またはアシスタントで使用するための市場を意識したプロンプトを構築します。


ファイル構造

config/
  alerts_config.json         # Main alert configuration (sector/ticker/thresholds)
  tech_alerts_config.json    # Tech sector-specific alerts
services/
  alerts.py                  # Core alert logic
  tech_alerts.py             # Tech sector alert logic
  telegram_alerts.py         # Telegram integration
  market_summary.py          # Market data and news
  summarizer.py              # News summarization (LLM)
  fetcher.py                 # Web data fetching
  context_builder.py         # Prompt/context construction
  intent_parser.py           # Financial entity extraction
  portfolio.py               # Portfolio management
server.py                    # MCP server entry point and API definitions
requirements.txt             # Python dependencies

構成とカスタマイズ

アラート設定 ( config/alerts_config.json )

  • カスタマイズ可能な上限/下限価格しきい値と説明を使用して、セクター別に株式を整理します。

  • 構造例:

{
  "Tech Giants": {
    "AAPL": {"above": 200, "below": 180, "description": "Apple Inc."}
  },
  "Financial": {
    "JPM": {"above": 160, "below": 140, "description": "JPMorgan Chase"}
  }
}

環境変数

これらを.envファイルまたはシステム環境に設定します。

TELEGRAM_BOT_TOKEN=your_bot_token
TELEGRAM_CHAT_ID=your_chat_id
SERPAPI_API_KEY=your_serpapi_key

Claude Desktopからのインストールと実行

前提条件

  • Python 3.7以上

  • Claude Desktop (またはMCP互換クライアント)

  • Telegram ボットの認証情報(アラート用)

  • インターネット接続(市場/ニュースデータ用)

ステップバイステップガイド

  1. リポジトリのクローンを作成する

    git clone <this-repo-url>
    cd Finance_MCP_Server
  2. 仮想環境の作成と有効化

    python -m venv .venv
    source .venv/bin/activate  # On Windows: .venv\Scripts\activate
  3. 依存関係をインストールする

    pip install -r requirements.txt
  4. 環境変数を設定する

    • API キーとトークンを使用して、プロジェクト ルートに.envファイルを作成します。

      TELEGRAM_BOT_TOKEN=your_bot_token
      TELEGRAM_CHAT_ID=your_chat_id
      SERPAPI_API_KEY=your_serpapi_key
  5. アラート設定の編集

    • config/alerts_config.jsonconfig/tech_alerts_config.jsonを変更して、株式、セクター、しきい値を設定します。

  6. CLIを使用してMCPサーバーをインストールする

    • MCP CLI を使用して、Claude Desktop のサーバーをインストールして登録します。

      mcp install server.py --name "Financial MCP Server"
    • これにより、サーバーがカスタム MCP ツールとして登録され、Claude Desktop やその他の MCP クライアントによって検出可能になります。

  7. MCP CLI経由でMCPサーバーを実行する

    • MCP CLI を使用してサーバーを起動します。

      mcp run server.py
    • サーバーが起動し、stdio 経由で MCP 要求をリッスンします。

  8. Claudeデスクトップから接続

    • Claude Desktop で、新しいカスタム MCP サーバー接続を追加します。

    • 実行可能ファイル/コマンドをmcp run server.pyに設定します (または、MCP CLI リストから登録済みの「Financial MCP Server」を選択します)。

    • Claude Desktop は MCP プロトコルを使用してサーバーと通信し、説明されているすべてのツールとエンドポイントを有効にします。


例: Claude デスクトップ MCP サーバー構成

Financial MCP Server をインストールして登録したら、Claude Desktop の設定に追加できます。claude_desktop_config.json claude_desktop_config.jsonサンプル スニペットを以下に示します。

{
  "mcpServers": {
    "Financial-MCP-Server": {
      "command": "uv",
      "args": [
        "run",
        "--with",
        "mcp[cli]",
        "mcp",
        "run",
        "server.py"
      ],
      "env": {
        "SERPAPI_API_KEY": "",
        "TELEGRAM_BOT_TOKEN": "",
        "TELEGRAM_USER_ID": "",
        "OPENAI_API_KEY": "",
        "ALPHA_VANTAGE_API_KEY": ""
      }
    }
  }
}
  • 必要に応じて、実際の API キーとトークンでenvセクションを更新します。

  • この構成により、Claude Desktop は正しい環境とコマンドライン引数を使用して Financial MCP Server を起動し、通信できるようになります。


Claude Desktopでツールを使用する

カスタムFinancial MCPサーバーをインストールして接続すると、利用可能なすべてのツールがClaude Desktopのツールメニューに自動的に表示されます。各ツールを個別に有効化または無効化できるため、Claudeインターフェースから金融コンテキスト分析、市場サマリー、ポートフォリオ管理、株価アラートなどの機能に簡単にアクセスできます。

以下は、MCP サーバーのツールが Claude Desktop でどのようにリストされ、切り替えられるかを示すスクリーンショットです。

クロードデスクトップMCPツールの例

  • 各ツール (例: financial_contextmarket_summaryadd_stockなど) は、必要に応じて有効または無効にできます。

  • このシームレスな統合により、Claude Desktop 内で自然言語とツールベースのワークフローを使用して財務分析サーバーと対話できるようになります。


使用例

  • 市場概要の取得: market_summaryツールを使用して、ライブ インデックス、動向、ニュースを取得します。

  • ポートフォリオの管理: 追跡している株式を更新および表示するには、 add_stockremove_stockget_portfolioを使用します。

  • アラートを受信する: しきい値を設定し、価格の変動や取引機会に関する Telegram 通知を受信します。

  • コンテキスト分析: financial_contextを使用してクエリを分析し、ティッカーを抽出し、要約されたニュースと市場に対応したプロンプトを取得します。


トラブルシューティングとログ

  • すべてのログはプロジェクト ルートのfinancial_mcp.logに書き込まれます。

  • デバッグするには、ログ ファイルをチェックして、環境変数と構成ファイルが正しいことを確認します。

  • Telegram またはニュースの取得で問題が発生した場合は、API キーとインターネット接続を確認してください。


F
license - not found
Not graded
quality - not tested
B
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    A Model Context Protocol server that provides stock technical analysis tools (moving averages, RSI, trade recommendations) for AI assistants to analyze stocks and offer trading signals.
  • F
    license
    Not graded
    quality
    B
    maintenance
    A Model Context Protocol (MCP) server for managing investment portfolios, enabling transaction tracking, position management, alerts, and daily snapshots with Google Drive sync.
  • F
    license
    Not graded
    quality
    A
    maintenance
    A remote Model Context Protocol (MCP) server for real-time cryptocurrency and stock market analysis. Provides AI-powered market intelligence tools with 9 theory-based analysis engines, multi-chain DEX discovery, and enterprise features.
  • F
    license
    Not graded
    quality
    D
    maintenance
    A Model Context Protocol (MCP) server that provides financial trading tools and market analysis capabilities, enabling AI assistants to access real-time market data, execute trades, analyze portfolios, and perform comprehensive financial analysis.

View all related MCP servers

Related MCP Connectors

  • MCP server for Gainium — manage trading bots, deals, and balances via AI assistants

  • MCP server for OpenMM — exposes market data, account, trading, and strategy tools to AI agents

  • Open-source MCP server for Zerodha Kite Connect. Portfolio, market data, backtesting, alerts.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/osamadev/financial_mcp_server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server