Skip to main content

MCP server for Kolada API

Project description

Kolada MCP Server

https://modelcontextprotocol.io

Question: Where has preschool quality increased the most in Sweden over the past five years?

https://github.com/user-attachments/assets/b44317aa-4280-4be4-b64a-33b9feacc134

Final result after 10 minutes of analysis of Kolada data.

Note: This project is an independent, third-party implementation and is not endorsed by or affiliated with RKA (Council for the Promotion of Municipal Analysis).

The Kolada MCP Server enables seamless integration between Large Language Models (LLMs) and Kolada, Sweden’s comprehensive municipal and regional statistical database. It provides structured access to thousands of Key Performance Indicators (KPIs), facilitating rich, data-driven analysis, comparisons, and explorations of public sector statistics.

Overview

Kolada MCP server acts as an intelligent middleware between LLM-based applications and the Kolada database, allowing users to easily query and analyze data related to Swedish municipalities and regions. With semantic search capabilities and robust analysis tools, the Kolada MCP Server significantly simplifies the task of navigating and interpreting the vast array of KPIs available in Kolada.

Example Usage

Try asking the Kolada MCP Server open questions that will require autonomous reasoning and data analysis, such as:

  • Where in Sweden should a family move to find affordable housing, good schools and good healthcare?
  • Investigate the connection between unemployment and mental illness in Västernorrland
  • Where has the satisfaction with kindergarten increased the most in Sweden in the last five years?
  • Prepare an interactive dashboard to visualize the characteristics of the municipalities in Sweden with the best and worst public transportation systems, among municipalities with a population over 25,000.

Features

  • Semantic Search: Find KPIs based on natural language descriptions.
  • Category Filtering: Access KPIs grouped by thematic categories (e.g., demographics, economy, education).
  • Municipal & Regional Data Retrieval: Fetch precise data points or historical time series.
  • Multi-Year Comparative Analysis: Calculate changes in KPI performance over multiple years, over all municipalities, regions or landstings.
  • Cross-KPI Correlation: Analyze relationships between different KPIs across municipalities or regions.

Components

Tools

  1. list_operating_areas

    • Retrieve available KPI categories.
  2. get_kpis_by_operating_area

    • List KPIs under a specific category.
  3. search_kpis

    • Perform semantic searches to discover relevant KPIs.
  4. get_kpi_metadata

    • Access detailed metadata for specific KPIs.
  5. fetch_kolada_data

    • Obtain precise KPI values for specific municipalities or regions.
  6. analyze_kpi_across_municipalities

    • Conduct in-depth analysis and comparisons of KPI performance across municipalities.
  7. compare_kpis

    • Evaluate the correlation or difference between two KPIs.
  8. list_municipalities

    • Returns a list of municipality IDs and names filtered by type (default is "K"). Passing an empty string for municipality_type returns municipalities of all types.

Quick Start

Kolada MCP Server uses sensible defaults, with data fetched and cached on startup. No additional API keys or authentication are necessary to use Kolada’s open API.

Cache

Kolada also with pre-cached dataset that lists all available KPIs and their metadata. To use a fresh cache instead, simply delete the kpi_embeddings.npz file and restart the server.

Installation

Using uv to install the Kolada MCP requirements is highly recommended. This ensures that all dependencies are installed in a clean environment. Simply run uv sync to install the required packages.

Development and Testing

Run the Kolada MCP server locally in development mode with detailed debugging:

uv run mcp dev server.py

Then open the MCP Inspector at http://localhost:5173 in your browser. Use the inspector interface to:

  • Test individual tools.
  • Inspect returned data.
  • Debug server interactions.

Claude Desktop

To add the Kolada MCP server to Claude Desktop, follow these steps:

  1. Open the claude_desktop_config.json config file. It can be found by opening settings in Claude Desktop and navigating to the Developer tab and clicking the Config button.
  2. Add the following configuration to the mcpServers section:
{
  "mcpServers": {
        "Kolada": {
        "command": "uv",
        "args": [
            "--directory",
            "[path to kolada-mcp directory]/src",
            "run",
            "server.py"
        ]
        }
    }
}

Restart Claude Desktop to use the Kolada MCP server tools.

Contributing

We welcome contributions! Report issues, suggest enhancements, or submit pull requests on GitHub.

Disclaimer

Kolada MCP Server is independently developed and maintained. It is not officially endorsed by, affiliated with, or related to "Rådet för främjande av kommunala analyser" (RKA) or any other organization.

License

Kolada MCP Server is released under the Apache License 2.0.

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

kolada_mcp-0.1.32.tar.gz (17.9 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kolada_mcp-0.1.32-py3-none-any.whl (17.9 MB view details)

Uploaded Python 3

File details

Details for the file kolada_mcp-0.1.32.tar.gz.

File metadata

  • Download URL: kolada_mcp-0.1.32.tar.gz
  • Upload date:
  • Size: 17.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for kolada_mcp-0.1.32.tar.gz
Algorithm Hash digest
SHA256 a7f292dee58ad4f1b7ee5b421f3b4610ba2c653d3840db782b31dd89f9d9e13e
MD5 3f05d12f4aa56838054cb4c0bdd59f65
BLAKE2b-256 98df1d0ce787c5dbf4e7a8c79a4920298fbe70f1041657babc9c25fcd308c091

See more details on using hashes here.

Provenance

The following attestation bundles were made for kolada_mcp-0.1.32.tar.gz:

Publisher: release.yml on aerugo/kolada-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file kolada_mcp-0.1.32-py3-none-any.whl.

File metadata

  • Download URL: kolada_mcp-0.1.32-py3-none-any.whl
  • Upload date:
  • Size: 17.9 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for kolada_mcp-0.1.32-py3-none-any.whl
Algorithm Hash digest
SHA256 d92e4e2f80d7015cf7c0601c51e49ebd8f94ad173575437c8dbedabdd20aa36d
MD5 9bc284cdeba3c2f4ad6fecd8a710262a
BLAKE2b-256 7b568b8dad7c36073bdf3a6a94e243e5e09b7650e7f98667bfba0365bb3a9865

See more details on using hashes here.

Provenance

The following attestation bundles were made for kolada_mcp-0.1.32-py3-none-any.whl:

Publisher: release.yml on aerugo/kolada-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page