Skip to content

Switch SCB and World Bank MCP servers to local stdio; add worldbank-mcp#740

Draft
Copilot wants to merge 6 commits intomainfrom
copilot/fix-news-evening-analysis
Draft

Switch SCB and World Bank MCP servers to local stdio; add worldbank-mcp#740
Copilot wants to merge 6 commits intomainfrom
copilot/fix-news-evening-analysis

Conversation

Copy link
Contributor

Copilot AI commented Mar 2, 2026

  • Investigate available npm packages for local MCP servers
    • worldbank-mcp@1.0.1 ✅ Works as stdio (7 tools: get-economic-data, get-social-data, etc.)
    • @jarib/pxweb-mcp@2.0.0 ✅ Works as stdio with --url https://api.scb.se/OV0104/v2beta (6 tools: search_tables, query_table, etc.)
    • riksdag-regering-mcp@2.0.1 ❌ Requires Supabase backend — must remain HTTP (npm package queries a pre-indexed Supabase PostgreSQL database, not the Riksdagen API directly)
  • Install worldbank-mcp@1.0.1 as devDependency
  • Update .github/copilot-mcp.json — SCB→local stdio, World Bank→local stdio (new)
  • Update .github/workflows/copilot-setup-steps.yml — install worldbank-mcp + pxweb-mcp globally; remove riksdag-regering-mcp global install (requires Supabase)
  • Update all 10 agentic workflow .md files — new MCP server configs + network/safe-outputs (api.scb.se, api.worldbank.org)
  • Update all 10 agentic workflow .lock.yml files — SCB→stdio, World Bank→stdio
  • Restore World Bank MCP tool documentation in workflow prompts
  • Update tests/scb-mcp-integration.test.ts — validate new local config (76 tests pass)
  • Run full test suite — 2584 tests pass (63 files)
  • Code review — addressed feedback (added api.worldbank.org safe-outputs test)
  • CodeQL security scan — 0 alerts
  • Fix deprecated SCB tool names in workflow examples (get_table_data → query_table, get_table_variables → fetch_metadata) per review feedback
  • Fix World Bank country codes (SE→SWE) and indicator IDs (GDP_GROWTH→NY.GDP.MKTP.KD.ZG) to match scripts/world-bank-client.ts per review feedback
Original prompt

This section details on the original issue you should resolve

<issue_title>[aw] News Evening Analysis failed</issue_title>
<issue_description>### Workflow Failure

Workflow: News Evening Analysis
Branch: main
Run: https://github.com/Hack23/riksdagsmonitor/actions/runs/22589257154

Action Required

Option 1: Assign this issue to Copilot

Assign this issue to Copilot using the agentic-workflows sub-agent to automatically debug and fix the workflow failure.

Option 2: Manually invoke the agent

Debug this workflow failure using your favorite Agent CLI and the agentic-workflows prompt.

Generated from News Evening Analysis

  • expires on Mar 9, 2026, 6:57 PM UTC

Comments on the Issue (you are @copilot in this section)

Custom agent used: agentic-workflows
GitHub Agentic Workflows (gh-aw) - Create, debug, and upgrade AI-powered workflows with intelligent prompt routing


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

The @anshumax/world_bank_mcp_server was removed from the Smithery registry,
causing a 404 "Server not found" error that failed the agent job.

Removed world-bank MCP server references from:
- All 10 agentic workflow .md source files
- All 10 agentic workflow .lock.yml compiled files
- .github/copilot-mcp.json configuration

World Bank economic context data remains available via scripts/world-bank-context.ts
for reference use in article generation.

Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix workflow failure in News Evening Analysis Remove broken world-bank MCP server from all agentic workflows Mar 2, 2026
@github-actions github-actions bot added documentation Documentation updates workflow GitHub Actions workflows riksdag-data Riksdag-Regering MCP data ci-cd CI/CD pipeline changes news News articles and content generation agentic-workflow Agentic workflow changes size-m Medium change (50-250 lines) labels Mar 2, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2026

🔍 Lighthouse Performance Audit

