Sponsored by Deepsite.site

Bloomberg Mcp Server

Created By
VrushilG2 months ago
This project provides a Model Context Protocol (MCP) server that integrates with Bloomberg’s Hypermedia API. It allows clients (e.g., Windsurf, Postman MCP, internal assistants that supports MCP integration) to fetch historical and current rates in a structured, normalized format.
Content

Bloomberg MCP Server

Introduction

This project provides a Model Context Protocol (MCP) server that integrates with Bloomberg’s Hypermedia API.
It allows clients (e.g., Windsurf, Postman MCP, internal assistants that supports MCP integration) to fetch historical and current rates in a structured, normalized format.

The server is built in Python with:

  • FastMCPfor MCP tooling
  • httpx for async HTTP requests
  • Server-Sent Events (SSE) to handle Bloomberg’s asynchronous data distribution

Features

  • 🔑 JWT-based authentication with Bloomberg Hypermedia API
  • 📈 Historical rates tool – get normalized time series data over a date range
  • 📊 Current rates tool – get latest/snapshot quotes for securities
  • 🙋 Greeting/help tool – friendly entry point with usage examples
  • Access control via NocoDB API – restrict tool usage by user status
  • 🧩 Schema validation with msgspec
  • 📡 SSE dispatcher – handles async Bloomberg responses
  • 📝 Structured error responses for consistent handling
  • 📦 Dockerized with pyproject.toml + uv dependency management
  • 🖥️ Console-only logging with configurable log levels

Installation

Clone the repository and install dependencies with uv:

git clone https://github.com/AlterDomus/bloomberg-mcp-server.git
cd bloomberg-mcp-server

# install dependencies (pyproject.toml)
uv venv # Optional, if you want to create a virtual enviornment (recommended)
uv sync

Configuration

All configuration is via environment variables.

Bloomberg credentials:

BLOOMBERG_HOST_URL=https://api.bloomberg.com
BLOOMBERG_CLIENT_ID=<your client id>
BLOOMBERG_CLIENT_SECRET=<your client secret>

Bloomberg configurations:

BLOOMBERG_CATALOG_ID=<catalog id>
BLOOMBERG_API_VERSION=<version number>
BLOOMBERG_REQUEST_TIMEOUT=<request timeout>
BLOOMBERG_TERMINAL_USER_NUMBER=<users terminal number>
BLOOMBERG_SECURITY_LIMIT=<default security limit>

Access control (NocoDB):

NOCODB_API_URL=https://nocodb.example.com/api/v1/db/data/v1/mydb/user_access
NOCODB_TOKEN=<nocodb-api-token>

Logging:

LOG_LEVEL=INFO  # DEBUG, INFO, WARNING, ERROR

Running the Server

Local (stdio):

python -m main

Path (stdio):

C:\Projects\bloomberg-mcp\.venv\Scripts\python.exe C:\Projects\bloomberg-mcp\main.py # Path consist of env and the main file location

Local (streamable HTTP):

python -m main

URL (streamable HTTP):

http://127.0.0.1:8000/mcp

Headers (streamable HTTP):

{
  "Content-Type": "application/json",
  "x-librechat-user-email": "<logged-in user from MCP client>"
}

Available Tools

greeting

Purpose: Return a friendly introduction and examples.
Input: Optional payload.
Output:

{
  "message": "👋 Hi! I’m your Bloomberg AI Assistant..."
}

historical_rates

Purpose: Retrieve normalized historical time series for securities.
Input:

{
  "symbols": [{"id_type":"TICKER","id_value":"EURUSD Curncy"}],
  "fields": [{"name":"PX_LAST"},{"name":"PX_MID"}],
  "currency": "USD",
  "start_date": "2024-01-01",
  "end_date": "2024-01-05"
}

Output:

{
  "data": {
    "TICKER:EURUSD Curncy": [
      {"date":"2024-01-01","values":{"PX_LAST":1.23,"PX_MID":1.22}}
    ]
  }
}

current_rates

Purpose: Retrieve latest/snapshot quotes.
Input:

{
  "symbols": [{"id_type":"SEDOL","id_value":"2046251"}],
  "fields": [{"name":"BID"},{"name":"ASK"},{"name":"PX_LAST"}],
  "currency": "EUR"
}

Output:

{
  "data": {
    "SEDOL:2046251": {
      "fields": {"BID":189.7,"ASK":190.3,"PX_LAST":190.1}
    }
  }
}

Authentication and Access Management

Bloomberg API requires a JWT token, generated with client ID and secret.

Access control is enforced per tool:
The server queries a NocoDB endpoint with the logged-in user email (passed via HTTP header).

  • User must exist and have status active
  • Otherwise, the tool returns a structured ACCESS_DENIED error.

Development Notes

Project Layout:

scripts/
  sample_current.json
  sample_historical.json
  test_historical.py
src/
  config.py
  server.py
  schemas/
    base.py
    current.py
    error.py
    historical.py
  services/
    sse.py
    access.py
  tools/
    greeting.py
    historical.py
    current.py
    _guards.py
  utils/
    auth.py
    errors.py
    http.py
    logging_config.py
    parsing.py
main.py
.env
.env.example
<configuration files>
  • Logging: Unified console logging via src/utils/logging_config.py
  • Schemas: Request/response types defined with msgspec
  • Error Handling: All errors use a shared make_error_response helper
  • Tests: Include examples like test_historical.py
  • Docker: Lightweight python:3.12-slim with uv package manager

Server Config

{
  "mcpServers": {
    "Rates-Extraction-HTTP": {
      "url": "http://127.0.0.1:8000/mcp",
      "headers": {
        "Content-Type": "application/json",
        "x-librechat-user-email": "user@gmail.com"
      }
    }
  }
}
Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
Serper MCP ServerA Serper MCP Server
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
Tavily Mcp
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
DeepChatYour AI Partner on Desktop
CursorThe AI Code Editor
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Playwright McpPlaywright MCP server
Amap Maps高德地图官方 MCP Server
ChatWiseThe second fastest AI chatbot™
WindsurfThe new purpose-built IDE to harness magic
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.