
xbbg MCP
io.github.underloam由 GitHub 账号 underloam 发布v1.8.1更新于 Nov 4, 2026
Local Bloomberg tools for xbbg users.
概览
本地 stdio MCP 服务器,让助手通过 xbbg-async 获取彭博的参考数据、历史数据、盘中数据和 BQL 查询结果。
- 可以做什么
- 获取证券的参考数据、历史数据、批量数据和盘中 K 线
- 执行彭博查询语言(BQL)查询和彭博搜索
- 查询字段元数据,并检查某项彭博服务的权限 ID
- 把综合股票代码或 ISIN 解析到拍卖场所,并读取拍卖与失衡快照
- 检查每只证券的延迟或实时状态,可选做身份权限校验
- 通过通用原始请求访问自定义的彭博服务与操作
- 适用场景
- 适合已有彭博终端或获授权的彭博 API 会话的编码助手和分析人员,希望助手在本机直接查询行情数据、字段、权限和拍卖场所,而不必手工复制结果。
- 运行要求
- 以本地进程运行(MCPB 包或发布版二进制),支持 macOS arm64、Linux amd64 和 Windows amd64,仅限桌面端。需要本地自行提供且获授权的彭博运行时,或官方 Python blpapi 包,通过 XBBG_MCP_LIB_DIR、BLPAPI_LIB_DIR、BLPAPI_ROOT 或内置 SDK 目录定位。连接彭博 API 主机与端口(XBBG_MCP_HOST、XBBG_MCP_PORT,默认 localhost:8194),认证方式由 XBBG_MCP_AUTH_METHOD 指定;部分方式还需 XBBG_MCP_TOKEN、XBBG_MCP_USER_ID 等设置。
安装
在 SourceWeft 中
- 打开 控制台中的 xbbg MCP,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
xbbg-mcp
Last updated: 2026-10-20.
Stdio MCP server for Bloomberg request/response workflows backed by xbbg-async.
This binary is intended for coding agents such as Claude Code and OpenCode that can launch a local MCP server process and call tools over stdio.
What it exposes
The current server exposes request/response tools only:
bdp- reference databdh- historical databds- bulk databdib- intraday barsbql- Bloomberg Query Languagebsrch- Bloomberg searchbflds- field metadata lookupresolve_venues- resolve composite equity and preferred inputs to validated auction venuesauction_snapshot- primary-venue auction and imbalance reference datacheck_entitlements- entitlement-ID check for a Bloomberg servicedelay_status- per-ticker delayed/real-time status for this session, with an optional feed-EID entitlement checkrequest- generic raw/custom request path
Responses are returned as bounded structured JSON with Arrow schema metadata so an agent can inspect the shape without receiving an unbounded payload. Limits cover rows, cells, strings, metadata inspection/retention, and the final serialized payload; a row limit alone is not the output bound.
Auction venues and snapshots
resolve_venues routes composite equity tickers or ISINs to their primary exchange listing and preferreds to venue pricing sources. Explicit exchange listings are respected. The recipe keeps one row per input, including duplicates and input order, with status (resolved, unresolved, unsupported, or mismatch) and error. The result also includes the lookup, security kind, equity composite ticker, venue topic, venue FIGI, routing method, exchange, MIC, and pricing source. Original input strings are retained in security; lookups are trimmed, and bare valid ISINs become /isin/<ISIN>.
pcs_overrides is optional on both tools. Its keys are preferred exchange names, trimmed, uppercased, and collapsed to single internal spaces; values are trimmed and uppercased pricing-source codes. Overrides take precedence over the built-in mapping; a blank or missing-value code such as N.A. disables the mapping for that exchange. Conflicting spellings of the same normalized exchange key are rejected. Every route is validated before it can be reported as resolved; an unknown preferred exchange needs a pcs_overrides entry.
auction_snapshot first resolves the venue, then reads the requested fields using Bloomberg reference data on that venue. Failed or mismatched inputs retain their status/error row with null data fields. Results contain input_order, security, venue_topic, status, error, then the selected typed fields.
The optional groups list accepts imbalance, indicative, state, halts, results, composite, quotes, and default (trimmed, case-insensitive). Groups expand in the supplied order, followed by the explicit fields in their supplied order; field names are trimmed and uppercased and duplicates are removed, keeping their first occurrence. Unknown groups are invalid parameters. If the combined selection is empty, the default auction group is used: imbalance, indicative, state, halts, and results, in that order. Explicit fields or groups replace that implicit default; include default in groups to extend it.
Both tools require at least one nonblank security (there is no count limit; results are bounded by the output limits) and accept at most 128 pricing-source overrides. auction_snapshot accepts up to eight group entries, 256 explicit fields, and 256 unique fields after expansion. Every input string, including override keys and values, is limited to 1,024 UTF-8 bytes; blank securities, fields, group names, or override keys are rejected rather than silently dropped. Blank override values are allowed to disable a mapping.
Timing and delayedness: time-of-day fields are terminal-local, not exchange-local. Bloomberg can serve delayed values without marking them in the rows. The delayed flag for this session is available from delay_status, from on_delayed on bdp, bdh, bdib, and request, or by requesting IS_DELAYED_STREAM and EXCHANGE_DELAY with bdp; see Delayed data.
Temporal cells use the existing Arrow JSON string conventions: Date32 is YYYY-MM-DD, and Time64 is HH:MM:SS[.fraction] without an invented date or timezone. Timestamps include both date and time; UTC ends in Z, other declared timezones include their offset, and timestamps without a timezone have no suffix. Fractional seconds are preserved without rounding, including the microseconds in auction snapshots. Null cells remain JSON null. The same serialization applies to typed request columns such as value_time and value_ts; the Arrow schema retains the original temporal type, unit, and timezone.
Both tools use the same bounded JSON envelope with Arrow schema metadata as bdp. Result limits can omit rows or fields; always inspect the truncation flags and counts before treating the returned rows as the complete input set.
Entitlement IDs
Set return_eids: true only on routes backed by Bloomberg operations that support returnEids:
The dedicated bdp, bds, bdh, and bdib tools advertise return_eids directly. Use the generic request tool for intraday ticks:
When retained within the metadata and output budgets, results expose the EID map as structured JSON at metadata["xbbg.eid_data"], alongside schema, row_count, returned_rows, truncated, and rows. truncated is an object of flags, not a single boolean. Consult metadata_counts["xbbg.eid_data"] when present for total/returned EID and security counts, valid, and counts_complete; an unknown total is null, not zero. truncation_counts.omitted_priority_metadata identifies priority metadata that could not be retained. Pass the collected IDs to the read-only check_entitlements tool; service defaults to //blp/refdata:
The check result includes service, eids, entitled, and failed_eids, plus total, returned, and omitted counts for both ID lists and per-component truncated flags. Failed IDs receive the shared cell/byte allowance before the echoed input IDs. A shortened list must not be interpreted as the full entitlement result.
Delayed data
Bloomberg serves delayed data without marking the rows: a delayed bdp snapshot, a delayed "today" row from bdh, and intraday bars or ticks that stop at the current time minus the delay. IS_DELAYED_STREAM is the delayed flag for the requesting session. EXCHANGE_DELAY is the exchange's standard delay as text, such as 15 Minutes, and is set for real-time securities too.
delay_status reads both fields, EXCH_CODE, and the feed EIDs in one reference-data request and returns one row per unique ticker, in input order:
check_identity defaults to false, which works on any Desktop Terminal. Setting it to true also runs one entitlement check of all returned feed EIDs against //blp/mktdata and maps the failures back to each ticker. That needs an authorized identity: SAPI/B-PIPE authorization configured through XBBG_MCP_AUTH_METHOD (see Runtime environment), or a Desktop API user enrolled in EMRS. Otherwise the call fails.
on_delayed runs the same check alongside a data request on bdp, bdh, bdib, and the generic request tool (ReferenceDataRequest, HistoricalDataRequest, IntradayBarRequest, or IntradayTickRequest). bds does not offer it, and the generic request tool rejects it as an invalid parameter for any other operation, including BDS/bulk.
bdpadds whichever ofIS_DELAYED_STREAMandEXCHANGE_DELAYyou did not request to the same request; the added fields are not returned as rows.bdh,bdib, and intraday-tick requests send one extra small reference-data request, only when the window reaches the last 24 hours:end_dateon or after yesterday (UTC), orend_datetimeno earlier than 24 hours ago. Older windows skip the check and add no metadata.
MCP results have no warnings channel, so warn and ignore behave the same here: inspect the metadata. It is keyed by ticker; tickers whose flag Bloomberg did not return (an invalid security, or a field that does not apply) are absent:
xbbg.delayed is priority metadata: metadata_counts["xbbg.delayed"] reports returned and omitted properties, and truncation_counts.omitted_priority_metadata lists it if it could not be retained.
Install from GitHub Releases
For macOS arm64 and Linux amd64, install the latest wrapper + binary pair with:
To install a specific release:
The installer places two files in ~/.local/bin/ by default:
xbbg-mcp- launcher wrapperxbbg-mcp-real- compiled binary
GitHub release assets include only the launcher wrapper and compiled xbbg binary. They do not include Bloomberg SDK files or the Bloomberg runtime. You must provide those locally from a source you are authorized to use under your Bloomberg agreements and entitlements.
GitHub Release tar/zip assets remain the raw binary channel. The MCPB asset is the directory and one-click local connector channel for MCPB-aware clients and registries.
The wrapper locates the Bloomberg runtime in this order:
XBBG_MCP_LIB_DIRBLPAPI_LIB_DIRBLPAPI_ROOT- locally staged authorized SDK under
vendor/blpapi-sdk/ - the official Python
blpapipackage
If you install Bloomberg's Python package, the wrapper can usually run without any extra shell configuration:
Windows release assets are attached as .zip files, but the convenience installer currently targets macOS/Linux only.
Install MCPB
Claude Desktop and MCPB-aware registries can use the xbbg-mcp-v<VERSION>.mcpb asset attached to GitHub Releases. The MCPB currently supports macOS arm64, Linux amd64, and Windows amd64. The raw platform tar/zip assets remain available for manual installs and troubleshooting.
The MCPB does not include Bloomberg SDK files, Bloomberg runtime libraries, credentials, or market data. Configure XBBG_MCP_LIB_DIR, BLPAPI_LIB_DIR, BLPAPI_ROOT, or install Bloomberg's official Python blpapi package so the launcher can find the authorized Bloomberg runtime locally.
On Windows the MCPB PowerShell launcher follows the same order, then also scans PATH (a Bloomberg Terminal install puts C:\blp\DAPI there) before falling back to the Python package. xbbg-mcp.exe is 64-bit and needs blpapi3_64.dll; a runtime whose version cannot be read, or which is too old to export the entry points the binary imports, is skipped with a diagnostic. The minimum, currently Bloomberg API 3.20.0, is derived from imported symbol versions when the bundle is packaged; packaging fails rather than silently disabling the gate if derivation is impossible. The launcher makes the validated directory both the child's working directory and the first PATH entry, and refuses a higher-priority DLL beside the executable or in a Windows system directory that would shadow it. It starts xbbg-mcp.exe with inherited standard handles, so the MCP host talks to the binary directly rather than through PowerShell. Loader-status diagnostics name the selected Bloomberg runtime without claiming that it caused every direct or transitive loader failure.
Troubleshooting
The server writes only to stderr, which MCP hosts such as Claude Desktop capture in their server logs. When stdin is closed by the host it prints xbbg-mcp: stdin closed; shutting down; a failed stdin read, reader-thread failure, or abnormal service stop returns a nonzero process status. Diagnostic writes are best-effort, so a closed stderr handle cannot terminate the stdin reader or turn a failure into clean EOF. Set RUST_LOG=info (or debug) to also see the engine's and the MCP library's own log lines.
Build from source
Claude Code
OpenCode
Directory and registry publishing
Official MCP Registry: publish the generated server.json after the release contains the .mcpb asset.
GitHub MCP Registry: verify the server appears after official registry ingestion.
Claude Connectors Directory: submit the MCPB as a desktop extension; remote connector submission is not the default for Bloomberg-local workflows.
Smithery: publish the MCPB bundle.
Glama: verify indexing after official registry publication; if automated sandbox build cannot run without Bloomberg runtime, keep the listing metadata-focused.
PulseMCP: wait for official registry ingestion or use the Pulse submit page.
MCP.so: submit the GitHub repo/release after canonical registry metadata is live.
Runtime environment
xbbg-mcp accepts the same engine-oriented connection settings as the Rust core, with MCP-prefixed names taking precedence where available.
Common settings:
XBBG_MCP_HOST/XBBG_HOSTXBBG_MCP_PORT/XBBG_PORTXBBG_MCP_AUTH_METHOD/XBBG_AUTH_METHODXBBG_MCP_APP_NAMEXBBG_MCP_BQL_APP_NAME– optional shared-engine BQL client-context default; independent of session authenticationXBBG_MCP_DIR_PROPERTYXBBG_MCP_USER_IDXBBG_MCP_IP_ADDRESSXBBG_MCP_TOKENXBBG_MCP_REQUEST_POOL_SIZEXBBG_MCP_VALIDATION_MODE/XBBG_VALIDATION_MODE–disabled(default),lenient,strictXBBG_MCP_SDK_LOG_LEVEL/XBBG_SDK_LOG_LEVEL–off(default),fatal,error,warn,info,debug,traceXBBG_MCP_OVERFLOW_POLICY/XBBG_OVERFLOW_POLICY–drop_newest(default),blockXBBG_MCP_KEY_COLUMN/XBBG_KEY_COLUMN–ticker(default, deprecated),security; names the result column holding each row's security.tickercollides with Bloomberg'sTICKERfield once identifiers are case-folded, andsecuritybecomes the default in the next major release.
Supported auth methods:
noneuserappuserappdirdirectorymanualtoken
BQL client context
The shared Rust engine owns the optional BQL application-name default.
XBBG_MCP_BQL_APP_NAME sets EngineConfig.bql_app_name for every BQL sendQuery
dispatched by this server, including the generic request tool.
The bql tool's per-call app_name and explicit clientContext.appName elements
or kwargs override the engine default. If no value is supplied, the app name is
omitted and the current Bloomberg default is unchanged; no name is selected
automatically.
Use an application name authorized for your Bloomberg environment. This setting
does not grant BQL entitlement or change session authentication.
XBBG_MCP_APP_NAME remains an authentication setting, not a BQL client-context
setting. An explicitly blank per-call app_name is rejected rather than falling
back to the server's application name.
The SDK's application-mode authentication and application identity key are separate session settings. The BQL default is a request element and never sets either SDK authentication or session-identification options.
The generic request tool also accepts clientContext.appName as a dotted key
in its string-valued elements map; nested objects are not accepted there.
Fatal BQL response exceptions are retained in the MCP error message with the
service and operation context. Messages still respect the string and serialized
output budgets below; shortened errors include message_truncated: true.
Result budgets
These MCP-only environment settings use integer values; unset settings use the defaults below. Values below the minimum or invalid integers cause configuration to fail rather than silently disabling a limit.
The final-byte limit includes JSON escaping and envelope overhead; it is not just a sum of raw string lengths and does not describe the surrounding MCP transport framing. The limits are ceilings: metadata and schema consume space before rows, so a payload may return fewer rows or columns than their individual limits allow. The cell allowance applies across returned rows and columns, not separately to every row. Even zero-row batches have bounded schema output.
String values are shortened on Unicode boundaries. Column names and metadata keys are identities: oversized names are omitted rather than shortened, and duplicate column names are not silently overwritten in JSON rows. Nested Arrow values are represented by a bounded omission marker instead of recursively formatting an unbounded cell; omission counts distinguish this from an ordinary scalar value. Integer values outside JavaScript's safe range are returned as strings rather than rounded numbers.
Metadata inspection is bounded before JSON parsing. Oversized entries and generic metadata that cannot be inspected within the aggregate allowance may be omitted without a full scan. xbbg.security_errors, xbbg.field_errors, xbbg.field_exceptions, xbbg.delayed, and xbbg.eid_data are prioritized before generic metadata and rows. Diagnostic records are retained with their structure rather than arbitrary property fragments, but string contents and the number of records remain bounded; even priority metadata can be omitted when it cannot fit.
Compact field-exception dictionaries are validated before projection and emitted as bounded expanded records, never as partially clipped dictionary references. bflds retains refused ids in xbbg.field_errors even when its data table has no successful rows. See the response diagnostic contract.
Output diagnostics and errors
Result envelopes are extensible. For example, a one-row result can include the following excerpt (additional counters are omitted here):
row_count and column_count describe the source batch; the returned_* fields describe what was emitted. truncation_counts reports omissions and inspection completeness, including omitted_rows, omitted_columns, omitted_cells, known_omitted_value_bytes, omitted_complex_values, and known_omitted_metadata_properties. Treat known_* counts as lower bounds unless completeness is established, not as evidence of an exhaustive scan. In particular, schema_column_count_complete, metadata_input_count_complete, and metadata_property_count_complete qualify the related diagnostics; omitted_metadata_input_bytes is null when the input count is incomplete. Optional metadata_counts supplies additional per-key diagnostics.
Errors are bounded too: request/validation/internal failures remain errors, not success-shaped empty results. Error messages respect string and escaped-JSON byte limits; message_truncated indicates shortening. Existing adapter error codes are preserved, while omitted auxiliary error data is marked with error_data_omitted. Validation errors return bounded structured errors records with path, message, and a per-record truncated flag, plus total_errors, returned_errors, and omitted_errors. Space is reserved for the primary validation diagnostic even at the 2,048-byte minimum result budget: its path/message take priority over a long summary or optional suggestion. The path and message can be shortened and suggestions or later records omitted, but a later error does not displace the primary diagnostic.
Serialization concurrency
The server uses two async runtime workers. Small result conversions stay inline; larger or expensive conversions are offloaded to blocking workers. A shared permit limit allows at most two offloaded serializations at once, with the permit held until conversion finishes. This bounds serialization concurrency, not the total process thread count: Bloomberg engine work and stdio handling have their own lifecycle.
Privacy Policy
xbbg-mcp runs locally as a stdio MCP server. It does not send telemetry or usage data to underloam, GitHub, Anthropic, Smithery, Glama, or any other third party.
Tool calls are handled on the user's machine and forwarded only to the Bloomberg runtime/API endpoint configured by the user (XBBG_MCP_HOST / XBBG_HOST, default localhost:8194) under that user's Bloomberg agreements and entitlements. Results are returned only to the MCP client process that launched the server.
Bloomberg validates entitlements at request time, including per-security and per-field access. A valid local session can still return empty or partial results when the user's DAPI, SAPI/B-PIPE, or ZFP entitlement set does not cover the requested data.
The server reads configuration from environment variables and does not persist request data, credentials, or Bloomberg responses to disk.
Smoke test
After building locally, verify the stdio handshake and a few live requests with:
That script expects a live Bloomberg connection and a locally built target/debug/xbbg-mcp binary, or target/release/xbbg-mcp if no debug build is present.
来源:apps/xbbg-mcp/README.md,提交 1004788
工具
0版本历史
7- v1.8.1最新Nov 4, 2026
- v1.8.0Nov 4, 2026
- v1.7.0Oct 29, 2026
- v1.6.0Oct 24, 2026
- v1.5.1Oct 7, 2026
- v1.5.0Oct 2, 2026
- v1.4.12Sep 17, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分