Skip to main content
Glama
ONS Trade Data API MCP Server

ONS Trade Data API MCP Server

ONS Trade Data API — MCP Server

An MCP (Model Context Protocol) server that exposes UK trade data from:

Modeled on your previous ons-baby-names-api-mcp server: Python + FastMCP, deployable to Vercel, with a streamable HTTP MCP endpoint at /mcp.

Tools

Tool

Description

health

Check MCP server and upstream API connectivity

get_schema

Dataset metadata (version, last_updated, total_records)

get_time_periods

List available dates

get_countries

Country code lookup

get_commodities

Commodity metadata lookup

get_country_index

Available commodities and periods for a country

fetch_raw

Direct raw JSON fetch from /data/... path

get_trade_file

Fetch one static trade file with optional filtering

query_trade

Generic grouped aggregation query over a trade file

Related MCP server: mcp-comtrade

MCP endpoint

After deployment, connect an MCP client to:

https://ons-trade-data-api-mcp.vercel.app/mcp

Environment variable

Variable

Default

Description

TRADE_API_BASE_URL

https://ons-trade-data-api.netlify.app

Upstream trade API base URL

Deploy to Vercel

  1. Push this repo to GitHub

  2. Import it in Vercel

  3. Deploy (no custom build needed)

Local development

python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python app.py

Server runs locally at:

http://localhost:8000/mcp

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      D
      quality
      D
      maintenance
      Servidor MCP para a API do ComexStat, ferramenta de acesso às estatísticas de comércio exterior do Brasil.
      20
      9 npm
      2
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Provides access to UN Comtrade international bilateral trade data via an MCP server, enabling AI agents to query trade statistics through natural language.
      85 npm
      MIT
    • A
      license
      C
      quality
      C
      maintenance
      MCP server for the UK Bus Open Data Service, enabling timetable queries, stop search, route discovery, journey planning, and real-time bus tracking.
      16
      23 PyPI
      MIT
    • A
      license
      C
      quality
      C
      maintenance
      A research MCP server for UK geospatial and statistical data, enabling AI assistants to query Ordnance Survey and ONS datasets.
      103
      3
      MIT