sentinel
Sentinel Execution MCP
本番グレードのアルゴリズム取引コントロールプレーンをMCPサーバーとして公開 — Claudeが自然言語でウォッチリストの管理、マーケットレジームの分類、リスク検証、ペーパー注文の提出を行えるようにします。
概要
Sentinelは2つのパッケージからなるモノレポです:
パッケージ | 言語 | 役割 |
| Python 3.12 / FastAPI | すべての取引ロジック: リスクチェック、レジーム分類、注文ライフサイクル、監査ジャーナル、戦略ガバナンス |
| TypeScript / Node 20 | 40以上のツールをHTTP経由でエンジンにルーティングする軽量MCPサーバー。取引ロジックは一切ここにはありません。 |
Claude(またはMCP互換のエージェント)はMCPサーバーと通信します。MCPサーバーはエンジンと通信します。エンジンがデータベースとキャッシュを所有します。
Related MCP server: Alpaca MCP Server
アーキテクチャ
Claude Desktop (or any MCP agent)
│
│ MCP protocol (stdio or SSE)
▼
┌─────────────────────────┐
│ MCP Server │ TypeScript · Zod validation · tool routing
│ (packages/mcp) │
└────────────┬────────────┘
│ HTTP REST (localhost:8100)
▼
┌─────────────────────────┐
│ Engine API │ Python · FastAPI · all trading logic
│ (packages/engine) │
└──────────┬──────────────┘
│
┌───────┴────────┐
▼ ▼
PostgreSQL Redis
(orders, (kill switch,
positions, rate limits,
strategies, cache)
audit log)エンジンが利用できない場合、すべてのMCPツール呼び出しは即座にエラーを返します。フォールバックや部分実行はありません。
クイックスタート(Docker — 推奨)
最速で起動する方法です。DockerとNode.js 20+が必要です。
# 1. Clone and configure
git clone https://github.com/rohith1125/sentinel-execution-mcp.git
cd sentinel-execution-mcp
cp .env.example .env # defaults work out of the box — no edits needed
# 2. Start Postgres + Redis + engine (runs migrations automatically)
docker compose -f docker/docker-compose.yml up -d db redis engine
# Wait ~10 seconds, then verify the engine is healthy:
curl http://localhost:8100/health
# {"status": "ok", "provider": "mock", ...}
# 3. Build the MCP server (one-time)
cd packages/mcp
npm install
npm run build次に、SentinelをClaude Desktopに追加し(下記のClaude Desktopに接続を参照)、Claudeを再起動します。これで完了です — 40のツールがすべて有効になります。
手動セットアップ(Dockerなし)
PostgresとRedisがすでにローカルで稼働している場合に使用します。
前提条件:
依存関係 | 最小バージョン | 備考 |
Python | 3.12 | エンジンのランタイム — |
Node.js | 20 | MCPサーバーのランタイム |
PostgreSQL | 15+ | プライマリデータストア |
Redis | 7+ | キルスイッチとキャッシュ |
1. クローンと設定
git clone https://github.com/rohith1125/sentinel-execution-mcp.git
cd sentinel-execution-mcp
cp .env.example .env
# Default values work for local paper-trading development — no edits required2. エンジンのセットアップ
cd packages/engine
python3.12 -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -e ".[dev]"3. データベースマイグレーションの実行
# From packages/engine with the venv active
alembic upgrade head4. エンジンの起動
uvicorn sentinel.api:app --reload --port 8100起動を確認します:
curl http://localhost:8100/health
# {"status": "ok", "env": "paper"}5. MCPサーバーのビルドと起動
2つ目のターミナルを開きます:
cd packages/mcp
npm install
npm run build
npm run dev # stdio transport — for direct Claude Desktop integrationClaude Desktopに接続
以下をClaude Desktopの設定ファイルに追加します。
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
ターミナルで以下を実行して正しいパスを取得します:
echo "$(pwd)/packages/mcp/dist/index.js"次に、それを設定に貼り付けます:
{
"mcpServers": {
"sentinel": {
"command": "node",
"args": ["/absolute/path/to/sentinel-execution-mcp/packages/mcp/dist/index.js"],
"env": {
"ENGINE_BASE_URL": "http://localhost:8100",
"APP_ENV": "paper"
}
}
}
}保存後、Claude Desktopを再起動します。チャット入力欄にハンマーアイコン(🔨)が表示されるはずです — クリックしてSentinelの40のツールが読み込まれていることを確認します。
MCPツールリファレンス
Sentinelは9つのカテゴリにわたる40以上のツールを公開しています。MCPサーバー名はsentinelです。
カテゴリ | ツール | 説明 |
ウォッチリスト |
| 取引ウォッチリストにシンボルを追加します。オプションでグループに割り当て可能 |
| シンボルを削除します。以後、戦略スキャンには表示されません | |
| アクティブなシンボルを一覧表示します。オプションでグループでフィルタリング可能 | |
| 単一シンボルの詳細を取得します | |
| 名前付きウォッチリストグループをすべて一覧表示します | |
| シンボルのメモまたはグループ割り当てを更新します | |
マーケットデータ |
| 1つ以上のシンボルの最新のクォートと取引データ |
| 設定可能なタイムフレームのOHLCVバー履歴 | |
| シンボルのリアルタイムのビッド/アスクスプレッド | |
| マーケットデータプロバイダーの接続状態を確認 | |
レジーム |
| ATR、ADX、RSI、ボリンジャーバンド幅、ハースト指数、VWAP、価格効率を使用して現在のマーケットレジームを分類します |
| シンボルの過去のレジームスナップショットを取得します | |
戦略 |
| 1つ以上の戦略にわたってウォッチリストをシグナルスキャンします |
| 特定の戦略に対して単一のシンボルを評価します | |
| 登録済みのすべての戦略とその現在の状態を一覧表示します | |
リスク / キルスイッチ |
| 提出前に提案された取引に対して13以上のリスクチェックをすべて実行します |
| すべてのキルスイッチの現在の状態を取得します | |
| グローバル、戦略別、またはシンボル別にキルスイッチを有効にします | |
| キルスイッチを無効にします(明示的な理由が必要) | |
| 現在のグロスおよびネットエクスポージャーのサマリー | |
| 設定された制限に対する現在の日次ドローダウン | |
ポートフォリオ |
| 完全なアカウント概要: 評価額、現金、純資産、損益、買付余力 |
| 未実現損益を含むすべてのオープンポジション | |
| 実現損益を含むクローズ済みポジション履歴 | |
執行 |
| ペーパートレーディング注文を提出します(成行、指値、逆指値、逆指値付き指値) |
| IDで保留中または一部約定済みの注文をキャンセルします | |
| 特定の注文の現在の状態を取得します | |
| ステータス、シンボル、または日付範囲でフィルタリングした注文を一覧表示します | |
| エンジン状態とブローカー間の手動リコンサイルをトリガーします | |
ガバナンス |
|
|
| 戦略を昇格させます: Draft → Research → Backtest → Paper → Live | |
| ライブまたはペーパー戦略を即座に停止します | |
| 現在のライフサイクル状態とともにすべての戦略を一覧表示します | |
| 戦略が昇格の基準を満たしているかどうかを確認します | |
監査 |
| 監査イベントIDによる取引判断の完全な人間可読な説明 |
| 直近の監査イベント。シンボルまたは戦略でフィルタリング可能 | |
| 結果を含む完了した取引履歴 | |
| 時間ウィンドウの生の意思決定ログエントリ | |
| 集計統計: 勝率、平均損益、シャープレシオの近似値 | |
| 日付範囲の監査レコードをCSVとしてエクスポート |
パラメータスキーマを含む完全なツールドキュメント: docs/mcp-tools.md
環境変数
エンジン (packages/engine/.env)
変数 | デフォルト | 説明 |
|
|
|
|
| PostgreSQL 接続文字列 |
|
| Redis 接続文字列 |
|
|
|
| (empty) |
|
| (empty) |
|
|
| ライブ取引には |
|
| 口座純資産に対する最大ポジションサイズの割合(5%) |
|
| 1日の損失に対するハードリミット(2%)。違反すると取引が停止します |
|
| 全ポジションにわたる最大グロスエクスポージャー(80%) |
|
| 同時にオープンできる最大ポジション数 |
|
| 個別取引あたりの最大リスク(1%) |
|
| ペーパートレーディングモードにおけるシミュレーションされた約定遅延 |
|
| シミュレーションされたスリッページ(ベーシスポイント) |
|
| ローカル開発時のみ |
| (empty) |
|
| (empty) | 追加のクライアントキーレコードのJSON配列 |
MCP サーバー (packages/mcp/.env)
変数 | デフォルト | 説明 |
|
| 実行中のエンジンサービスのベースURL |
完全な注釈付きリファレンスについては、リポジトリのルートにある .env.example を参照してください。
ワークフロー例(ペーパートレーディング)
# 1. Add symbols
watchlist.add(symbols=["NVDA", "MSFT", "AAPL"], group="tech")
# 2. Classify regime
regime.evaluate(symbol="NVDA", timeframe="1Day")
# 3. Scan for signals
strategy.scan(group="tech", strategy="momentum_v1")
# 4. Validate before submitting
risk.validate_trade(symbol="NVDA", side="buy", qty=10, order_type="market")
# 5. Submit paper order
execution.paper_order(symbol="NVDA", side="buy", qty=10, order_type="market")
# 6. Review portfolio
portfolio.status()
# 7. Inspect the audit trail
audit.recent_events(symbol="NVDA", limit=1)
audit.explain_trade(audit_event_id="evt-...")テストの実行
エンジン(Python)
cd packages/engine
source .venv/bin/activate
pytest tests/ -vMCP サーバー(TypeScript)
cd packages/mcp
pnpm testフルCI(lint + 型チェック + テスト)
# From repo root
make checkリポジトリ構成
sentinel-execution-mcp/
├── packages/
│ ├── engine/ # Python FastAPI trading engine
│ │ ├── sentinel/ # Application source
│ │ ├── tests/ # Pytest test suite
│ │ └── alembic/ # Database migrations
│ └── mcp/ # TypeScript MCP server
│ └── src/
│ └── tools/ # One file per tool category
├── docker/ # Dockerfiles and docker-compose
├── docs/ # Architecture, tool reference, risk model
├── scripts/ # Setup and reset helpers
└── .env.example # Annotated environment variable reference安全に関する免責事項
このソフトウェアは、すべてのコンポーネントを完全に理解している場合を除き、ペーパートレーディングおよび研究専用です。実際のAlpaca認証情報を設定して APP_ENV=live にすると、実際の資金で実際の注文が発行されます。ハードコードされたリスク制限は控えめなデフォルト値です。使用前に、ご自身のリスク許容度に合っていることを確認してください。著者は金銭的損失に対する責任を負いません。
ライセンス
MIT。 LICENSE を参照してください。
This server cannot be installed
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
- AlicenseBqualityDmaintenanceEnables AI assistants like Claude to interact with Paper's trading platform API using natural language, allowing users to manage accounts, portfolios, trades, and access market data through conversational requests.231523MIT
- AlicenseNot gradedqualityDmaintenanceEnables natural language trading operations through Alpaca's Trading API, supporting stocks, options, crypto, portfolio management, and real-time market data access through AI assistants like Claude.MIT
- AlicenseNot gradedqualityDmaintenanceEnables Claude to autonomously trade, analyze, and manage positions on Polymarket prediction markets with 45 comprehensive tools covering market discovery, analysis, trading execution, portfolio management, and real-time monitoring with enterprise-grade safety features.MIT
- AlicenseBqualityAmaintenanceProvides 32 trading analysis tools for AI-powered market analysis, including real-time data, technical indicators, options Greeks, scanners, and Interactive Brokers portfolio management, all accessible via natural language in Claude Desktop.35328MIT
Related MCP Connectors
Trade Robinhood through natural language in Claude Code.
Global stock research, ML forecasts, valuation signals, screeners & portfolio tracking in Claude
Build, backtest, and deploy quantitative trading strategies from your AI agent.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/rohith1125/sentinel-execution-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server