Sentinel Execution Mcp

io.github.rohith1125由 GitHub 帳號 rohith1125 發布v0.1.2更新於 Oct 24, 2026

AI-controlled algorithmic trading engine exposing 40 MCP tools across 9 namespaces.

發布方自己的服務:Execution Market

已驗證STDIO僅桌面金融資料與分析

概覽

AI 產生的概覽

本機 MCP 伺服器,讓助理操作 Sentinel 演算法交易引擎,管理自選清單、行情、風控檢查、模擬下單與稽核查詢

可以做什麼
管理自選清單:新增、移除、列出與分組標的,並修改備註或分組。讀取行情:快照、OHLCV K 線、買賣報價與資料來源健康狀態。判定市場狀態並檢視歷史狀態紀錄。掃描策略訊號、評估單一標的並列出已註冊策略。執行風控檢查、檢視曝險與回撤,並啟用或停用熔斷開關。送出與取消模擬訂單、列出與查詢訂單,並與券商對帳。檢視帳戶狀態、持倉與已平倉歷史,管理策略生命週期,並查詢或匯出稽核紀錄。
適用情境
適合模擬交易研究與實驗,讓助理在風控限額下檢視行情、測試策略並送出模擬訂單。不適合無人監督的實盤交易。
執行需求
以 Node.js 20+ 本機程序執行(npm 套件),透過 HTTP 呼叫 ENGINE_BASE_URL(預設 localhost:8100)上的 Sentinel 引擎。引擎需要 Python 3.12、PostgreSQL 15+ 與 Redis 7+,或使用 Docker。行情預設使用模擬資料來源;真實資料需要 ALPACA_API_KEY 與 ALPACA_API_SECRET。引擎驗證使用 SENTINEL_MASTER_KEY 與 SENTINEL_API_KEYS_JSON。
安裝前請注意
將 APP_ENV 設為 live 並設定真實 Alpaca 憑證,會以真實資金下真實訂單;README 聲明此軟體僅供模擬交易與研究。工具會寫入與改變狀態:送出與取消訂單、切換熔斷開關、推進或暫停策略、修改自選清單。引擎驗證預設開啟,僅可在本機開發時關閉。風控限額為預設值,應核對自己可承受的風險。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Sentinel Execution Mcp,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

Sentinel Execution MCP

[CI] [License: MIT]

A production-grade algorithmic trading control plane exposed as an MCP server — so Claude can manage watchlists, classify market regimes, validate risk, and submit paper orders through natural language.


What It Is

Sentinel is a two-package monorepo:

PackageLanguageRole
packages/enginePython 3.12 / FastAPIAll trading logic: risk checks, regime classification, order lifecycle, audit journal, strategy governance
packages/mcpTypeScript / Node 20Thin MCP server that routes 40+ tools to the engine via HTTP. Zero trading logic lives here.

Claude (or any MCP-compatible agent) talks to the MCP server. The MCP server talks to the engine. The engine owns the database and cache.


Architecture

  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)

If the engine is unavailable, every MCP tool call returns an error immediately. There is no fallback or partial execution.


Quick Start (Docker — recommended)

The fastest way to get running. Requires Docker and Node.js 20+.

bash
# 1. Clone and configuregit clone https://github.com/rohith1125/sentinel-execution-mcp.gitcd sentinel-execution-mcpcp .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/mcpnpm installnpm run build

Then add Sentinel to Claude Desktop (see Connect Claude Desktop below) and restart Claude. That's it — all 40 tools are live.


Manual Setup (no Docker)

Use this if you have Postgres and Redis already running locally.

Prerequisites:

DependencyMinimum versionNotes
Python3.12Engine runtime — check with python3 --version
Node.js20MCP server runtime
PostgreSQL15+Primary data store
Redis7+Kill switch and cache

1. Clone and configure

bash
git clone https://github.com/rohith1125/sentinel-execution-mcp.gitcd sentinel-execution-mcpcp .env.example .env# Default values work for local paper-trading development — no edits required

2. Set up the engine

bash
cd packages/enginepython3.12 -m venv .venvsource .venv/bin/activate        # Windows: .venv\Scripts\activatepip install -e ".[dev]"

3. Run database migrations

bash
# From packages/engine with the venv activealembic upgrade head

4. Start the engine

bash
uvicorn sentinel.api:app --reload --port 8100

Verify it is running:

bash
curl http://localhost:8100/health# {"status": "ok", "env": "paper"}

5. Build and start the MCP server

Open a second terminal:

bash
cd packages/mcpnpm installnpm run buildnpm run dev     # stdio transport — for direct Claude Desktop integration

Connect Claude Desktop

Add the following to your Claude Desktop configuration file.

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

Get the correct path by running this in your terminal:

bash
echo "$(pwd)/packages/mcp/dist/index.js"

Then paste it into the config:

json
{  "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"      }    }  }}

Restart Claude Desktop after saving. You should see a hammer icon (🔨) in the chat input — click it to confirm Sentinel's 40 tools are loaded.


MCP Tools Reference

Sentinel exposes 40+ tools across nine categories. The MCP server name is sentinel.

