{
  "markdown": "# Apiverket MCP Server\n\n<!-- mcp-name: io.github.vinvuk/apiverket-mcp -->\n\nAn MCP (Model Context Protocol) server that gives AI assistants access to Swedish public data through the [Apiverket API](https://apiverket.se). It works with Claude Code, Claude Desktop, Cursor, VS Code, Gemini CLI-style MCP clients, and other MCP-compatible tools.\n\n## What it does\n\n| Tool | Purpose |\n|------|---------|\n| `govdata_discover` | Search and browse supported Apiverket endpoints before choosing a path |\n| `govdata_query` | Call a discovered endpoint and return structured JSON or recovery guidance |\n| `govdata_account` | Inspect sanitized key mode, tier, daily usage, company-search/company-lookup quota, and upgrade-relevant limits |\n\nAgents 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`.\n\n## How Agents Should Use Apiverket\n\n1. Discover: call `govdata_discover` with the user's topic, not a guessed path.\n2. Check context: call `govdata_account` for quota, tier, and production-readiness questions.\n3. Query: call `govdata_query` only with a supported endpoint returned by discovery.\n4. Recover: if a request fails, use the structured recovery guidance before retrying.\n\nDiscovery 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.\n\n## Quick Start\n\n### Claude Code / Claude Desktop\n\n```json\n{\n  \"mcpServers\": {\n    \"apiverket\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"apiverket-mcp-server\"],\n      \"env\": {\n        \"GOVDATA_API_URL\": \"https://apiverket.se\",\n        \"GOVDATA_API_KEY\": \"sk_test_demo\"\n      }\n    }\n  }\n}\n```\n\n### Cursor / VS Code\n\n```json\n{\n  \"servers\": {\n    \"apiverket\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"apiverket-mcp-server\"],\n      \"env\": {\n        \"GOVDATA_API_URL\": \"https://apiverket.se\",\n        \"GOVDATA_API_KEY\": \"sk_test_demo\"\n      }\n    }\n  }\n}\n```\n\n### Gemini CLI-Style MCP Config\n\n```json\n{\n  \"mcpServers\": {\n    \"apiverket\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"apiverket-mcp-server\"],\n      \"env\": {\n        \"GOVDATA_API_URL\": \"https://apiverket.se\",\n        \"GOVDATA_API_KEY\": \"sk_test_demo\"\n      }\n    }\n  }\n}\n```\n\n## Keys And Limits\n\n| Variable | Default | Description |\n|----------|---------|-------------|\n| `GOVDATA_API_URL` | `https://apiverket.se` | Apiverket API base URL |\n| `GOVDATA_API_KEY` | `sk_test_demo` | Sandbox key by default. Use a `sk_live_*` key from Apiverket for real production data. |\n\n`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.\n\n## Company Data With Agents\n\nCompany search and company lookup have different jobs:\n\n1. Use `govdata_discover(query: \"company\")` to find the supported company endpoints.\n2. Use `/v1/companies/search` when the user only has a company name or uncertain organisation number.\n3. Cache the returned `org_number`.\n4. Use `/v1/companies/{orgNumber}` for repeated enrichment and automation.\n5. If company search returns 429, stop retrying until `reset_at`; use lookup when org numbers are already known.\n\nCompany 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.\n\n## Common Family Workflows\n\n| Family | Good first query | Agent workflow |\n|--------|------------------|----------------|\n| Transport | `govdata_discover(query: \"train departures\")` | Use station codes for `/v1/transport/trains/{station}`; use stop IDs for `/v1/transit/departures`; list datasets before transport statistics. |\n| Weather | `govdata_discover(query: \"weather forecast\")` | Use city endpoints for simple weather, warnings for national alerts, and station/lat/lon flows for air quality or observations. |\n| Geography & municipalities | `govdata_discover(query: \"municipality population\")` | Find official municipality/county/place codes first; search KPIs before municipality KPI detail calls; request geometry only when needed. |\n| Jobs | `govdata_discover(query: \"jobs taxonomy\")` | Use `/v1/jobs/search` for ordinary search; use taxonomy types/concepts/autocomplete for controlled filters. |\n| Government & safety | `govdata_discover(query: \"parliament documents\")` | Choose calendar, documents, members, committees, SFS, SOU, police events, or police stations based on the question. |\n| Culture, education & environment | `govdata_discover(query: \"school search\")` | Search first, then reuse returned IDs/codes for detail endpoints; ensure `q`, municipality, type, or coordinates are present. |\n\n## Tool Examples\n\n```text\n# Discover endpoints\ngovdata_discover(query: \"electricity prices\")\ngovdata_discover(category: \"Weather & Climate\")\ngovdata_discover(query: \"train departures\")\ngovdata_discover(query: \"municipality KPI\")\ngovdata_discover(query: \"jobs taxonomy\")\n\n# Query data after discovery\ngovdata_query(endpoint: \"/v1/weather/{city}\", path_params: {city: \"stockholm\"})\ngovdata_query(endpoint: \"/v1/transport/trains/{station}\", path_params: {station: \"Cst\"})\ngovdata_query(endpoint: \"/v1/jobs/search\", query_params: {q: \"developer\", limit: 5})\ngovdata_query(endpoint: \"/v1/taxonomy/types\")\ngovdata_query(endpoint: \"/v1/companies/search\", query_params: {q: \"volvo\", limit: 10})\ngovdata_query(endpoint: \"/v1/companies/{orgNumber}\", path_params: {orgNumber: \"5560125790\"})\n\n# Inspect tier and quota state\ngovdata_account()\n```\n\n## Build From Source\n\n```bash\ngit clone https://github.com/vinvuk/apiverket-mcp.git\ncd apiverket-mcp\nnpm install\nnpm run build\n```\n\n## How It Works\n\n1. The MCP server runs locally over stdio.\n2. `govdata_discover` searches the built-in endpoint catalog without an API call.\n3. `govdata_query` calls Apiverket with the configured API key.\n4. Structured API errors are turned into recovery guidance for agents.\n5. Large responses are truncated with pagination guidance.\n\n## Requirements\n\n- Node.js >= 18\n- An Apiverket API key, or `sk_test_demo` for sandbox setup\n\n## License\n\nMIT\n",
  "bytes": 6589,
  "sha": "c15b594419ca99d81f56451efe3ad109dbe6615e2db31c647d3f24f03661260c",
  "repo_slug": "vinvuk/apiverket-mcp",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_vinvuk_apiverket_mcp_3a2e7eba/readme"
}