sek-fx-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@sek-fx-mcpWhat's the exchange rate for EUR to SEK?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
sek-fx-mcp
En MCP-server (Model Context Protocol) skriven i Python som låter en LLM slå upp växlingskursen för en valuta mot svenska kronor.
Servern kontaktar Riksbankens API och hämtar senaste mittkurs (PMI) för en valuta. Den accepterar ISO 4217-koden för valutor dvs NOK (norska kronor), EUR (Euro), GBP (brittiska pund) etc. Svaret är strukturerat och anger priset i SEK för en enhet av valutan samt vilket datum kursen publicerades. Kurser publiceras bankdagar, så datumet kan vara tidigare än dagens.
Kräver Python 3.14 och uv. Testad i Claude Desktop i macOS.
Installation
Claude Desktop:
uv run mcp install server.pyClaude Code:
claude mcp add sek-fx -- uv run --directory /sökväg/till/sek-fx-mcp server.pyServern kan också startas direkt (stdio) med uv run server.py.
Related MCP server: Traktamente MCP Server
API-nyckel
Utan API-nyckel begränsar Riksbanken antalet anrop från samma ip-adress (5 anrop per minut och maximalt 1000 anrop per dygn). Med en nyckel kan du göra 200 anrop per minut, med ett tak på 30 000 anrop per vecka.
Så skaffar du en nyckel:
Gå till Riksbankens API-portal, välj Sign Up uppe till höger och registrera dig.
Gå till fliken Products och skapa en subscription.
Nycklarna visas under fliken Profile som Primary och Secondary key. Du kan använda vilken som helst av dem.
Observera att testmiljön (developer.api-test.riksbank.se) och produktionsmiljön (developer.api.riksbank.se) har olika nycklar. Servern använder produktionsmiljön.
Sätt nyckeln i miljövariabeln RIKSBANKEN_API_KEY, så skickas den i headern Ocp-Apim-Subscription-Key:
uv run mcp install server.py -v RIKSBANKEN_API_KEY=<din-nyckel>
# eller
claude mcp add sek-fx -e RIKSBANKEN_API_KEY=<din-nyckel> -- uv run --directory /sökväg/till/sek-fx-mcp server.pyUtveckling
uv run pytest # tester, Riksbankens API mockas
uv run ruff check .
uv run ruff format .
uv run mcp dev server.py # MCP InspectorVidare läsning:
https://en.wikipedia.org/wiki/ISO_4217
https://github.com/modelcontextprotocol/python-sdk
https://www.riksbank.se/sv/statistik/rantor-och-valutakurser/hamta-rantor-och-valutakurser-via-api/
Available Tools
1 toolfetch_fxSEK exchange rateARead-only
Fetch the latest exchange rate from some currency to SEK using the API from Riksbanken.
Returns Riksbanken's daily mid-rate (PMI) as the price in SEK of 1 unit of the currency. The rate is published on banking days, so the date may be earlier than today.
Args: currency: 3-letter ISO 4217 currency code (e.g. USD, EUR)
| Name | Required | Description | Default |
|---|---|---|---|
| currency | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| date | Yes | Date the rate was published by Riksbanken |
| currency | Yes | ISO 4217 code of the quoted currency |
| sek_per_unit | Yes | Price in SEK of 1 unit of the currency |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint and openWorldHint, so the safety profile is covered; the description adds genuinely useful behavior beyond that — the mid-rate (PMI) basis, the SEK-per-1-unit orientation, and the staleness caveat that the returned date may lag today. It stops short of noting error behavior for unsupported currencies.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Front-loaded with the purpose, then return semantics, then the argument spec — a sensible ordering with no filler. The "using the API from Riksbanken" clause is mildly redundant with the following sentence naming Riksbanken again.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a single-parameter read tool, the definition covers purpose, rate semantics, publication cadence, date staleness, and argument format; an output schema exists, so return structure needs no further explanation. Nothing an agent needs to invoke it is missing.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 0%, so the description carries the burden and largely does: it specifies the 3-letter ISO 4217 format and gives concrete examples (USD, EUR), which is what an agent needs to call it correctly. Minor gaps remain, such as what happens with unsupported or lowercase codes.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
"Fetch the latest exchange rate from some currency to SEK" gives a specific verb (fetch), resource (exchange rate) and direction (X to SEK), plus the data source (Riksbanken). An agent knows exactly what this returns without opening the schema.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Usage is implied rather than stated: the description notes the rate is published on banking days and may be dated earlier than today, which tells the agent this is a latest-only, non-historical read. There is no explicit when-to-use/when-not framing, though no sibling alternatives exist to route away from.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
1 tool update
v0.1.0- First observed
fetch_fx
TDQS
Scored across 1 tool
With only one tool, there is no overlapping purpose or selection ambiguity. fetch_fx clearly covers FX-to-SEK retrieval.
The lone tool uses a clear verb_abbreviation pattern, fetch_fx. There are no mixed conventions or competing styles to create inconsistency.
The single tool matches the narrow purpose of a SEK FX-rate server without redundant operations. It is minimal, but well-scoped for the stated domain.
The stated core operation, fetching the latest currency-to-SEK mid-rate, is covered. Minor optional additions such as listing supported currencies or querying historical rates are absent but not essential.
Maintenance
Related MCP Connectors
Exchange rates for about 150 currencies from central banks (ECB and others). Free, no key.
Official ECB euro reference rates for invoices and tax returns. $0.004/call via x402.
Fetch latest and historical currency exchange rates from Frankfurter. Convert amounts between curr…
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceProvides real-time and historical foreign exchange rates for 31+ currencies, enabling currency conversion, historical rate lookups, and time series analysis using data from the Frankfurter API.-
- AlicenseNot gradedqualityDmaintenanceProvides access to Swedish per diem (traktamente) rates from Skatteverket's official API, enabling queries by country, year, or country code for international travel expense calculations.6 npm1MIT
- AlicenseNot gradedqualityDmaintenanceProvides current exchange rates for various currencies via the Model Context Protocol, allowing AI models to fetch real-time currency data.MIT
- FlicenseNot gradedqualityDmaintenanceEnables fetching real-time exchange rates between currencies and listing supported currency codes using the Frankfurter API.-