ต้นแบบ · รุ่นทดลอง: มีทุก server ในทะเบียนทางการ อัปเดตทุก 30 นาที รีวิวและบัญชีผู้ใช้จะมาในขั้นถัดไป
PopNx MCPที่รวม MCP สำหรับคนใช้ AI · อธิบายเป็นภาษาคน

Swiss Statistics MCP

โดย malkreideรุ่น 0.8.0i★ –iรันบนเครื่อง
ชื่อใน registryio.github.malkreide/swiss-statistics-mcp

ติดตั้ง

ภาพรวม

คำอธิบายจากผู้ทำ (ภาษาอังกฤษตามต้นฉบับ)

BFS STAT-TAB PxWeb API for official Swiss statistics

สามเสาของ PopNx MCP

สามเรื่องนี้ไม่รวมเป็นคะแนนเดียว เพราะความเห็น การวัด และความนิยม เป็นคนละเรื่องกัน

ใช้ทำอะไรได้

ตัวนี้ยังไม่ได้เรียบเรียงเป็นภาษาไทย ด้านล่างคือข้อเท็จจริงที่เราอ่านจาก registry

  • การเชื่อมต่อ: รันบนเครื่อง
  • ช่องทาง (transport): stdio
  • หมวด: ฐานข้อมูลและชุดข้อมูล

ติดตั้ง

เลือกโปรแกรม AI ที่คุณใช้ แล้วคัดลอกค่าตั้งไปวาง

ก่อนติดตั้ง

ต้องเตรียมก่อน

  • PyPIติดตั้ง uv ของ Python (มีคำสั่ง uvx) ในเครื่อง

คุณใช้แอปไหน

เลือกแอปด้านบน เราจำไว้ให้ ครั้งหน้าปุ่มจะขึ้นว่า “ติดตั้งลง …”

เปิด Claude Desktop → Settings → Developer → Edit Config แล้ววางค่านี้ในไฟล์ claude_desktop_config.json

{
  "mcpServers": {
    "swiss-statistics": {
      "command": "uvx",
      "args": [
        "swiss-statistics-mcp"
      ]
    }
  }
}

พิมพ์คำสั่งนี้ใน Terminal

claude mcp add swiss-statistics -- uvx swiss-statistics-mcp

เปิดใน Cursor

หรือคัดลอกค่าตั้งเอง

วางในไฟล์ .cursor/mcp.json ของโปรเจกต์ หรือ ~/.cursor/mcp.json

{
  "mcpServers": {
    "swiss-statistics": {
      "command": "uvx",
      "args": [
        "swiss-statistics-mcp"
      ]
    }
  }
}

เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง

เปิดใน VS Code

หรือคัดลอกค่าตั้งเอง

วางในไฟล์ .vscode/mcp.json ของโปรเจกต์

{
  "servers": {
    "swiss-statistics": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "swiss-statistics-mcp"
      ]
    }
  }
}

เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง

ตัวนี้รันในเครื่องคุณ แต่ ChatGPT ต่อได้เฉพาะ server บนอินเทอร์เน็ต ลองเลือกแอปอื่น

ตัวเลือกเก็บในคุกกี้บนเครื่องนี้ ไม่ต้องมีบัญชี

ค่าตั้งนี้สร้างจากข้อมูลใน registry ของผู้ทำ ถ้าไม่ตรงกับ README ให้เชื่อ README

ทำอะไรได้บ้าง

รันในเครื่องคุณ รายการเครื่องมือจะขึ้นในแอป AI หลังติดตั้ง

ผลตรวจเบื้องต้นi

เราตรวจจากข้อมูลที่ใครก็เปิดดูได้ ยังไม่ได้อ่านโค้ด ข้อที่ไม่เกี่ยวกับตัวนี้ไม่นับในตัวหาร · ตรวจเมื่อ 8 พ.ย. 2569

  • ✓ ผ่าน

    ตัวตนผู้ทำตรงกับ repo

    ชื่อใน registry ยืนยันด้วยบัญชี GitHub malkreide ซึ่งเป็นเจ้าของ repo

  • … ยังไม่ตรวจ

    ยังมีคนดูแล

    ยังไม่ได้อ่านข้อมูล repo จาก GitHub

  • … ยังไม่ตรวจ

    มีสัญญาอนุญาต (license)

    ยังไม่ได้อ่านข้อมูล repo จาก GitHub

  • – ไม่เกี่ยว

    endpoint ตอบ

    ตัวนี้รันบนเครื่องคุณ ไม่มี endpoint บนอินเทอร์เน็ต

  • – ไม่เกี่ยว

    ล็อกอินแบบ OAuth

    ตัวนี้รันบนเครื่อง ใช้ค่าที่ตั้งในเครื่องแทน

  • … ยังไม่ตรวจ

    คำอธิบายเครื่องมือไม่มีคำสั่งแอบแฝง

    รันในเครื่องคุณ เราอ่านรายการเครื่องมือได้เฉพาะตัวที่มี endpoint บนอินเทอร์เน็ต