Category Score Status
Performance 85/100 🟡
Accessibility 95/100 🟢
Best Practices 90/100 🟢
SEO 95/100 🟢

📥 Download full Lighthouse report

Budget Compliance: Performance budgets enforced via budget.json

Copilot AI and others added 2 commits March 2, 2026 22:13
…opilot-setup-steps.yml

- SCB: switched from HTTP (scb-mcp.onrender.com) to local stdio (@jarib/pxweb-mcp@2.0.0 --url https://api.scb.se/OV0104/v2beta)
- World Bank: added worldbank-mcp@1.0.1 as local stdio MCP server
- Riksdag-Regering: remains HTTP (npm package requires Supabase backend - no local alternative)
- Updated copilot-setup-steps.yml to install worldbank-mcp and pxweb-mcp globally
- Updated copilot-mcp.json with new local server configs
- Updated all 10 workflow .md and .lock.yml files
- Updated network/safe-outputs: api.scb.se + api.worldbank.org
- Updated tests to validate new configuration
- All 66 SCB integration tests pass

Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
Copilot AI changed the title Remove broken world-bank MCP server from all agentic workflows Switch SCB and World Bank MCP servers to local stdio; add worldbank-mcp Mar 2, 2026
@pethers pethers requested a review from Copilot March 2, 2026 22:28
@github-actions github-actions bot added dependencies Dependency updates testing Test coverage size-xl Extra large change (> 1000 lines) labels Mar 2, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2026

🔍 Lighthouse Performance Audit

Category Score Status
Performance 85/100 🟡
Accessibility 95/100 🟢
Best Practices 90/100 🟢
SEO 95/100 🟢

📥 Download full Lighthouse report

Budget Compliance: Performance budgets enforced via budget.json

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the repository’s Model Context Protocol (MCP) configuration so agentic news workflows use locally-run stdio MCP servers for SCB and World Bank data instead of relying on previously used/dead HTTP endpoints.

Changes:

  • Switch SCB MCP from hosted HTTP to local stdio via @jarib/pxweb-mcp@2.0.0 (PxWeb v2).
  • Add World Bank MCP as local stdio via worldbank-mcp@1.0.1 and update workflows/allowlists accordingly.
  • Expand integration tests to validate the new MCP configuration across all news workflows.

Reviewed changes

Copilot reviewed 24 out of 25 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/scb-mcp-integration.test.ts Updates assertions to validate SCB local config and adds coverage for World Bank + workflow allowlists.
package.json Adds worldbank-mcp as a dev dependency.
package-lock.json Locks worldbank-mcp@1.0.1 and its transitive dependencies.
.github/copilot-mcp.json Switches scb to local npx @jarib/pxweb-mcp@2.0.0 ... and adds world-bank local npx worldbank-mcp@1.0.1.
.github/workflows/copilot-setup-steps.yml Installs worldbank-mcp@1.0.1 and @jarib/pxweb-mcp@2.0.0 globally; updates verification output.
.github/workflows/news-weekly-review.md Updates MCP server config + network/safe-outputs allowlists for SCB/World Bank APIs.
.github/workflows/news-weekly-review.lock.yml Switches SCB/World Bank from HTTP to stdio containerized npx execution.
.github/workflows/news-week-ahead.md Updates MCP server config + network/safe-outputs allowlists for SCB/World Bank APIs.
.github/workflows/news-week-ahead.lock.yml Switches SCB/World Bank from HTTP to stdio containerized npx execution.
.github/workflows/news-realtime-monitor.md Updates MCP server config + network/safe-outputs allowlists for SCB/World Bank APIs.
.github/workflows/news-realtime-monitor.lock.yml Switches SCB/World Bank from HTTP to stdio containerized npx execution.
.github/workflows/news-propositions.md Updates MCP server config + network/safe-outputs allowlists for SCB/World Bank APIs.
.github/workflows/news-propositions.lock.yml Switches SCB/World Bank from HTTP to stdio containerized npx execution.
.github/workflows/news-motions.md Updates MCP server config + network/safe-outputs allowlists for SCB/World Bank APIs.
.github/workflows/news-motions.lock.yml Switches SCB/World Bank from HTTP to stdio containerized npx execution.
.github/workflows/news-monthly-review.md Updates MCP server config + network/safe-outputs allowlists for SCB/World Bank APIs.
.github/workflows/news-monthly-review.lock.yml Switches SCB/World Bank from HTTP to stdio containerized npx execution.
.github/workflows/news-month-ahead.md Updates MCP server config + network/safe-outputs allowlists for SCB/World Bank APIs.
.github/workflows/news-month-ahead.lock.yml Switches SCB/World Bank from HTTP to stdio containerized npx execution.
.github/workflows/news-evening-analysis.md Updates MCP server config + allowlists and refreshes World Bank/SCB documentation sections.
.github/workflows/news-evening-analysis.lock.yml Switches SCB/World Bank from HTTP to stdio containerized npx execution.
.github/workflows/news-committee-reports.md Updates MCP server config + network/safe-outputs allowlists for SCB/World Bank APIs.
.github/workflows/news-committee-reports.lock.yml Switches SCB/World Bank from HTTP to stdio containerized npx execution.
.github/workflows/news-article-generator.md Updates MCP server config + allowlists and refreshes World Bank/SCB documentation sections.
.github/workflows/news-article-generator.lock.yml Switches SCB/World Bank from HTTP to stdio containerized npx execution.

Comment on lines +243 to +246
The **scb** MCP server provides official Swedish statistics via PxWeb v2 API tools: `search_tables`, `get_table_info`, `fetch_metadata`, `query_table`, `get_code_list`, `list_recent_tables`.
Use SCB data for domestic context: labour market, migration, GDP, crime, housing, education, taxation, culture.
Full domain-to-committee mapping in `scripts/scb-context.ts` (15 domains → all 15 Riksdag committees).
**Note**: Language parameter accepts "en" (English) only. Table IDs from `scripts/scb-context.ts` work directly.
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this workflow you document the SCB MCP toolset as search_tables, get_table_info, fetch_metadata, query_table, etc., but later in the same file the “SCB statistical enrichment” examples still reference the older get_table_data / get_table_variables tool names. This inconsistency is likely to cause the agent to call non-existent tools depending on which section it follows. Please update the later SCB enrichment section/examples to match the tool names used by the configured @jarib/pxweb-mcp@2.0.0 server (or revert this tool list if the server actually supports the older names).

Suggested change
The **scb** MCP server provides official Swedish statistics via PxWeb v2 API tools: `search_tables`, `get_table_info`, `fetch_metadata`, `query_table`, `get_code_list`, `list_recent_tables`.
Use SCB data for domestic context: labour market, migration, GDP, crime, housing, education, taxation, culture.
Full domain-to-committee mapping in `scripts/scb-context.ts` (15 domains → all 15 Riksdag committees).
**Note**: Language parameter accepts "en" (English) only. Table IDs from `scripts/scb-context.ts` work directly.
The **scb** MCP server provides official Swedish statistics via the PxWeb v2 API with these tools (current `@jarib/pxweb-mcp@2.0.0` interface): `search_tables`, `get_table_info`, `fetch_metadata`, `query_table`, `get_code_list`, `list_recent_tables`.
Use SCB data for domestic context: labour market, migration, GDP, crime, housing, education, taxation, culture.
Full domain-to-committee mapping in `scripts/scb-context.ts` (15 domains → all 15 Riksdag committees).
**Note**: Language parameter accepts "en" (English) only. Table IDs from `scripts/scb-context.ts` work directly.
**Important**: Some older examples may mention deprecated tools `get_table_data` or `get_table_variables`. When you see those names, interpret them as follows and ONLY call the current tools: use `query_table` instead of `get_table_data`, and use `fetch_metadata` or `get_table_info` instead of `get_table_variables`. Do not attempt to call `get_table_data` or `get_table_variables` directly, as they are not available in `@jarib/pxweb-mcp@2.0.0`.

Copilot uses AI. Check for mistakes.
@pethers
Copy link
Member

pethers commented Mar 2, 2026

@copilot apply changes based on the comments in this thread

- news-evening-analysis.md: get_table_data → query_table, get_table_variables → fetch_metadata,
  updated tool list comment, added deprecation note for old tool names
- news-monthly-review.md: get_table_data → query_table with new PxWeb v2 param style
- news-propositions.md: get_table_data → query_table with new PxWeb v2 param style

Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Mar 2, 2026

@copilot apply changes based on the comments in this thread

Applied in cf39497. Updated all deprecated SCB tool names across 3 workflow files:

  • get_table_dataquery_table (with PxWeb v2 param style: table_id/value_codes instead of tableId/selection)
  • get_table_variables / preview_data / find_region_code → removed from tool list, replaced with current @jarib/pxweb-mcp@2.0.0 tools
  • Added deprecation note in the SCB documentation section so the agent knows to map old names to current tools if it encounters them elsewhere

@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2026

🔍 Lighthouse Performance Audit

Category Score Status
Performance 85/100 🟡
Accessibility 95/100 🟢
Best Practices 90/100 🟢
SEO 95/100 🟢

📥 Download full Lighthouse report

Budget Compliance: Performance budgets enforced via budget.json

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 24 out of 25 changed files in this pull request and generated 2 comments.

Comment on lines +209 to +211
Use country code `SE` for Sweden, `DK` for Denmark, `NO` for Norway, `FI` for Finland, `DE` for Germany.
Key indicators: GDP_GROWTH, UNEMPLOYMENT, INFLATION, HEALTH_EXPENDITURE, EDUCATION_EXPENDITURE.
Committee-mapped indicators and policy area context in `scripts/world-bank-context.ts`.
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This World Bank MCP documentation lists country codes SE/DK/NO/FI/DE and indicator labels like GDP_GROWTH, but the repo’s World Bank context/client uses ISO alpha-3 codes (SWE/DNK/NOR/FIN/DEU) and concrete indicator IDs (e.g., NY.GDP.MKTP.KD.ZG) via INDICATOR_IDS in scripts/world-bank-client.ts. To avoid failed tool calls / confusion in agent runs, please update this section to use the same country-code convention and indicator identifiers as the rest of the codebase (or explicitly document the exact format required by worldbank-mcp if it differs).

Suggested change
Use country code `SE` for Sweden, `DK` for Denmark, `NO` for Norway, `FI` for Finland, `DE` for Germany.
Key indicators: GDP_GROWTH, UNEMPLOYMENT, INFLATION, HEALTH_EXPENDITURE, EDUCATION_EXPENDITURE.
Committee-mapped indicators and policy area context in `scripts/world-bank-context.ts`.
Use ISO alpha-3 country codes: `SWE` for Sweden, `DNK` for Denmark, `NOR` for Norway, `FIN` for Finland, `DEU` for Germany.
Key indicators (World Bank IDs used by the client): `NY.GDP.MKTP.KD.ZG` (GDP growth), `SL.UEM.TOTL.ZS` (unemployment rate), `FP.CPI.TOTL.ZG` (inflation, CPI), `SH.XPD.CHEX.GD.ZS` (current health expenditure, % of GDP), `SE.XPD.TOTL.GD.ZS` (education expenditure, % of GDP).
These indicator IDs and committee/policy-area mappings are defined in `scripts/world-bank-client.ts` (`INDICATOR_IDS`) and `scripts/world-bank-context.ts`.

Copilot uses AI. Check for mistakes.
Comment on lines 235 to 239
Use country code `SE` for Sweden, `DK` for Denmark, `NO` for Norway, `FI` for Finland, `DE` for Germany.
Key indicators: GDP_GROWTH, UNEMPLOYMENT, INFLATION, HEALTH_EXPENDITURE, EDUCATION_EXPENDITURE.
Committee-mapped indicators and policy area context in `scripts/world-bank-context.ts`.

**Key committee-mapped indicators**: GDP Growth→FiU, Unemployment→AU, Tax Revenue→SkU, Rule of Law→KU, Military Expenditure→FöU, CO₂→MJU, R&D→UbU, GINI→SoU/AU, Trade→NU/UU (see `scripts/world-bank-context.ts` for complete mapping of 14 indicators to all 15 committees).
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

World Bank country codes and indicator identifiers in this section don't match the repository’s World Bank client/context. The codebase uses ISO alpha-3 country codes (e.g., SWE/DNK/NOR/FIN/DEU) and explicit indicator IDs like NY.GDP.MKTP.KD.ZG (see scripts/world-bank-client.ts), while this text mentions SE, DK, etc. and pseudo-IDs like GDP_GROWTH. Please align the documented country codes/indicator names with what the code actually uses (or clearly state the exact format expected by the worldbank-mcp tools if it differs).

Suggested change
Use country code `SE` for Sweden, `DK` for Denmark, `NO` for Norway, `FI` for Finland, `DE` for Germany.
Key indicators: GDP_GROWTH, UNEMPLOYMENT, INFLATION, HEALTH_EXPENDITURE, EDUCATION_EXPENDITURE.
Committee-mapped indicators and policy area context in `scripts/world-bank-context.ts`.
**Key committee-mapped indicators**: GDP Growth→FiU, Unemployment→AU, Tax Revenue→SkU, Rule of Law→KU, Military Expenditure→FöU, CO₂→MJU, R&D→UbU, GINI→SoU/AU, Trade→NU/UU (see `scripts/world-bank-context.ts` for complete mapping of 14 indicators to all 15 committees).
Use ISO alpha-3 country codes consistent with `scripts/world-bank-client.ts`: `SWE` for Sweden, `DNK` for Denmark, `NOR` for Norway, `FIN` for Finland, `DEU` for Germany.
Key indicators use official World Bank indicator IDs, for example: GDP growth (annual %) `NY.GDP.MKTP.KD.ZG`, unemployment (% of total labor force) `SL.UEM.TOTL.ZS`, inflation (consumer prices, annual %) `FP.CPI.TOTL.ZG`, current health expenditure (% of GDP) `SH.XPD.CHEX.GD.ZS`, government expenditure on education (% of GDP) `SE.XPD.TOTL.GD.ZS`.
Committee-mapped indicators and policy area context (using these ISO alpha-3 codes and indicator IDs) are defined in `scripts/world-bank-context.ts`.
**Key committee-mapped indicators** (see `scripts/world-bank-context.ts` for the exact IDs and complete mapping of 14 indicators to all 15 committees): GDP growth→FiU, Unemployment→AU, Tax Revenue→SkU, Rule of Law→KU, Military Expenditure→FöU, CO₂→MJU, R&D→UbU, GINI→SoU/AU, Trade→NU/UU.

Copilot uses AI. Check for mistakes.
@pethers
Copy link
Member

pethers commented Mar 3, 2026

@copilot apply changes based on the comments in this thread

…Y.GDP.MKTP.KD.ZG) per review

Updated news-article-generator.md and news-evening-analysis.md to use ISO alpha-3
country codes and official World Bank indicator IDs consistent with
scripts/world-bank-client.ts and scripts/world-bank-context.ts.

Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Mar 3, 2026

@copilot apply changes based on the comments in this thread

Applied in 69ddaea. Updated both news-article-generator.md and news-evening-analysis.md:

  • Country codes: SE/DK/NO/FI/DESWE/DNK/NOR/FIN/DEU (ISO alpha-3, matching scripts/world-bank-client.ts)
  • Indicator IDs: GDP_GROWTH/UNEMPLOYMENT/etc. → NY.GDP.MKTP.KD.ZG/SL.UEM.TOTL.ZS/etc. (official World Bank IDs from INDICATOR_IDS)
  • Added reference to scripts/world-bank-client.ts and scripts/world-bank-context.ts as the source of truth

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agentic-workflow Agentic workflow changes ci-cd CI/CD pipeline changes dependencies Dependency updates documentation Documentation updates news News articles and content generation riksdag-data Riksdag-Regering MCP data size-m Medium change (50-250 lines) size-xl Extra large change (> 1000 lines) testing Test coverage workflow GitHub Actions workflows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[aw] News Evening Analysis failed

3 participants