Skip to content

Expose /metadata/datasets as an MCP-App-only tool for the UI Widget #533

Description

@Fedir-Yatsenko

StatGPT Backend version

latest

What is the problem this feature will solve?

Follow-up to #480.

The UI Widget introduced in #480 needs the channel's datasets metadata to render properly. This data is currently only available through the /metadata/datasets service endpoint, which the widget cannot consume as part of the MCP flow.

We need to expose datasets metadata to the widget over the MCP server, without surfacing it to the model.

What is the proposed feature or solution?

Expose the /metadata/datasets data as an MCP tool that is visible to the MCP App only (mcp_visibility: ["app"]), so the widget can fetch datasets metadata while the Supreme Agent / model does not see the tool.

This mirrors the existing sdmx_query_app passthrough tool: an MCP-App-only tool backed by existing backend logic (reuse DataSetService.get_channel_dataset_schemas_with_last_updated), returning the same payload as the /metadata/datasets endpoint.

What alternatives have you considered?

  • Leaving the widget to call the /metadata/datasets REST endpoint directly — rejected; keeps widget data access outside the MCP flow and out of the per-channel tool/visibility configuration.
  • Exposing the tool to the model as well — rejected; the model does not need dataset metadata through this path, so it should stay app-only.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions