KI-agentar
Bruk opne data frå regjeringa.no i KI-agentar som GitHub Copilot, Claude og Cursor.
Kva er MCP-serveren og ferdigheitene?
MCP-serveren gir agenten verktøy for å søkje i og lese data frå API-a våre, til dømes høyringar, kalenderhendingar og Offisielt frå statsrådet. MCP (Model Context Protocol) er ein open standard for å kople KI-agentar til datakjelder.
Ferdigheitene (Skills) er ferdige oppskrifter som lærer agenten når og korleis han skal bruke verktøya, til dømes å finne rett datasett eller undersøkje ei høyring.
Kom i gang i tre steg
Adressene peikar på testmiljøet. Nøklar frå testmiljøet verkar berre der.
1. Hent ein API-nøkkel
Alle verktøya treng ein API-nøkkel, også katalogen over datasett. Hent ein API-nøkkel på framsida.
2. Installer MCP-serveren
Vel agenten din. MCP-serveren krev nøkkelen i kvar førespurnad, så alle oppsetta under tek han med. Nøkkelen blir lagd inn i agenten, ikkje i filer du deler med andre.
Knappane for VS Code og Cursor opnar programmet på maskina di. VS Code spør etter nøkkelen og lagrar han trygt. Cursor les nøkkelen frå miljøvariabelen REGJERINGEN_API_KEY. GitHub Copilot CLI brukar ikkje nøkkelen VS Code har lagra, heller ikkje når du køyrer Copilot CLI-økter i VS Code. Legg til serveren med kommandoen for Copilot CLI.
Claude Code
claude mcp add --transport http --scope user regjeringen-open-data \
https://api.test.data.regjeringen.no/mcp \
--header "Ocp-Apim-Subscription-Key: <your-key>"GitHub Copilot CLI
copilot mcp add --transport http regjeringen-open-data \
https://api.test.data.regjeringen.no/mcp \
--header "Ocp-Apim-Subscription-Key: <your-key>"mcp.json (VS Code)
{
"inputs": [
{
"type": "promptString",
"id": "regjeringen-subscription-key",
"description": "data.regjeringen.no Subscription Key",
"password": true
}
],
"servers": {
"regjeringen-open-data": {
"type": "http",
"url": "https://api.test.data.regjeringen.no/mcp",
"headers": {
"Ocp-Apim-Subscription-Key": "${input:regjeringen-subscription-key}"
}
}
}
}3. Legg til ferdigheitene
Køyr kommandoen i prosjektet ditt for å installere ferdigheitene i agenten:
npx skills add https://test.data.regjeringen.noHar du alt installert ferdigheitene? Køyr kommandoen over på nytt for å få nye og oppdaterte ferdigheiter, eller oppdater dei du har:
npx skills updateVerktøy
Verktøya MCP-serveren tilbyr, gruppert etter API. Skildringane er på engelsk.
Kalenderhendingar
list_calendar_events: List events from the government calendar: visits, meetings and speeches by ministers, with time, place, ministry, owners and participants.
Innhaldsoversyn
search_documents: Search content published on regjeringen.no (press releases, white papers, propositions, NOUs, speeches …) by date, content type, owner and publisher.list_document_filters: List the valid content types, owners and publishers to filter search_documents by.
Datakatalog (DCAT)
list_datasets: List the datasets in the regjeringen.no open-data dcat catalogue, with keywords, access rights and the REST API endpoint of each.
Organisasjonsinformasjon
list_ministries: List the ministries (departementer) with their departments, to resolve ministry names and short names.
Offisielt frå statsrådet
list_council_announcements: List "Offisielt fra statsråd" announcements, the official record of each Council of State meeting, newest first.get_statsrad_announcement: Read one "Offisielt fra statsråd" announcement with its decisions as plain text, in Norwegian as published.
Høyringar og innspel – publiserte svar
search_hearings: Search public consultations (høringer) and submissions (innspill), with their Document state and response deadline.get_hearing: Read one consultation: ministry, case number, deadline, and the hearing letter, memo and consultation bodies as plain text.list_hearing_responses: List the published responses (høringssvar) to one consultation: sender, sender type, response type and when it was last changed.get_hearing_response: Read one published response to a consultation as plain text, with attachment links.
Ferdigheiter
Ferdigheitene som kan installerast no. Skildringane er på engelsk.
connect: Connect an AI agent (VS Code / GitHub Copilot, Claude Code, Cursor) to the regjeringen.no open-data Custom MCP server and add a Subscription Key. Use when the Developer wants to set up, install or troubleshoot the regjeringen.no MCP server, get an API key (Instant key), or asks why a tool says a Subscription Key is missing or rejected. Developers may ask in Norwegian (e.g. "koble til", "API-nøkkel").discover-datasets: Find which regjeringen.no open-data dataset and REST API can answer a question, using the dcat catalogue ("Regjeringens åpne data") on the regjeringen.no Custom MCP server. Use when the Developer asks what data the Norwegian government publishes, where to find hearings (høringer), calendar events, decisions from the Council of State (statsråd), government content or ministry information, or which API to call. Developers may ask in Norwegian.government-calendar: Follow what the Norwegian government does and decides with the regjeringen.no Custom MCP server - the government calendar ("Kalenderhendelser" - ministers' visits, meetings and speeches) and the decisions of the Council of State ("Offisielt fra statsråd" - laws sanctioned and their entry into force, regulations, appointments), plus ministry names from "Departementsinformasjon". Use when the Developer asks what a minister or ministry is doing on a date, what was decided in statsråd, when a law enters into force (ikrafttredelse) or who was appointed (utnevnelser). Needs a Subscription Key. Developers may ask in Norwegian.research-documents: Research documents published on regjeringen.no with the regjeringen.no Custom MCP server - government content ("Innhold fra regjeringen" - press releases, white papers, propositions, NOUs, speeches), filtered by date, content type, owner and publisher. Use when the Developer asks what the government has published on a topic or in a date range. For public consultations (høringer) and høringssvar, use the research-hearings Skill. Needs a Subscription Key. Developers may ask in Norwegian.research-hearings: Research public consultations on regjeringen.no with the regjeringen.no Custom MCP server - høringer and innspill ("Høringer og innspill – publiserte svar"), their hearing letters (høringsbrev), memos (høringsnotat), consultation bodies (høringsinstanser) and the published responses (høringssvar). Use when the Developer asks about a høring or consultation, its Document state, its deadline (svarfrist), who was invited, who answered or what a response said. Needs a Subscription Key. Developers may ask in Norwegian.
Nye og endra verktøy og ferdigheiter står i endringsloggen.