Canli Capital

io.github.arhancanliv0.3.0更新于 Oct 11, 2026

306 finance tools (quant, validation, SEC filings, markets, options, paper trading) behind 3 tools.

已验证STDIO仅桌面DatabasesData & AnalyticsFinance

概览

AI 生成的概览

把 306 个金融工具(量化分析、SEC 基本面、市场数据、回测与 Alpaca 模拟交易)整合在三个搜索与调用工具之后。

功能
一个本地 MCP 服务器,把七个独立发布的金融工具包加载进同一进程,并通过三个工具对外提供:find_tool 用于搜索,describe_tool 用于查看单个工具的 schema,run_tool 用于调用任意工具。工具包涵盖量化金融(业绩与风险、期权、固定收益、投资组合、计量经济、指标、策略组合库)、回测验证(通缩夏普比率、过拟合与数据窥探检验、泄漏与安慰剂检验)、时点化 SEC 基本面、市场与宏观数据、因子回测,以及带交易前检查的 Alpaca 模拟交易。还提供 company_brief、earnings_preview、macro_snapshot、ownership、backtest_check 五个提示工作流。
适用场景
适合需要在一个地方获得广泛金融分析能力的助手:量化与风险计算、SEC 申报与基本面、市场、宏观与持股数据、策略回测与验证,或模拟盘交易。也适合不想分别安装七个服务器并承担其上下文开销的用户。
运行要求
通过 stdio 在本地运行,通常使用 npx canli-mcp,因此需要 Node.js。默认工具包无需账号。可选环境变量:CANLI_PACKS 选择启用的工具包,CANLI_OFFLINE=1 只保留 quant 与 validation,CANLI_HOME 指定模拟交易工具包的文件位置,ALPACA_PAPER_KEY_ID 与 ALPACA_PAPER_SECRET_KEY 用于启用模拟交易。fundamentals、research、backtest、markets 与 paper 工具包需要网络访问。
安装前请注意
paper 工具包需要 Alpaca 模拟盘凭据 ALPACA_PAPER_KEY_ID 与 ALPACA_PAPER_SECRET_KEY,实盘密钥会被拒绝。发送订单的工具不会在批量调用中执行,必须先预览再单独发送。多个工具包会向第三方发起请求:fundamentals 与 research 访问 canlicapital.com,markets 访问 SEC EDGAR、财政部、FRED、FINRA、CFTC、美联储、OECD、世界银行与 Cboe 等公开来源,价格数据可能经 Yahoo Finance,或在使用密钥时经 Alpaca 或 Tiingo。本地缓存与账本会写入缓存目录和 CANLI_HOME。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Canli Capital,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

canli-mcp

Every Canli Capital MCP server in one: 306 finance tools for Claude, Cursor or any MCP client.

  • Quant finance: 235 tools covering performance and risk, options and exotics, fixed income, portfolios, econometrics, indicators, and a library of 399 strategy sleeves with multiple-testing corrections.
  • Backtest validation: deflated Sharpe, overfitting probability, data-snooping tests, leakage checks and placebo tests, run on your machine.
  • Point-in-time SEC fundamentals.
  • Markets from the sources, no key: screens of every US-listed company, company reports, event studies, SEC filings and their sections, insider trades, 13F and 5% holders, fund and ETF portfolios, index members, short interest, off-exchange volume, fails to deliver, futures positioning, executive pay, revenue by segment, options chains and volatility surfaces, the VIX futures curve, Fed decisions and projections, the economic calendar, Treasury yields and auctions, the federal debt, FRED, World Bank and OECD data, and prices for stocks, currencies, futures, indices and crypto.
  • Canli Capital's open research record.
  • Factor backtests without lookahead.
  • Alpaca paper trading behind pre-trade checks.

Each pack is a published, separately tested server. This package loads them into one process and puts three tools in front of them.

bash
npx -y canli-mcp

Claude Code:

bash
claude mcp add canli -- npx -y canli-mcp

Claude Desktop, Cursor or any MCP client:

json
{ "mcpServers": { "canli": { "command": "npx", "args": ["-y", "canli-mcp"] } } }

Why one server is cheaper and faster

Measured on Node 24 on 2026-10-11 with bench/context.py (o200k tokens of the tool objects a client receives, plus the server instructions; start-up is the median time from launch to the tool list):

seven servers separatelycanli-mcp
tool list and instructions sent with every request34,508 tokens1,109 tokens
processes71
start-up63-90 ms each73 ms
  • Three tools in context. The model searches with find_tool, reads one schema with describe_tool, and calls anything with run_tool. On 48 everyday requests written after the last change to the search and never tuned on, the right tool comes first 46 times and is in the top three 47 times (0.2.1: 25 and 29). test/search.test.mjs holds these and 135 more.
  • Nothing loads until it is used. Start-up reads a prebuilt index of all 306 tools; a pack's code loads the first time one of its tools runs.
  • Data by file, not by pasting. Any argument can be {"$file": "prices.csv", "column": "close"} (or "columns": ["SPY", "TLT"] or "all"). For 1,000 prices that is 23 tokens instead of 4,893, and the model cannot drop a number while copying.
  • Several calls in one round trip. run_tool takes calls (up to 25). A call can use an earlier call's output with {"$result": 0, "path": "rows", "pick": [0, 1]}, so intermediate data never passes through the model, and return: "last" sends back only the final answer. Labeling 1,000 prices and then weighting the labels took 72 tokens of tool input this way, against 31,917 to read the labels and type them into the next call.
  • Shorter numbers when they are enough. digits: 5 rounds every result.

