Python
Python 3.10 or newer.
Installation
xbbg and connect it to Bloomberg.The Python package ships the public API; your environment still supplies Bloomberg connectivity, SDK libraries, and entitlements.
Python 3.10 or newer.
Bloomberg Terminal, B-PIPE/SAPI, or another licensed Bloomberg connectivity path.
Provided by the official blpapi package, Terminal install, BLPAPI_ROOT, or a configured SDK path.
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.
pip install xbbgPackage page: PyPI / xbbg
blpapi package (recommended)pip install blpapi --index-url https://blpapi.bloomberg.com/repository/releases/python/simple/xbbg detects the SDK files bundled with the official Bloomberg Python bindings when they are available.
If Bloomberg Terminal is installed, xbbg can detect the DAPI SDK from common locations:
C:\blp\DAPI~/blp/DAPI or /opt/bloomberg/DAPIFor local development from this repository, use the bundled helper:
bash ./scripts/sdktool.shOr set BLPAPI_ROOT manually:
export BLPAPI_ROOT=/path/to/blpapi_cpp_3.x.x.xOr configure the path at runtime:
import xbbg
xbbg.set_sdk_path('/path/to/blpapi_cpp_3.x.x.x')import xbbg
print(xbbg.get_sdk_info())
print(xbbg.__version__)TIP
Run xbbg.get_sdk_info() to see every detected SDK source and which one is active.
import xbbg
xbbg.configure(
host='localhost',
port=8194,
auth='OS_LOGON',
)For B-PIPE/SAPI, ZFP, TLS, failover, SOCKS5, SDK logging, and middleware-ready diagnostics, continue to Configuration.
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_ROOTvendor/blpapi-sdk/blpapi packageclaude mcp add --transport stdio xbbg -- ~/.local/bin/xbbg-mcp{
"$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.
Make your first request.
Set up Terminal, B-PIPE, ZFP, TLS, failover, SOCKS5, auth, and logging.
Use true async helpers in services.