CategoryToolDescription
Watchlistwatchlist.addAdd symbols to the trading watchlist, optionally assigned to a group
watchlist.removeRemove symbols; they will no longer appear in strategy scans
watchlist.listList active symbols, optionally filtered by group
watchlist.getGet details for a single symbol
watchlist.groupsList all named watchlist groups
watchlist.updateUpdate notes or group assignment for a symbol
Market Datamarket.snapshotLatest quote and trade data for one or more symbols
market.barsOHLCV bar history with configurable timeframe
market.quoteReal-time bid/ask spread for a symbol
market.healthCheck market data provider connectivity
Regimeregime.evaluateClassify current market regime using ATR, ADX, RSI, Bollinger Width, Hurst Exponent, VWAP, and Price Efficiency
regime.historyRetrieve historical regime snapshots for a symbol
Strategystrategy.scanScan the watchlist for signals across one or more strategies
strategy.signalEvaluate a single symbol against a specific strategy
strategy.listList all registered strategies and their current state
Risk / Kill Switchrisk.validate_tradeRun all 13+ risk checks against a proposed trade before submission
risk.kill_switch_statusGet the current state of all kill switches
risk.kill_switch_enableEnable a kill switch globally, per-strategy, or per-symbol
risk.kill_switch_disableDisable a kill switch (requires explicit reason)
risk.exposureCurrent gross and net exposure summary
risk.drawdownCurrent daily drawdown against configured limits
Portfolioportfolio.statusFull account overview: value, cash, equity, P&L, buying power
portfolio.positionsAll open positions with unrealized P&L
portfolio.historyClosed position history with realized P&L
Executionexecution.paper_orderSubmit a paper trading order (market, limit, stop, stop-limit)
execution.cancel_orderCancel a pending or partially filled order by ID
execution.get_orderGet the current state of a specific order
execution.list_ordersList orders filtered by status, symbol, or date range
execution.reconcileTrigger a manual reconciliation between engine state and broker
Governancegovernance.create_strategyRegister a new strategy in draft state
governance.promote_strategyAdvance a strategy: Draft → Research → Backtest → Paper → Live
governance.suspend_strategySuspend a live or paper strategy immediately
governance.list_strategiesList all strategies with their current lifecycle state
governance.evaluate_promotionCheck whether a strategy meets criteria for promotion
Auditaudit.explain_tradeFull human-readable explanation for a trade decision by audit event ID
audit.recent_eventsMost recent audit events, filterable by symbol or strategy
audit.trade_historyCompleted trade history with outcomes
audit.decision_logRaw decision log entries for a time window
audit.statsAggregate statistics: win rate, average P&L, Sharpe proxy
audit.exportExport audit records as CSV for a date range

Full tool documentation with parameter schemas: docs/mcp-tools.md


Environment Variables

Engine (packages/engine/.env)

VariableDefaultDescription
APP_ENVpaperdevelopment, paper, or live
DATABASE_URLpostgresql+asyncpg://sentinel:sentinel@localhost:5432/sentinelPostgreSQL connection string
REDIS_URLredis://localhost:6379/0Redis connection string
MARKET_DATA_PROVIDERmockmock (no credentials needed) or alpaca
ALPACA_API_KEY(empty)Required when MARKET_DATA_PROVIDER=alpaca
ALPACA_API_SECRET(empty)Required when MARKET_DATA_PROVIDER=alpaca
ALPACA_BASE_URLhttps://paper-api.alpaca.marketsUse https://api.alpaca.markets for live trading
MAX_POSITION_PCT0.05Maximum position size as a fraction of account equity (5%)
MAX_DAILY_DRAWDOWN_PCT0.02Hard daily loss limit (2%); trading halts if breached
MAX_GROSS_EXPOSURE_PCT0.80Maximum gross exposure across all positions (80%)
MAX_CONCURRENT_POSITIONS10Maximum number of simultaneously open positions
MAX_TRADE_RISK_PCT0.01Maximum risk per individual trade (1%)
PAPER_FILL_LATENCY_MS50Simulated fill latency in paper trading mode
SLIPPAGE_BPS5Simulated slippage in basis points
SENTINEL_AUTH_ENABLEDtrueSet to false for local development only
SENTINEL_MASTER_KEY(empty)Generate with python -m sentinel.auth.cli generate --name master --scopes admin
SENTINEL_API_KEYS_JSON(empty)JSON array of additional client key records

MCP Server (packages/mcp/.env)

VariableDefaultDescription
ENGINE_BASE_URLhttp://localhost:8100Base URL of the running engine service

See .env.example at the repo root for the complete annotated reference.


Example Workflow (Paper Trading)

# 1. Add symbolswatchlist.add(symbols=["NVDA", "MSFT", "AAPL"], group="tech")
# 2. Classify regimeregime.evaluate(symbol="NVDA", timeframe="1Day")
# 3. Scan for signalsstrategy.scan(group="tech", strategy="momentum_v1")
# 4. Validate before submittingrisk.validate_trade(symbol="NVDA", side="buy", qty=10, order_type="market")
# 5. Submit paper orderexecution.paper_order(symbol="NVDA", side="buy", qty=10, order_type="market")
# 6. Review portfolioportfolio.status()
# 7. Inspect the audit trailaudit.recent_events(symbol="NVDA", limit=1)audit.explain_trade(audit_event_id="evt-...")

Running Tests

Engine (Python)

bash
cd packages/enginesource .venv/bin/activatepytest tests/ -v

MCP Server (TypeScript)

bash
cd packages/mcppnpm test

Full CI (lint + type check + test)

bash
# From repo rootmake check

Repository Structure

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

Safety Disclaimer

This software is for paper trading and research only unless you fully understand every component. Setting APP_ENV=live with real Alpaca credentials will place real orders with real money. The hard-coded risk limits are conservative defaults — verify they match your own risk tolerance before use. The authors accept no liability for financial losses.


License

MIT. See LICENSE.

來源:README.md,提交 2f8bc9f

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.1.2最新Sep 16, 2026

評分

已滿足適用檢查項的 40%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

    請在儲存庫或註冊中心條目中宣告授權條款。

其他 Execution 整合