Riksbanken MCP Server
An MCP Server for Riksbank data (monetary policy, SWEA, SWESTR)
aerugo
README
Riksbanken MCP Server
An MCP Server for accessing macroeconomic and financial data from the Riksbank. This server provides tools for retrieving data about monetary policy forecasts, exchange and interest rate data (via SWEA), and short-term money market rates (via SWESTR). It is built using asynchronous programming with httpx
and uses pydantic
for data validation.
Features
-
Monetary Policy Tools
- List all monetary policy rounds.
- Retrieve forecast data for key economic indicators (GDP, unemployment, CPI, CPIF, CPIF ex-energy, hourly labour cost, wages (NA and NMO), population, employment, labour force).
-
SWEA Tools
- Fetch the official policy (repo) rate.
- Retrieve exchange rate series (USD/SEK, EUR/SEK, GBP/SEK).
- Retrieve average mortgage interest rates.
-
SWESTR Tools
- Retrieve daily SWESTR (Swedish Short Term Rate) and its latest published value.
- Retrieve compounded averages (e.g., 1-week, 1-month).
-
Modern, Asynchronous, and Type-Safe
- Fully asynchronous, using Python 3.13's async/await and
httpx
for network requests. - Uses
pydantic
models for robust data validation and self-documenting API responses.
- Fully asynchronous, using Python 3.13's async/await and
Installation
Ensure you have Python 3.13 or higher installed. Then, install the package in editable mode:
pip install -e .
This will install the required dependencies as specified in pyproject.toml
(including mcp
, httpx
, and pydantic
).
Running the Server
Using the CLI
After installation, you can launch the MCP server with the CLI command:
riksbanken-mcp
Via Python Module
Alternatively, run the server directly using:
python -m riksbank_mcp.server
The server uses the stdio transport to communicate and registers all MCP tools.
Repository Structure
riksbank_mcp/
├── __init__.py # Package version and initialization
├── server.py # Main MCP server entry point and tool registration
├── models.py # Pydantic models for API responses and data validation
├── services/
│ ├── __init__.py # Services package initialization
│ ├── monetary_policy_api.py # Helper for the Monetary Policy API
│ ├── swea_api.py # Helper for the SWEA API
│ └── swestr_api.py # Helper for the SWESTR API
├── tools/
│ ├── __init__.py # Tools package initialization
│ ├── monetary_policy_tools.py # Tools for Monetary Policy data
│ ├── swea_tools.py # Tools for SWEA data (policy rate, exchange rates, mortgage rate)
│ └── swestr_tools.py # Tools for SWESTR data (short term rates and averages)
└── pyproject.toml # Build and dependency configuration
Usage Examples
Example: Fetching GDP Forecast Data
import asyncio
from riksbank_mcp.tools.monetary_policy_tools import get_gdp_data
async def main():
# Retrieve forecast data for GDP for a specific policy round.
gdp_forecast = await get_gdp_data("2023:4")
for obs in gdp_forecast.observations:
print(f"Date: {obs.date}, GDP forecast: {obs.value} (billion SEK)")
asyncio.run(main())
Example: Retrieving the Latest SWESTR Rate
import asyncio
from riksbank_mcp.tools.swestr_tools import get_latest_swestr
async def main():
latest = await get_latest_swestr()
print(f"Latest SWESTR: {latest.date} - {latest.value}%")
asyncio.run(main())
Example: Retrieving USD/SEK Exchange Rates
import asyncio
from riksbank_mcp.tools.swea_tools import get_usd_exchange_rate
async def main():
usd_data = await get_usd_exchange_rate()
for obs in usd_data.observations[-5:]:
print(f"{obs.date}: {obs.value} SEK per USD")
asyncio.run(main())
Testing
We use pytest
along with pytest-asyncio
for testing. Run the test suite using:
pytest
Contributing
Contributions are welcome! When submitting changes, please adhere to the following principles:
- Follow PEP 8 and Python 3.13's type hinting conventions.
- Use asynchronous programming consistently.
- Update docstrings and Pydantic models accordingly.
- Ensure new tools or changes are covered with tests.
License
This project is licensed under the MIT License. See LICENSE for details.
Additional Resources
Recommended Servers
Crypto Price & Market Analysis MCP Server
A Model Context Protocol (MCP) server that provides comprehensive cryptocurrency analysis using the CoinCap API. This server offers real-time price data, market analysis, and historical trends through an easy-to-use interface.
MCP PubMed Search
Server to search PubMed (PubMed is a free, online database that allows users to search for biomedical and life sciences literature). I have created on a day MCP came out but was on vacation, I saw someone post similar server in your DB, but figured to post mine.
dbt Semantic Layer MCP Server
A server that enables querying the dbt Semantic Layer through natural language conversations with Claude Desktop and other AI assistants, allowing users to discover metrics, create queries, analyze data, and visualize results.
mixpanel
Connect to your Mixpanel data. Query events, retention, and funnel data from Mixpanel analytics.

Sequential Thinking MCP Server
This server facilitates structured problem-solving by breaking down complex issues into sequential steps, supporting revisions, and enabling multiple solution paths through full MCP integration.

Nefino MCP Server
Provides large language models with access to news and information about renewable energy projects in Germany, allowing filtering by location, topic (solar, wind, hydrogen), and date range.
Vectorize
Vectorize MCP server for advanced retrieval, Private Deep Research, Anything-to-Markdown file extraction and text chunking.
Mathematica Documentation MCP server
A server that provides access to Mathematica documentation through FastMCP, enabling users to retrieve function documentation and list package symbols from Wolfram Mathematica.
kb-mcp-server
An MCP server aimed to be portable, local, easy and convenient to support semantic/graph based retrieval of txtai "all in one" embeddings database. Any txtai embeddings db in tar.gz form can be loaded
Research MCP Server
The server functions as an MCP server to interact with Notion for retrieving and creating survey data, integrating with the Claude Desktop Client for conducting and reviewing surveys.