Apiverket MCP Server
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
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
| Tool | Purpose |
|------|---------|
| govdata_discover | Search and browse supported Apiverket endpoints before choosing a path |
| govdata_query | Call a discovered endpoint and return structured JSON or recovery guidance |
| govdata_account | Inspect 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
Cursor / VS Code
Gemini CLI-Style MCP Config
Keys And Limits
| Variable | Default | Description |
|----------|---------|-------------|
| GOVDATA_API_URL | https://apiverket.se | Apiverket API base URL |
| GOVDATA_API_KEY | sk_test_demo | Sandbox 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