Workflows as prompts

Clients that show MCP prompts (Claude Desktop and Claude Code list them as slash commands) offer five workflows. Each one runs a single batched run_tool call and says what to write from the results:

promptasks forruns
company_briefa tickercompany report, 8-K news with press-release headlines, next earnings date, insider trades, short interest, options-implied move
earnings_previewa tickerearnings date and timing, the move options price in, past reactions to results (event study), recent results headlines, revenue by segment
macro_snapshotnothingthe Fed's latest decision and projections, the next two weeks' key releases, CPI, core PCE, unemployment, the Treasury curve, the VIX futures curve
ownershipa ticker5% holders and activists, insider buying and selling, short interest
backtest_checka returns filedeflated Sharpe for the variants tried, the track record needed, then leakage and placebo plans

A prompt is offered only when every tool it names is in an enabled pack (CANLI_PACKS, CANLI_OFFLINE), and test/prompts.test.mjs checks each call against its tool's own schema. Prompts add nothing to a request's context until one is chosen.

An agent, end to end

The same model (gpt-5.4-mini) answered seven tasks twice each:

  • the Sharpe ratio, drawdown and value at risk of a pasted price file;
  • a deflated Sharpe from summary numbers;
  • a Black-Scholes price;
  • a 399-sleeve tournament on three assets;
  • Apple's first-reported 2019 EPS.

Answers were graded against the tools' own values (bench/agent-eval.mjs; results in bench/agent-eval-2026-10-08.json):

correcttokens per taskturnsseconds
the six servers, installed separately11 of 1463,9844.122.6
canli-mcp, first version10 of 1443,0435.89.5
canli-mcp, after fixing what the runs showed14 of 1427,2674.27.2

The fixes came from reading the runs:

  • The model narrowed find_tool to one pack and missed the tool that took its inputs, so the pack filter is gone.
  • It passed made-up two-point series to a tool that wanted returns, so the quant deflated and probabilistic Sharpe tools now take summary numbers and refuse too little data.
  • It put select and return inside a tool's arguments, so run_tool moves them out.
  • It asked select for fields that do not exist, so the reply now lists the fields that do.

This is one small model with two runs per task, so read the differences as large or small, not as exact rates.

Privacy

Everything runs on your machine. canli://privacy states, per pack, what leaves it:

packnetworkdisk
quantnonenone
validationnone (private local mode)reads a returns file only when you pass its path
fundamentalspublic SEC data from canlicapital.com (the company and measure you ask for)caches that public data in ~/.cache/canli-fundamentals (CANLI_CACHE_DIR="" keeps nothing)
researchpublic research pages from canlicapital.com (your search words)none
backtestpublic SEC data, as fundamentals; your prices and signals stay localyour trial ledgers in ~/.canli/ledgers
marketsSEC EDGAR and the SEC's adviser database, the US Treasury, FRED, FINRA, the CFTC, the Federal Reserve, BLS, BEA, the Census Bureau, the OECD, the World Bank and Cboe directly (the company, form, dates, search words or series you ask for); Yahoo Finance's public chart data for prices, or for US stocks Alpaca or Tiingo with your keynone
paperAlpaca's paper API only, with your paper keysa hash-chained order log in ~/.canli

CANLI_OFFLINE=1 enables only the packs with no network, and no other pack's code is even loaded. test/privacy.test.mjs runs the server that way with fetch and every network module made to throw, and the quant and validation tools still answer. The server itself has no network, write or logging code (also tested). Opt-in receipts (receipt: true) carry hashes, never data.

Configuration

variableeffect
CANLI_PACKSPacks to enable: quant,validation,fundamentals,research,backtest,markets,paper or all. Default: all but paper.
CANLI_OFFLINE1 keeps only quant and validation.
ALPACA_PAPER_KEY_ID, ALPACA_PAPER_SECRET_KEYPaper keys (starting PK); setting them enables the paper pack. Live keys are refused.
CANLI_HOMEWhere the paper pack keeps its limits file, kill switch and order log; default ~/.canli.

Order-sending tools never run inside a batch: preview first, then send on its own.

Packs and what each is checked against

packpackagetoolstested against
quantcanli-quant-mcp235QuantLib, statsmodels, arch, TA-Lib, scipy, pandas: 461 reference cases
validationcanli-validation-mcp17the Null Zoo benchmark of 160,000 simulated searches
fundamentalscanli-fundamentals-mcp7SEC XBRL filings
researchcanli-research-mcp6the published research record and its hash chain
backtestcanli-backtest-mcp3point-in-time SEC data
marketscanli-markets-mcp34replayed responses from the SEC, Treasury, FRED, FINRA, CFTC, the Fed, OECD, World Bank and Cboe: a 13F's total equals its cover page
papercanli-paper-trading-mcp4a simulated Alpaca paper API

Two tools differ from their standalone servers. Validation's stress_test is strategy_stress_test here, because the quant pack has a portfolio stress_test. Validation's get_key and service_status are left out, because validation runs locally here. canli://packs lists both.

Development

bash
npm ci && npm testnpm run build-index        # after updating a pack; a test fails if the index and the packs differnode bench/robustness.mjs  # every tool, offline, with hostile arguments: crashes and leaks reported

MIT licence.

来源:mcp-canli/README.md,提交 d2d0c99

工具

0
工具元数据尚未被收录。

版本历史

1
  1. v0.3.0最新Oct 11, 2026