Apiverket

io.github.vinvuk由 GitHub 帳號 vinvuk 發布v1.0.0更新於 Nov 3, 2026

Query Swedish public data: companies, SCB statistics, weather, transport, and more.

概覽

AI 產生的概覽

本機 MCP 伺服器,讓助理透過 Apiverket API 探索並查詢瑞典公開資料,涵蓋企業、SCB 統計、天氣、交通等。

可以做什麼
  • 依主題或類別搜尋並瀏覽內建的 Apiverket 端點目錄,並取得代碼、座標、日期格式與分頁的工作流程說明
  • 呼叫已探索到的端點並取回結構化 JSON,發生錯誤時提供復原建議,回應過大時提供截斷與分頁提示
  • 檢視目前金鑰的模式、方案等級、每日用量,以及企業搜尋與企業查詢的剩餘配額
  • 涵蓋交通、天氣、地理與市政、就業、政府、文化、教育與環境等資料家族
適用情境
適合助理需要瑞典公部門或企業資料時使用,例如火車時刻、天氣、市政統計、議會文件、職缺或組織編號查詢,並希望透過單一 API 取得而非臨時爬取。
執行需求
透過 npx 以 stdio 在本機執行,需要 Node.js 18 以上版本。需在 GOVDATA_API_KEY 提供 Apiverket API 金鑰;預設的 sk_test_demo 僅回傳沙箱資料,正式資料需使用正式金鑰。GOVDATA_API_URL 用於設定 API 基礎位址。需要可連線至 Apiverket API 的網路。
安裝前請注意
API 金鑰以環境變數傳入並送往 Apiverket;測試時請使用沙箱金鑰,避免把正式金鑰寫進共用設定。查詢與其參數會傳送至第三方 API。依方案等級有每日 API 與企業搜尋配額,配額不足時會建議升級。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Apiverket,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

Apiverket MCP Server

An MCP (Model Context Protocol) server that gives AI assistants access to Swedish public data through the Apiverket API. It works with Claude Code, Claude Desktop, Cursor, VS Code, Gemini CLI-style MCP clients, and other MCP-compatible tools.

What it does

ToolPurpose
govdata_discoverSearch and browse supported Apiverket endpoints before choosing a path
govdata_queryCall a discovered endpoint and return structured JSON or recovery guidance
govdata_accountInspect sanitized key mode, tier, daily usage, company-search/company-lookup quota, and upgrade-relevant limits

Agents should call govdata_discover before govdata_query instead of guessing /v1 paths. After a 429 or when a user asks about limits, agents should call govdata_account.

How Agents Should Use Apiverket

  1. Discover: call govdata_discover with the user's topic, not a guessed path.
  2. Check context: call govdata_account for quota, tier, and production-readiness questions.
  3. Query: call govdata_query only with a supported endpoint returned by discovery.
  4. Recover: if a request fails, use the structured recovery guidance before retrying.

Discovery includes family workflows for transport, weather, geography, municipalities, jobs, government, culture, education, tourism, environment, and company data. These workflows explain search/list/detail patterns, required codes, coordinates, date formats, pagination, and common recovery steps.

Quick Start

Claude Code / Claude Desktop

json
{  "mcpServers": {    "apiverket": {      "command": "npx",      "args": ["-y", "apiverket-mcp-server"],      "env": {        "GOVDATA_API_URL": "https://apiverket.se",        "GOVDATA_API_KEY": "sk_test_demo"      }    }  }}

Cursor / VS Code

json
{  "servers": {    "apiverket": {      "command": "npx",      "args": ["-y", "apiverket-mcp-server"],      "env": {        "GOVDATA_API_URL": "https://apiverket.se",        "GOVDATA_API_KEY": "sk_test_demo"      }    }  }}

Gemini CLI-Style MCP Config

