sdmx-authoring-mcp
sdmx-authoring-mcp
Experimental software. Not for production use. This repository is an evaluation and development harness; APIs and behavior may change without a compatibility or support commitment. The sandbox credentials are for disposable local/CI use only and must not be reused in a deployed environment.
A first-party Python MCP server for authoring SDMX artefacts in the lab's
Fusion Metadata Registry (FMR). It exposes agency and codelist management, as
well as the artefacts and rules needed to build dataflow mappings. FMR reads
and writes are handled server-side with
pysdmx.
Run the server with uv run server.py. Dependencies are declared in the
script using PEP 723, so uv installs them when needed. The source files are
plain sibling modules rather than an installed Python package.
Capabilities
Agencies: list, create, and update agency schemes and agencies.
Codelists: list per agency or across all agencies, get, create, and update codelists and codes. List operations return id, agency, version, name, description, and contained-code count without returning every code.
Concept schemes: list, get, create, and update concepts.
Data structures: list, get, create, and update dimensions, measures, attributes, and groups in a
DataStructureDefinition.Dataflows: list and create dataflows, and inspect a dataflow's resolved component schema.
Representation maps: list, get, create, and update single-source and multi-source value mappings.
Structure maps: list, get, create, and update component, multi-component, fixed-value, implicit, and date-pattern mapping rules.
The MCP tools are registered in server.py; the artefact logic lives in
separate modules, with FMR access centralized in fmr_client.py.
For maintenance guidance, start with AGENTS.md, the
architecture overview, and its
decision records.
Related MCP server: OECD MCP Server
Mapping workflow
Build the workflow in dependency order:
Create a
ConceptSchemeand the requiredCodelistartefacts.Create a
DataStructureDefinitionthat references their concepts and values.Create source and target
Dataflows that reference their data structures.Create required
RepresentationMaporMultiRepresentationMapvalue conversions.Connect the dataflows with a
StructureMapthat references those maps.
Call get_dataflow_structure to discover component ids before writing mapping
rules. Create any referenced RepresentationMap or MultiRepresentationMap
first. Artefacts are referenced, not embedded: reference parameters accept a
URN string or a coordinate object such as
{"agency": "BIS", "id": "EXAMPLE", "version": "1.0"}.
Input shapes
All shapes below are JSON objects passed inside the corresponding MCP list or argument. Fields marked optional may be omitted.
Concepts (
create_concept_scheme.concepts):{"id": "FREQ", "name": "Frequency", "description": "...", "data_type": "String", "codelist": {"agency": "BIS", "id": "FREQ_CL", "version": "1.0"}, "facets": {"min_length": 1}}.codelistaccepts a URN or coordinates.facetsaccepts pysdmxFacetsfields:min_length,max_length,min_value,max_value,start_value,end_value,interval,time_interval,decimals,pattern,start_time,end_time,is_sequence, andis_multilingual.Data structure components (
create_data_structure.components, andadd_components/modify_components):{"id": "FREQ", "role": "dimension", "required": true, "concept_id": "FREQ", "concept_scheme": {"agency": "BIS", "id": "CONCEPTS", "version": "1.0"}, "data_type": "String", "codelist": {"agency": "BIS", "id": "FREQ_CL", "version": "1.0"}, "attachment_level": "O", "local_facets": {"min_length": 1}, "name": "Frequency", "description": "..."}. Required fields areid,role(dimension,measure, orattribute),required,concept_id, andconcept_scheme(URN or coordinates).attachment_levelis required only for attributes;data_type,codelist,local_facets,name, anddescriptionare optional.modify_componentsmerges supplied fields into the existing component; an explicitnullclears an optional field.Groups (
create_data_structure.groupsor optionalupdate_data_structure.groups):{"id": "FREQ_GROUP", "dimensions": ["FREQ"]}. Every listed id must identify a dimension in the resulting data structure. Supplying groups on update replaces the complete group list; omitting it keeps existing groups.Value maps (
value_maps): a single-value entry is{"source": "US", "target": "USA", "valid_from": "2020-01-01T00:00:00", "valid_to": "2030-01-01T00:00:00"}; multi-value entries use string arrays forsourceandtarget.valid_fromandvalid_toare optional ISO datetime strings (or datetimes when calling the Python functions). The current pysdmx SDMX-ML writer omits these attributes, so they do not survive an FMR round trip.Structure-map rules (
create_structure_map.maps,add_maps,modify_maps) use atypediscriminator:component:{"type": "component", "source": "FREQ", "target": "FREQ", "representation_map": "RepresentationMap=BIS:FREQ_MAP(1.0)"}multi_component:{"type": "multi_component", "source": ["COUNTRY", "CURRENCY"], "target": ["CURRENCY"], "representation_map": {"agency": "BIS", "id": "MULTI_MAP", "version": "1.0"}}fixed_value:{"type": "fixed_value", "target": "STATUS", "value": "F", "located_in": "target"}(located_indefaults totarget)implicit:{"type": "implicit", "source": "OLD_ID", "target": "NEW_ID"}date_pattern:{"type": "date_pattern", "source": "TIME_PERIOD", "target": "TIME_PERIOD", "pattern": "MMM yy", "frequency": "M", "id": "DATE_RULE", "locale": "en", "pattern_type": "fixed", "resolve_period": "startOfPeriod"}.id,locale,pattern_type, andresolve_periodare optional. Rules must have unique targets.representation_mapaccepts a URN or coordinates and is required for bothcomponentandmulti_component. For a direct copy without value conversion, useimplicit, including for measures:{"type": "implicit", "source": "OBS_VALUE", "target": "OBS_VALUE"}. Acomponentrule withoutrepresentation_mapis not a direct copy and is rejected locally before submission to FMR.
Authoring behavior
Create operations reject an artefact that already exists at the requested agency, id, and version.
Updates merge into the existing artefact at the same id/version without a version bump; duplicate additions and missing targets are rejected.
Pass
dry_run=trueto preview a mutation without submitting it to the FMR.
Agency ids returned by RegistryClient.get_agencies(parent_agency) may include
their ancestor path (for example BIS.CBS for the CBS agency under BIS),
while SDMX-ML stores the short local id (CBS). The agency tools normalize
these ids before submission and accept either form as input.
Run locally
Set the FMR URLs and credentials for the environment, then launch the server:
FMR_SDMX_URL=http://localhost:5000/sdmx/v2 \
FMR_SUBMIT_URL=http://localhost:5000/ws/secure/sdmxapi/rest/ \
FMR_ROOT_USER=demo \
FMR_ROOT_PASSWORD=password \
uv run server.pyInside the aio-sandbox, use the FMR service name on the shared Docker network.
For standalone runs, start the labspace stack and use a host/port reachable
from the server process. The server uses the official
mcp SDK's
FastMCP implementation and serves Streamable HTTP at /mcp.
Tests
Run the full suite against the standalone, resettable FMR sandbox with:
./sandbox/run.sh testThe sandbox uses public container images, requires no sibling repository or private
registry login, and treats an unavailable FMR as a failure. See
sandbox/README.md for up, health, logs, reset, and
configuration options.
For a fast local run without starting FMR, use:
uv run pytestFMR-dependent tests skip when the service is unavailable in this optional local mode.
Before submitting a change, run the same locked fast gates as CI:
uv sync --locked --group dev
uv run ruff check .
uv run ruff format --check .
uv run pytest -q -m "not fmr_integration"Run ./sandbox/run.sh test -q as well for registry, serialization, or authoring
behavior changes. See AGENTS.md for the complete agent workflow.
License
This repository is distributed under the Workshop License. It allows workshop participants to download, copy, execute, and modify the software for personal learning, experimentation, and workshop-related purposes. Commercial use, production use, redistribution, and incorporation into other projects require prior written permission.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Create and manage Cloudinary structured metadata fields, datasources, and rules.
Governed data discovery, exact queries, decisions, simulations, and runtime utilities over MCP.
Dashboards as data. Author, validate, render, and share dvt dashboards from any MCP client.
Immutable diagrams for AI agents: create, edit, validate and render versioned diagrams over MCP.
Related MCP Servers
- AlicenseAqualityBmaintenanceEnables MCP-compatible clients to access Canadian statistical data from Statistics Canada via WDS and SDMX APIs, including search, download, and analysis capabilities.25198 PyPI8MIT
- AlicenseNot gradedqualityBmaintenanceEnables searching, exploring, and querying over 1,500 OECD statistical datasets via SDMX, covering national accounts, employment, trade, PISA, health, and more.384 npm5Apache 2.0
- AlicenseAqualityBmaintenanceEnables comprehensive Salesforce metadata management from MCP clients, providing 221 tools for creating objects, fields, Apex, flows, LWCs, Agentforce agents, and more.20746 npm3MIT

@pipeworx/bisofficial
AlicenseNot gradedqualityCmaintenanceEnables querying Bank for International Settlements central-bank and global financial statistics via the SDMX v2 API, including credit-to-GDP gaps, curated dataflows, and full registry search with dataset fetching, without authentication.77 npm1MIT