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 分