json
{  "mcpServers": {    "apiverket": {      "command": "npx",      "args": ["-y", "apiverket-mcp-server"],      "env": {        "GOVDATA_API_URL": "https://apiverket.se",        "GOVDATA_API_KEY": "sk_test_demo"      }    }  }}

Keys And Limits

VariableDefaultDescription
GOVDATA_API_URLhttps://apiverket.seApiverket API base URL
GOVDATA_API_KEYsk_test_demoSandbox key by default. Use a sk_live_* key from Apiverket for real production data.

sk_test_demo is for setup and safe sandbox responses. It is useful for checking that your MCP client is wired correctly, but production workflows should use a live key. Free live keys are good for exploration; upgrade when daily API or company-search limits block a real workflow.

Company Data With Agents

Company search and company lookup have different jobs:

  1. Use govdata_discover(query: "company") to find the supported company endpoints.
  2. Use /v1/companies/search when the user only has a company name or uncertain organisation number.
  3. Cache the returned org_number.
  4. Use /v1/companies/{orgNumber} for repeated enrichment and automation.
  5. If company search returns 429, stop retrying until reset_at; use lookup when org numbers are already known.

Company search and live company lookup have separate daily quota context by tier. govdata_account shows the configured key tier, remaining company-search quota, remaining company-lookup quota, reset time, and available upgrade tiers. Apiverket does not expose company board, officer, owner, or UBO subresource paths through the company API.

Common Family Workflows

FamilyGood first queryAgent workflow
Transportgovdata_discover(query: "train departures")Use station codes for /v1/transport/trains/{station}; use stop IDs for /v1/transit/departures; list datasets before transport statistics.
Weathergovdata_discover(query: "weather forecast")Use city endpoints for simple weather, warnings for national alerts, and station/lat/lon flows for air quality or observations.
Geography & municipalitiesgovdata_discover(query: "municipality population")Find official municipality/county/place codes first; search KPIs before municipality KPI detail calls; request geometry only when needed.
Jobsgovdata_discover(query: "jobs taxonomy")Use /v1/jobs/search for ordinary search; use taxonomy types/concepts/autocomplete for controlled filters.
Government & safetygovdata_discover(query: "parliament documents")Choose calendar, documents, members, committees, SFS, SOU, police events, or police stations based on the question.
Culture, education & environmentgovdata_discover(query: "school search")Search first, then reuse returned IDs/codes for detail endpoints; ensure q, municipality, type, or coordinates are present.

Tool Examples

text
# Discover endpointsgovdata_discover(query: "electricity prices")govdata_discover(category: "Weather & Climate")govdata_discover(query: "train departures")govdata_discover(query: "municipality KPI")govdata_discover(query: "jobs taxonomy")
# Query data after discoverygovdata_query(endpoint: "/v1/weather/{city}", path_params: {city: "stockholm"})govdata_query(endpoint: "/v1/transport/trains/{station}", path_params: {station: "Cst"})govdata_query(endpoint: "/v1/jobs/search", query_params: {q: "developer", limit: 5})govdata_query(endpoint: "/v1/taxonomy/types")govdata_query(endpoint: "/v1/companies/search", query_params: {q: "volvo", limit: 10})govdata_query(endpoint: "/v1/companies/{orgNumber}", path_params: {orgNumber: "5560125790"})
# Inspect tier and quota stategovdata_account()

Build From Source

bash
git clone https://github.com/vinvuk/apiverket-mcp.gitcd apiverket-mcpnpm installnpm run build

How It Works

  1. The MCP server runs locally over stdio.
  2. govdata_discover searches the built-in endpoint catalog without an API call.
  3. govdata_query calls Apiverket with the configured API key.
  4. Structured API errors are turned into recovery guidance for agents.
  5. Large responses are truncated with pagination guidance.

Requirements

  • Node.js >= 18
  • An Apiverket API key, or sk_test_demo for sandbox setup

License

MIT

來源:README.md,提交 945a010

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v1.0.0最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分