feat(mcp_lite): expose channel as no-LLM SDMX primitives over MCP - #510
Draft
bahdan111 wants to merge 8 commits into
Draft
feat(mcp_lite): expose channel as no-LLM SDMX primitives over MCP#510bahdan111 wants to merge 8 commits into
bahdan111 wants to merge 8 commits into
Conversation
added 8 commits
May 26, 2026 11:08
Not appropriate for the open-source distribution — HANDOFF and backlog carry internal absolute paths and dev host names, PLAN references the internal GitLab tracker. EXPERIMENTS.md is now gitignored so it can be kept locally as an authoring space without accidentally re-committing.
Auto-loaded by Claude Code when the statgpt-mcp-lite MCP server is registered for the session. Codifies the recommended workflow: locate the right dataset(s), resolve dimension codes, verify data availability, fetch observations.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
mcp_lite— a Model Context Protocol server that exposes a StatGPT channel as low-level, no-LLM SDMX primitives. Instead of the production data-query pipeline (LLM normalise → hybrid retrieve → LLM rerank → finished selection), mcp_lite hands the raw primitives to the agent driving the MCP client, which does discovery, code resolution, availability checks, and fetch itself.Server is mounted alongside the existing MCP endpoint at
/api/v1/{deployment_id}/mcp-lite/and shares the running app's channel facade, hybrid index, and auth context — no separate process.Also ships an accompanying Claude Skill (
using-statgpt-mcp-lite) that codifies the recommended agent workflow when driving the server.Tool surface
Nine data primitives + one eval-only artifact writer. Each tool's own description is the authoritative spec.
list_datasetsdataset_structuresample_dim_valuessearch_indicatorsdatasets[]groups; each match carries a readydimensionsselectionsearch_codesavailability_queryexecute_sdmx_querylist_glossary_terms/get_glossary_termwrite_data_query_artifactEVAL_*env varsTypical agent loop:
search_indicators→search_codes/sample_dim_values→availability_query→execute_sdmx_query.Claude Skill
.claude/skills/using-statgpt-mcp-lite/SKILL.md— a single-file Claude Skill auto-loaded when thestatgpt-mcp-liteMCP server is registered for a session. It:search_indicators.datasets[]end-to-end rather than picking the top group onlyNo dependency on Claude Code specifically — the file is portable to any client that supports the Anthropic Skills format.
Design notes
search_indicatorsuses the same ES BM25 ∥ pgvector convex combination (α = 0.9) asHybridSearcher— just without the LLM normalise / LLM rerank / availability filter stages. Those move into the agent's tool-call loop.search_indicatorsreturns per-dataset groups (datasets[], sorted bybest_scoredesc) rather than a flatmatches[]list. Makes multi-dataset coverage structural rather than implicit — the agent can't skip past sibling datasets without reading the group list.ChannelServiceFacadeviafastmcp.Depends; the channel is resolved from theX-DIAL-Application-Idheader, matching the existing MCP endpoint's convention.tools/callwall-clock is logged to/tmp/mcp_lite_timing.log(override withSTATGPT_MCP_LITE_TIMING_LOG). Zero effect on tool payloads.chat_facade.py) let the search primitives narrow by dim_id —search_non_indicator_dimensions_scored(..., dimension_id=...)andsearch_special_dim_values_by_id(..., dim_id=...). Existing callers unaffected.Files
statgpt/mcp_lite/— server, schemas, timing middleware, tool modulesstatgpt/app/application/app_factory.py— mount at/api/v1/{deployment_id}/mcp-litestatgpt/app/services/chat_facade.py— new dim-id-scoped search methods.claude/skills/using-statgpt-mcp-lite/SKILL.md— Claude Skill for driving the server.gitignore— ignore locally-authored experiment notes, eval run artifacts, and the skill's.zipdistribution artifactNot in this PR