Skip to content

Installation

Install xbbg and connect it to Bloomberg.

The Python package ships the public API; your environment still supplies Bloomberg connectivity, SDK libraries, and entitlements.

Requirements

Python

Python 3.10 or newer.

Bloomberg access

Bloomberg Terminal, B-PIPE/SAPI, or another licensed Bloomberg connectivity path.

Bloomberg C++ SDK runtime

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.

Install xbbg

bash
pip install xbbg

Package page: PyPI / xbbg

Provide the Bloomberg SDK runtime

Official blpapi package (recommended)
bash
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.

Bloomberg Terminal install

If Bloomberg Terminal is installed, xbbg can detect the DAPI SDK from common locations:

  • Windows: C:\blp\DAPI
  • Linux: ~/blp/DAPI or /opt/bloomberg/DAPI
Manual SDK path

For local development from this repository, use the bundled helper:

bash
bash ./scripts/sdktool.sh

Or set BLPAPI_ROOT manually:

bash
export BLPAPI_ROOT=/path/to/blpapi_cpp_3.x.x.x

Or configure the path at runtime:

python
import xbbg

xbbg.set_sdk_path('/path/to/blpapi_cpp_3.x.x.x')

Verify installation

python
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.

Configure your first connection

python
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.

Optional: 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:

bash
curl -fsSL https://raw.githubusercontent.com/alpha-xone/xbbg/main/scripts/install-xbbg-mcp.sh | sh

This 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:

  1. XBBG_MCP_LIB_DIR
  2. BLPAPI_LIB_DIR
  3. BLPAPI_ROOT
  4. vendored SDK under vendor/blpapi-sdk/
  5. the official Python blpapi package

Claude Code

bash
claude mcp add --transport stdio xbbg -- ~/.local/bin/xbbg-mcp

OpenCode

json
{
  "$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

Configuration

Set up Terminal, B-PIPE, ZFP, TLS, failover, SOCKS5, auth, and logging.

xbbg is independent open-source software and is not affiliated with, endorsed by, sponsored by, or approved by Bloomberg Finance L.P.