เทียบกับตัวอื่นในหมวด ฐานข้อมูลและชุดข้อมูลi

  • ดาวมากกว่า 0% ของอีก 1146 ตัวในหมวดนี้
  • ส่งรุ่นใหม่เข้า registry ล่าสุดกว่า 42% ของอีก 1146 ตัวในหมวดนี้
  • ผลตรวจเบื้องต้นดีกว่าหรือเท่ากับ 100% ของอีก 1146 ตัวในหมวดนี้

เทียบกับทุก server ที่ยังใช้งานในหมวดนี้ทั้งทะเบียน ดาวนับเฉพาะเมื่อผู้ลงทะเบียนเป็นเจ้าของ repo

คำถามที่พบบ่อย

Swiss Statistics MCP ปลอดภัยไหม?

จากการตรวจเบื้องต้นของเรา ผ่าน 1 จาก 1 ข้อที่ตรวจได้ เรายังไม่ได้อ่านโค้ด ก่อนใส่กุญแจหรือ token ให้ดูว่า server ขอสิทธิ์อะไร และเลือกกุญแจที่ทำได้เท่าที่จำเป็น

ต้องใช้กุญแจหรือรหัสอะไรบ้าง?

registry ไม่ได้ระบุว่าต้องใช้กุญแจ แต่บางตัวจะขอให้ล็อกอินตอนใช้ครั้งแรก

ตัวนี้รันบนเครื่องหรือบนคลาวด์?

รันบนเครื่องของคุณ โปรแกรม AI จะเปิด server ขึ้นมาเองเมื่อใช้ ข้อมูลไม่ต้องผ่านเซิร์ฟเวอร์ของผู้ทำ (ยกเว้นตัวที่ไปเรียกบริการออนไลน์ต่อ)

ยังมีคนดูแลอยู่ไหม?

repo บน GitHub มีการแก้โค้ดล่าสุด – และส่งรุ่นล่าสุด (0.8.0) เข้า registry 43 วันที่ผ่านมา

ใช้กับโปรแกรมไหนได้บ้าง?

โปรแกรมที่รองรับ MCP เช่น Claude Desktop, Claude Code, Cursor และ VS Code ตัวนี้ต้องมี Python (uv) ในเครื่องด้วย

มีตัวไหนใช้แทนได้บ้าง?

ในหมวดเดียวกันมี Supabase, MongoDB MCP Server, Elasticsearch MCP Server

ตัวที่ใช้แทนได้

server หมวดเดียวกันจากผู้ทำคนอื่น เรียงตามดาว

อ่านการ์ด:↓ ดาวน์โหลดต่อสัปดาห์i★ ดาว GitHubiสามเสา: รีวิว · ผลตรวจ · การใช้งานiอัปเดต = วันที่ส่งรุ่นล่าสุดเข้า registryi

Supabase

server ทางการของ Supabase ให้ AI สร้างตาราง ถามข้อมูล และดูการตั้งค่าโปรเจกต์ในฐานข้อมูล Supabase ของคุณ

โดย supabaseใช้กันมาก↓ 235.4K/สัปดาห์★ 3Kอัปเดต เมื่อวานซืน

บนเครื่องหรือคลาวด์✓ supabase.com

MongoDB MCP Server

MongoDB Model Context Protocol Server

โดย mongodb-jsใช้กันมาก↓ 157.1K/สัปดาห์★ 1.2Kอัปเดต 4 วันที่ผ่านมา

รันบนเครื่อง

Elasticsearch MCP Server

MCP server for interacting with Elasticsearch

โดย cr7258กำลังโต↓ 2.7K/สัปดาห์★ 315อัปเดต 14 เดือนที่ผ่านมา

รันบนเครื่อง

README จากผู้ทำ

เปิดอ่าน README

ส่วนนี้คัดจาก repo ของผู้ทำตามต้นฉบับ PopNx MCP ไม่ได้ตรวจหรือรับรองเนื้อหา ตัด HTML รูปภาพ และสคริปต์ออกแล้ว ลิงก์จะพาออกนอกเว็บ

