Installation
Requirements
Section titled “Requirements”- Python 3.10+
- Bloomberg Terminal or B-PIPE connection
- Bloomberg C++ SDK
For ZFP over leased lines, you also need Bloomberg-provided TLS client credentials and trust material. See Configuration: ZFP over Leased Lines for the exact configure() call and mutually exclusive connection options.
Install xbbg
Section titled “Install xbbg”pip install xbbgBloomberg SDK Setup
Section titled “Bloomberg SDK Setup”xbbg requires the Bloomberg C++ SDK shared library. You have several options:
Install the official Bloomberg Python bindings:
pip install blpapi --index-url https://blpapi.bloomberg.com/repository/releases/python/simple/xbbg will automatically detect and use the bundled SDK.
If you have Bloomberg Terminal installed, xbbg will auto-detect the DAPI SDK:
- Windows:
C:\blp\DAPI - Linux:
~/blp/DAPIor/opt/bloomberg/DAPI
For local development from this repo, use the bundled helper:
bash ./scripts/sdktool.shOr set the BLPAPI_ROOT environment variable manually:
export BLPAPI_ROOT=/path/to/blpapi_cpp_3.x.x.xOr configure at runtime:
import xbbgxbbg.set_sdk_path('/path/to/blpapi_cpp_3.x.x.x')Verify Installation
Section titled “Verify Installation”import xbbg
# Check SDK detectionprint(xbbg.get_sdk_info())# {'sources': [{'name': 'blpapi_python', 'version': '3.25.x.x', ...}], 'active': 'blpapi_python'}
# Check versionprint(xbbg.__version__)Install xbbg-mcp for coding agents
Section titled “Install xbbg-mcp for coding agents”If you want Claude Code or OpenCode to call Bloomberg directly, install the local MCP launcher and binary from GitHub Releases:
curl -fsSL https://raw.githubusercontent.com/alpha-xone/xbbg/main/scripts/install-xbbg-mcp.sh | shThis installer currently targets macOS arm64 and Linux amd64. Windows release .zip assets are attached to GitHub Releases for manual installation.
GitHub release assets include only the xbbg wrapper/binary pair. They do not bundle Bloomberg SDK files or the Bloomberg runtime; you must provide those locally via blpapi, BLPAPI_ROOT, or another supported runtime source.
The launcher uses the same Bloomberg runtime detection order as the Python package family:
XBBG_MCP_LIB_DIRBLPAPI_LIB_DIRBLPAPI_ROOT- vendored SDK under
vendor/blpapi-sdk/ - the official Python
blpapipackage
Claude Code
Section titled “Claude Code”claude mcp add --transport stdio xbbg -- ~/.local/bin/xbbg-mcpOpenCode
Section titled “OpenCode”{ "$schema": "https://opencode.ai/config.json", "mcp": { "xbbg": { "type": "local", "command": ["/Users/you/.local/bin/xbbg-mcp"], "enabled": true } }}For the full env surface and local smoke test instructions, see apps/xbbg-mcp/README.md.
Next Steps
Section titled “Next Steps”Continue to Quick Start to make your first Bloomberg request.