openfolio-ro-mcp
Read-only access to OpenFolio portfolio/broker/grid/log data via MCP — no orders, no writes, no live quotes.
ro_holdings— current broker positions (symbol, quantity, cost, market value, PnL) across Longbridge/Futu/IBKR; answers "现在仓位/持仓怎样".ro_grid— all %-grid positions with performance (webhook URLs stripped); answers "网格赚了没 / 哪些网格开着". Trades/chart for a single grid are HTTP-only.ro_logs— server logs filtered bymodule(grid, scheduler, fetcher…) orsearchsubstring; optionallevelandoffset; default 50 rows, max 100; requires a filter.ro_catalog— discovery of every read-only HTTP endpoint and MCP tool; call when unsure what exists.Auth is handled for you: the MCP process holds
X-API-Key(OPENFOLIO_RO_KEY) and targetshttps://codytang.cnby default.
Note: the README also documents ro_grid_sweeps and ro_mrmc, but the current server schema exposes only the four tools above.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@openfolio-ro-mcpshow my current holdings across all brokers"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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-mcpIf 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_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: financial-trading-risk-aiops-assistant
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.
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 toolsro_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.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden. It discloses the output (JSON of endpoints and MCP tools), the authentication mechanism (X-API-Key) and that the MCP process already has the key, plus the fact that no inputs are required. It does not explicitly state that the operation is read-only, but the tool name and 'read-only' phrasing strongly imply it, and no side effects are expected.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is four short sentences with no fluff. It front-loads the purpose ('Discovery: JSON of...') and immediately follows with the when-to-use, auth, and input requirements. Every sentence earns its place; nothing is redundant or verbose.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple zero-parameter discovery tool with no output schema, the description is fully sufficient. It covers what is returned (path + summary and tool names), when to invoke it, the auth context, and that no inputs are needed. An agent can call it without any further clarification.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has zero parameters and the schema coverage is trivially 100%. The description states 'No inputs,' which directly confirms this, aligning with the baseline of 4 for zero-parameter tools. It adds no confusion and succinctly communicates that no arguments are needed.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: it returns a JSON catalog of all read-only HTTP APIs and the four MCP tools. The verb 'Discovery' and resource 'all OpenFolio read-only HTTP APIs' distinguish it from siblings like ro_holdings or ro_logs, which are specific data tools rather than a meta-catalog.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It provides an explicit when-to-use instruction: 'Call this when unsure which RO endpoint exists.' This is direct and actionable. However, it does not explicitly mention when not to use it or name alternatives, though the siblings are implied as the actual data tools to use once a specific endpoint is identified.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
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.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description bears the full burden of behavioral disclosure. It does disclose two genuine behavioral traits: the webhook_url is stripped from responses, and one grid's trades/chart are HTTP-only. However, it omits other traits an agent might need, such as response shape, ordering, or any pagination/limits — though for a zero-input listing tool this is a moderate, not severe, gap.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three short sentences with no filler; the core purpose is front-loaded first, followed by use-cases and the sibling routing note. Each sentence earns its place, though the mixed-language use-cases (Chinese) add minor friction for English-reading agents.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple no-input listing tool with no output schema, the description covers the essentials: what is returned (positions with performance), the data source, a data-hygiene caveat (webhook_url stripped), and the routing rule for deeper grid detail. It's reasonably complete given the tool's low complexity, though it stops short of describing the return format.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has zero parameters and schema coverage is trivially 100%, so the baseline of 4 applies. The description reinforces this by explicitly stating 'No inputs', which removes any doubt about invocation requirements. Nothing more is needed semantically since there are no parameters to document.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States the resource precisely ('All %-grid positions with performance') and names the data source (GET /api/external/ro/grid), which clearly distinguishes it as the grid-position listing among siblings like ro_holdings and ro_logs. It lacks an explicit verb like 'List' or 'Fetch', but the phrasing strongly implies a read/listing operation, so intent is unambiguous.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Gives concrete trigger use-cases ('Use for 网格赚了没 / 哪些网格开着'), telling the agent exactly when this tool applies. It also states an explicit exclusion with a sibling pointer ('One grid's trades/chart are HTTP-only (see ro_catalog)'), which routes the agent away when it needs trade-level detail. Strong guidance, though it could be slightly more explicit about when NOT to use it in favor of ro_holdings/ro_logs.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
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.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It indicates a GET operation and lists returned fields, implying a read-only data retrieval. However, it does not explicitly state that the operation is non-destructive, mention response structure (e.g., array vs object, grouped by broker), or discuss potential error conditions. The 'Current' qualifier and GET HTTP method provide some transparency, but more explicit disclosure would be better.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence that packs the endpoint, data fields, brokers, usage phrase, and a prerequisite note. It is concise and front-loads the core purpose. While it could be segmented for readability, it is efficient and free of fluff.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity (no inputs), the description is largely complete. It lists the data fields returned and indicates broker scope. It does not specify the exact return format (e.g., JSON array) or any pagination, but for a no-input data retrieval tool, the agent likely has enough to invoke it correctly. The absence of an output schema increases the burden slightly, but the field list mitigates that.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has zero parameters, and the description states 'No inputs.' Since there are no parameters to explain, the baseline of 4 applies. The description correctly notes the absence of inputs, which is all that is needed.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific endpoint (GET /api/external/ro/holdings) and enumerates the returned fields (symbol, quantity, cost, market value, PnL) and brokers (Longbridge/Futu/IBKR). It clearly identifies what the tool does and is distinct from siblings like ro_catalog, ro_grid, ro_logs based on the holdings-specific focus.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It provides an explicit usage trigger: 'Use for "现在仓位/持仓怎样"' (i.e., when users ask about current positions/holdings). It does not mention alternatives or exclusions, but the sibling names (catalog, grid, logs) make the differentiation clear. The note 'No credentials or webhooks' also clarifies prerequisites.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
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.
| Name | Required | Description | Default |
|---|---|---|---|
| level | No | Filter by log level | |
| limit | No | Row cap, default 50 | |
| module | No | Log module, e.g. grid, scheduler, fetcher | |
| offset | No | Pagination offset | |
| search | No | Substring match on message or data JSON |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden for behavioral disclosure. It mentions default row limit (50), max (100), and substring search behavior, but does not cover auth requirements, response format, pagination beyond offset, or explicit read-only confirmation (though 'GET' implies it). This is adequate but not comprehensive.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences with the endpoint and critical constraint front-loaded. Efficient overall, though the Chinese use-case phrase could be considered extraneous for a broader audience, but it does not dilute the core guidance.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description covers calling constraints (filters, limits) but omits output/return format (no output schema), error behavior, and explicit pagination semantics. For a simple GET logs endpoint it is sufficient for making a correct call, but not fully complete for an agent that needs to interpret results.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so baseline is 3. The description adds value by stating the mutual-exclusivity requirement (module OR search) and clarifying search is a substring on message/data, which goes beyond the schema's simple field descriptions.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description specifies a concrete action ('GET') on a clear resource ('logs'), names the endpoint, and gives a specific use case (查某某报错/最近日志). This distinguishes it from siblings (catalog, holdings, grid) which target different data domains.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly states the mandatory condition ('Must pass module or search') and a negative condition ('Do not call with empty filters'). Also provides a usage context ('查某某报错/最近日志'), giving the agent clear guidance on when to invoke this tool.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
4 tool updates
v0.1.0- First observed
ro_catalog - First observed
ro_grid - First observed
ro_holdings - First observed
ro_logs
TDQS
Scored across 4 tools
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.
All tools follow the consistent pattern 'ro_<noun>' (ro_catalog, ro_holdings, ro_grid, ro_logs), making the naming predictable and easy to infer.
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.
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.
Maintenance
Related MCP Connectors
Read-only paper risk evidence and policy-gated committed event research. No real orders.
Read-only access to your VortexIQ store data: audits, KPIs, alerts, Brand DNA, reports, Ask VIQ.
Read-only impersonal market research: portfolio rankings, ticker scores, signals, daily briefs.
Read-only Tudetic product search and vehicle compatibility with safe public pricing.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables access to financial market data including EOD, intraday, fundamentals, news, and more via 75 read-only MCP tools.5MIT
- AlicenseNot gradedqualityAmaintenanceProvides read-only MCP tools for market snapshots, position risk, order reconciliation, and daily report previews with deterministic financial calculations, evidence chains, and audit trails.MIT
- FlicenseNot gradedqualityCmaintenanceEnables read-only access to Addepar portfolio and ownership data for financial reporting, with transparent provenance caveats and compliance-oriented audit logging.-
- FlicenseNot gradedqualityCmaintenanceEnables read-only access to curated Datum data platform marts, including products, resources, consensus questions, and health metrics, through MCP tools such as list_products, list_questions, ask, query, and health.20 npm-