🇨🇭 Part of the [Swiss Public Data MCP Portfolio](https://github.com/malkreide)

📊 swiss-statistics-mcp

MCP Server for Swiss Federal Statistical Office (BFS) data via STAT-TAB PxWeb API — 682 datasets across 21 themes, no authentication required

🇩🇪 Deutsche Version


Demo

Maturity

This server is Alpha (0.x) as per the PyPI classifier. Until 1.0:

  • Tool names, input schemas, and output JSON keys MAY change between minor versions
  • Pin cloud deployments to a specific git tag, not main
  • Production use is acceptable for read-only Open Data scenarios; consider it experimental for anything user-facing

See CHANGELOG.md for breaking changes.


Overview

swiss-statistics-mcp provides AI-native access to the Swiss Federal Statistical Office (BFS) via the STAT-TAB PxWeb API, without authentication:

PropertyDetails
APISTAT-TAB PxWeb API v1
Endpointhttps://www.pxweb.bfs.admin.ch/api/v1/
ProviderSwiss Federal Statistical Office (BFS)
Datasets682 tables across 21 thematic areas
LanguagesGerman (de), French (fr), Italian (it), English (en)
LicenceOpen Government Data (OGD) — BFS Terms of Use
AuthenticationNone — fully public

Anchor demo query: *"How many students attended lower secondary schools in the canton of Zurich in 2024?"* — real BFS figures, no hallucination.


Features

  • 📊 15 tools: 8 across 21 statistical themes (682 datasets) + a 4-tool commune/historical reference layer + 2 construction/real-estate tools + a price-index tool
  • 🔍 Full-text search across the entire BFS data catalogue
  • 🎓 Convenience tools for education statistics and population data
  • 🏗️ Construction statistics — new buildings/dwellings and building investment incl. the Arbeitsvorrat leading indicator
  • 🏠 Price indices — construction price index (Baupreisindex, parsed series) and residential property price index (IMPI) via the BFS DAM/CKAN sources
  • 🏔️ Cross-cantonal comparison for any table and variable
  • 🔓 No API key required — all data under open licences
  • ☁️ Dual transport — stdio (Claude Desktop) + Streamable HTTP (cloud)

Prerequisites

  • Python 3.11+
  • uv (recommended) or pip

Installation

# Clone the repository

git clone https://github.com/malkreide/swiss-statistics-mcp.git cd swiss-statistics-mcp

Install

pip install -e .

or with uv:

uv pip install -e .

Or with uvx (no permanent installation):

uvx swiss-statistics-mcp

Quickstart

# stdio (for Claude Desktop)

python -m swiss_statistics_mcp.server

Streamable HTTP, loopback only (default: host=127.0.0.1, port=8000)

python -m swiss_statistics_mcp.server --http --port 8000

Streamable HTTP, all interfaces (only behind a reverse proxy with access control)

MCP_HOST=0.0.0.0 python -m swiss_statistics_mcp.server --http --port 8000

or

python -m swiss_statistics_mcp.server --http --host 0.0.0.0 --port 8000

Try it immediately in Claude Desktop:

*"How many teachers worked in the canton of Zurich in 2023?"*

*"What is the population of canton Bern broken down by age?"*

*"Compare the social assistance rate across all cantons for 2022."*


Configuration

Claude Desktop

Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

{

"mcpServers": { "swiss-statistics": { "command": "python", "args": ["-m", "swiss_statistics_mcp.server"] } } }

Or with uvx:

{

"mcpServers": { "swiss-statistics": { "command": "uvx", "args": ["swiss-statistics-mcp"] } } }

Config file locations:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
Cursor / Windsurf / VS Code + Continue

The configuration syntax is identical to Claude Desktop. The file name depends on the client:

  • Cursor: .cursor/mcp.json in the project folder, or ~/.cursor/mcp.json globally
  • Windsurf: ~/.codeium/windsurf/mcp_config.json
  • VS Code + Continue: .continue/config.json
Cloud Deployment (SSE for browser access)

For use via claude.ai in the browser (e.g. on managed workstations without local software).

⚠️ Security note — this server has no authentication. A public URL

turns it into an open proxy to the BFS API on your deployment's IP. Any

client with the URL can drive the tools, consume your platform quota, and

attribute traffic to your IP. Two mitigations, in order of preference:

1. Put it behind access control — Render's «Private Service», Cloudflare

Access, or a reverse proxy with Basic-Auth / IP allowlist in front of the

container.

2. Accept it as a public open-data proxy — only acceptable because all

data is BFS OGD (Public Open Data) and tools are read-only.

The server binds to 127.0.0.1 by default. To expose it on a container

port you must explicitly set MCP_HOST=0.0.0.0 (e.g. as a Render env var)

or pass --host 0.0.0.0. Do not do this without one of the mitigations above.

Render.com:

  1. Push/fork the repository to GitHub
  2. On render.com: New Web Service → connect GitHub repo
  3. Set environment variable: MCP_HOST=0.0.0.0
  4. Set start command: python -m swiss_statistics_mcp.server --http --port 8000
  5. In claude.ai under Settings → MCP Servers, add: https://your-app.onrender.com/sse

💡 *"stdio for the developer laptop, SSE for the browser."*


Output Schema

Since v0.2.0, every tool returns a typed Pydantic model rather than a JSON string. FastMCP serializes these as structured content so MCP clients can read fields directly.

# Old (pre-0.2.0)

result = await bfs_get_data(...) # str data = json.loads(result) # dict print(data["rows_total"])

New (>= 0.2.0)

result = await bfs_get_data(...) # DataTableResult print(result.rows_total) # 1000 print(result.truncated) # True

Every result carries error: str | None and hint: str | None at the top level — result.error is None means success. Data-returning tools (bfs_get_data, bfs_education_stats, bfs_population, bfs_compare_cantons) additionally expose truncated: bool, rows_total: int, and rows_returned: int for machine-readable cap detection.

ToolResult type
bfs_browse_catalogBrowseCatalogResult
bfs_search_tablesSearchTablesResult
bfs_get_table_metadataTableMetadataResult
bfs_get_dataDataTableResult
bfs_education_statsDataTableResult
bfs_populationDataTableResult
bfs_compare_cantonsDataTableResult
bfs_featured_datasetsFeaturedDatasetsResult
lookup_communeLookupCommuneResult
resolve_historical_communeResolveHistoricalCommuneResult
list_communesListCommunesResult
search_historical_seriesSearchHistoricalSeriesResult
bfs_construction_activityConstructionActivityResult
bfs_construction_investmentConstructionInvestmentResult
bfs_price_indexPriceIndexResult

Reference-layer results additionally carry source (attribution) and provenance (live_api \| cached); SearchHistoricalSeriesResult also carries licence_note with the mandatory HSSO NonCommercial notice. The construction and price-index results carry source + provenance on the same envelope pattern.


Available Tools

ToolDescription
bfs_featured_datasetsCurated list of highly relevant datasets (focus on education and demographics)
bfs_browse_catalogBrowse the catalogue: all 21 themes (no theme_code), or all tables in a theme (e.g. theme_code="15" = Education and Science)
bfs_search_tablesFull-text search across the entire data catalogue (682 datasets)
bfs_get_table_metadataVariables, values and metadata for a specific table
bfs_get_dataData retrieval with optional filters by dimensions and values
bfs_education_statsConvenience tool: teachers, pupils, demographic scenarios, scholarships
bfs_populationResident population by canton, year, age structure or sex
bfs_compare_cantonsCross-cantonal comparison for any table and any variable
lookup_communeResolve a commune by name or BFS number as of a given date (canton, validity, LINDAS URI)
resolve_historical_communeMap a historical BFS number onto today's number(s) — re-key old statistics across fusions
list_communesList all communes of a canton as of a given date
search_historical_seriesSearch long-run time series in Historical Statistics of Switzerland (HSSO)
bfs_construction_activityNew buildings & dwellings per commune (yearly), incl. dwelling room-size mix
bfs_construction_investmentBuilding investment & Arbeitsvorrat (leading indicator) by region/canton/commune
bfs_price_indexConstruction price index (Baupreisindex, parsed series) / residential property price index (IMPI, source links)

Four of these tools form the reference layer of the portfolio (see Join Keys): they turn official BFS commune numbers into a reliable join key and let you re-key statistics that predate a municipal merger. The two bfs_construction_* tools cover STAT-TAB theme 09 (Bau- und Wohnungswesen) — see Construction sources. bfs_price_index covers price indices that are not in STAT-TAB — see Price-index sources.

Construction sources
Cube IDTitleCoverageUsed by
px-x-0904030000_106Neu erstellte Gebäude mit Wohnungen nach Gemeinde, Gebäudetyp2013–bfs_construction_activity
px-x-0904030000_105Neu erstellte Wohnungen nach Gemeinde, Anzahl Zimmer2013–bfs_construction_activity
px-x-0904010000_205Bauinvestitionen und Arbeitsvorrat nach Grossregion/Kanton/Gemeinde1994–bfs_construction_investment

The pre-2013 Gemeinde-level building series lives in the discontinued cubes px-x-0904030000_101/_104 (1995–2012), which use a different geo coding and are not queried by these tools. Building/dwelling figures are the consolidated official yearly statistics — for up-to-date register states and the construction pipeline, cross-validate against swiss-housing-mcp (deliberate redundancy).

Price-index sources

bfs_price_index covers two indices that are not published via STAT-TAB. Their datasets live on opendata.swiss (CKAN); the data files themselves are BFS DAM assets.

IndexSourceReturns

| baupreisindex | opendata.swiss dataset *Schweizerischer Baupreisindex (Multibasen)* → DAM XLSX asset | Parsed national semi-ann

ตัดมาแค่ช่วงต้น อ่านต่อใน repo

ถาม PopNx