MCP server for Swedish statistical data discovery and export
Project description
Data Platform MCP Server
MCP (Model Context Protocol) server for AI agents to discover, fetch, and export Swedish statistical data.
Tools
- discover_datasets - AI-powered smart search for datasets
- get_dataset_details - Get measures, breakdowns, and time ranges
- fetch_data - Fetch actual data rows for direct answers
- build_export_link - Generate CSV/JSON download links
- build_session_link - Deep link to preload data in the app
In Apps SDK-compatible clients, discover_datasets also exposes a card-based widget with:
- dataset cards,
- field inspection (measures + breakdowns + time),
- quick line-chart visualization (with bar fallback),
- loading metrics into a working session before opening the app.
Installation
The package is available on PyPI and installs automatically via uvx:
# No manual installation needed - uvx handles it automatically
# Just add to your MCP client config (see below)
For development:
cd backend/mcp-server
pip install -e .
Usage with MCP Clients
Add to your MCP client config:
Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"utforska-data": {
"command": "uvx",
"args": ["utforska-data-mcp"]
}
}
}
Windsurf (~/.codeium/windsurf/mcp_config.json):
{
"mcpServers": {
"utforska-data": {
"command": "uvx",
"args": ["utforska-data-mcp"]
}
}
}
Cursor/Cline: Same configuration format.
The package installs automatically on first use. No manual installation required!
Configuration
The server connects to the production backend automatically (https://utforskadata.se). No extra configuration is needed for normal use.
For remote/Apps SDK usage, you can run the Streamable HTTP entrypoint:
cd backend/mcp-server
uv run utforska-data-mcp-http
Default endpoint is http://localhost:8080/mcp with health at http://localhost:8080/health.
For connector clients, prefer the explicit trailing-slash URL: http://localhost:8080/mcp/.
Optional environment variables:
MCP_BACKEND_URL(defaulthttps://utforskadata.se)MCP_APP_URL(defaulthttps://utforskadata.se)MCP_DEFAULT_LANG(defaultsv)MCP_HTTP_HOST(default0.0.0.0)MCP_HTTP_PORT(default8080)MCP_HTTP_PATH(default/mcp)MCP_HTTP_STATELESS(defaulttrue)MCP_HTTP_JSON_RESPONSE(defaultfalse)
For ChatGPT connector compatibility, keep MCP_HTTP_STATELESS=true unless you have a specific reason to require stateful transport.
If you have a local shell override like MCP_BACKEND_URL=http://localhost:8000, unset it when testing production behavior.
Example Flows
Quick Answer
discover_datasets("housing prices in Sweden")get_dataset_details(dataset_id)- check measures/breakdownsfetch_data(dataset_id, measure="Average price")- get data- Answer the question with the data
- Offer
build_export_link()and thesession_linkfromdiscover_datasets
Deep Dive
- Same as above
build_session_link(selections=[...])- create link to continue in app
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file utforska_data_mcp-1.0.2.tar.gz.
File metadata
- Download URL: utforska_data_mcp-1.0.2.tar.gz
- Upload date:
- Size: 25.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4fa8201099ff5fa8fd27aef356f3394e566e94540a56965939eb68380d0d9ba3
|
|
| MD5 |
cf09563d492d13c3a53c987714513426
|
|
| BLAKE2b-256 |
51bbc5aa6bb12d4972152410cd88ad829337a2dafe47520cadd77a51a022b236
|
File details
Details for the file utforska_data_mcp-1.0.2-py3-none-any.whl.
File metadata
- Download URL: utforska_data_mcp-1.0.2-py3-none-any.whl
- Upload date:
- Size: 32.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
674fcde76c800ce4daabe6de0d4b01f4b4c1268fdcc247c4ab688c2499db7214
|
|
| MD5 |
eb4ec3aef974ff845346a494feb584c4
|
|
| BLAKE2b-256 |
481259182e1b7ccd8ed2718eed342f220f24b751e75054f0f9877ed72d63a72a
|