Skip to main content
Glama
openfolio-ro-mcp

openfolio-ro-mcp

by cody1991

openfolio-ro-mcp

Read-only MCP for OpenFolio. It talks to https://codytang.cn/api/external/ro — you do not clone the app.

Need Node 20+ and an API key. Put the key in OPENFOLIO_RO_KEY.

npx -y openfolio-ro-mcp

If your npm registry is a mirror (e.g. Tencent), point npx at the public registry:

npm_config_registry=https://registry.npmjs.org/

Tools: ro_catalog (what exists), ro_holdings (broker positions), ro_grid (%-grids), ro_grid_sweeps (portfolio 30-day param sweep), ro_calendar (FJ economic calendar), ro_fj_news (FJ headlines), ro_logs (server logs), ro_mrmc (watchlist + stored alerts). No orders. No live quote scan.

Cursor / Claude / CodeBuddy

{
  "mcpServers": {
    "openfolio-ro": {
      "command": "npx",
      "args": ["-y", "openfolio-ro-mcp"],
      "env": {
        "OPENFOLIO_RO_KEY": "<key>",
        "OPENFOLIO_ORIGIN": "https://codytang.cn",
        "npm_config_registry": "https://registry.npmjs.org/",
        "NPM_CONFIG_PREFIX": " "
      }
    }
  }
}

NPM_CONFIG_PREFIX (a single space) is a Cursor ENOENT workaround under Cursor.app/.../resources/lib. Omit it if npx already works.

Related MCP server: Psagot remote MCP

Codex

[mcp_servers.openfolio_ro]
command = "npx"
args = ["-y", "openfolio-ro-mcp"]
env = { OPENFOLIO_RO_KEY = "<key>", OPENFOLIO_ORIGIN = "https://codytang.cn", npm_config_registry = "https://registry.npmjs.org/" }

OPENFOLIO_ORIGIN 默认就是 https://codytang.cn,可省略;只有打别的主机时才改。

Sweeps

ro_grid_sweeps is the 组合扫参 table: best 30-day trigger/callback, PnL, still-in-portfolio flag. Token needs grid. Live positions stay on ro_grid.

Calendar / FJ news

ro_calendar reads stored FJ calendar_events (default next 2 days, min_importance 0). Token needs feeds. Prefer this over scraping FinancialJuice.

ro_fj_news reads recent FJ headlines (limit 1–50, default 10). Same feeds capability.

Logs

ro_logs requires module or search. Default 50 rows, max 100.

MRMC

ro_mrmc returns the watchlist and stored DXDX/DBJGXC alerts. OpenFolio scans the pool every 10 minutes during US regular + extended hours and writes mrmc_alerts (weekly TF skipped). There is no live compute. .vix → .VIX.US. Token needs mrmc. Codex should poll this and notify on new rows.

Available Tools

4 tools
ro_catalogOpenFolio RO catalogA

Discovery: JSON of all OpenFolio read-only HTTP APIs (path + summary) and the four MCP tools. Call this when unsure which RO endpoint exists. Auth is X-API-Key on the server; the MCP process already has the key. No inputs.

Inputs: no named parameters.

ro_gridPercent-grid positionsA

All %-grid positions with performance from GET /api/external/ro/grid (webhook_url stripped). Use for 网格赚了没 / 哪些网格开着. One grid's trades/chart are HTTP-only (see ro_catalog). No inputs.

Inputs: no named parameters.

ro_holdingsBroker holdingsA

Current broker holdings from OpenFolio RO GET /api/external/ro/holdings: symbol, quantity, cost, market value, PnL per Longbridge/Futu/IBKR. No credentials or webhooks. Use for "现在仓位/持仓怎样". No inputs.

Inputs: no named parameters.

ro_logsServer logsA

OpenFolio GET /api/external/ro/logs. Must pass module (e.g. grid, scheduler, fetcher) or search (substring in message/data). Default 50 rows, max 100. Use for 查某某报错/最近日志. Do not call with empty filters.

Inputs: level, limit, module, offset, +1 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.2/5.0

    Scored across 4 tools

    Disambiguation5/5

    Each tool targets a distinct resource: catalog for discovery, holdings for positions, grid for grid performance, logs for system logs. There is zero overlap in purpose, so an agent can reliably select the right tool.

    Naming Consistency5/5

    All tools follow the consistent pattern 'ro_<noun>' (ro_catalog, ro_holdings, ro_grid, ro_logs), making the naming predictable and easy to infer.

    Tool Count5/5

    With just 4 tools, the set is tightly scoped to the read-only portfolio data domain. Each tool serves a clear, non-redundant purpose, and the count is well within the typical ideal range.

    Completeness4/5

    The tools cover the core read-only needs: discovery (catalog), holdings, grid positions, and logs. The catalog provides awareness of additional HTTP-only endpoints, so agents can at least know about them. Minor gap: some read-only data (e.g., individual grid trades) is not directly accessible via MCP, but the presence of the catalog mitigates this.

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      C
      maintenance
      Enables read-only access to Addepar portfolio and ownership data for financial reporting, with transparent provenance caveats and compliance-oriented audit logging.
      -
    • F
      license
      Not graded
      quality
      B
      maintenance
      Enables MCP clients to securely access read-only Psagot Trade account and market information through authenticated HTTP endpoints. It exposes only read-only tools, with no trade-submission capabilities.
      -
    • F
      license
      A
      quality
      C
      maintenance
      Enables read-only, bounded quantitative-research workflows with schema compatibility checking and server capability discovery, without exposing market data or live trading.
      1
      -
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables authenticated, read-only access to stored account, options, and monitoring data for bounded research. It also permits pausing/resuming monitoring, with no brokerage write or proxy capabilities.
      MIT