home / mcp / scb mcp server

SCB MCP Server

Provides access to 1,200+ Statistics Sweden tables via PxWebAPI 2.0 for querying official data.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "isakskogstad-scb-mcp": {
      "url": "https://scb-mcp.onrender.com/mcp"
    }
  }
}

You can access Statistics Sweden’s extensive data catalog through the SCB MCP Server. This MCP enables LLMs and AI chatbots to search, retrieve, and use 1,200+ official stat tables via PxWebAPI 2.0, making it ideal for interactive dashboards, research tools, and educational apps.

How to use

Connect to the SCB MCP Server from any MCP-compatible client using the remote URL or run it locally for full control. Use the server to search for relevant tables, resolve region codes, and fetch data for your analyses. Typical workflows involve finding the right table, selecting the correct region and time period, and retrieving the desired data points for visualization or decision support.

How to install

Prerequisites: Node.js and npm installed on your machine. You should also have Git for cloning repositories if you choose to build locally.

Option A: Remote URL (no installation) — use the hosted MCP server directly with any compatible client.

Option B: Local installation (Node.js) — clone the project, install dependencies, build, and run.

Option C: Docker — run the server in a container if you prefer containerized hosting.

# Option B: Local installation (Node.js)
# 1) Clone the repository
git clone https://github.com/isakskogstad/SCB-MCP.git
cd SCB-MCP

# 2) Install dependencies
npm install

# 3) Build the project
npm run build

# 4) Start the server (example)
npm run start

HTTP remote usage

You can connect to the hosted MCP server from any MCP client using the following remote URL.

Use this configuration in your MCP host to connect via HTTP.

{
  "mcpServers": {
    "scb": {
      "type": "http",
      "url": "https://scb-mcp.onrender.com/mcp"
    }
  }
}

Local stdio configuration

If you prefer to run a local MCP server process and connect via standard input/output, you can configure Claude Code or other clients to launch the local script directly.

The following is an example of a local stdio setup that runs the built index script.

{
  "mcpServers": {
    "scb_mcp": {
      "command": "node",
      "args": ["/path/to/SCB-MCP/dist/index.js"],
      "type": "stdio"
    }
  }
}

Docker

You can run SCB MCP Server in a Docker container. Build the image and start a container to expose the MCP endpoint on your host.

# Build the image
docker build -t scb-mcp .

# Run the container (exposes port 3000 by default)
docker run -p 3000:3000 scb-mcp

Notes on usage and examples

The server supports querying, region code resolution, and data retrieval for a wide range of statistics. Typical usage patterns include searching for tables by topic, resolving region names to codes, and fetching data for specific time periods. For example, you can look up population-related tables, resolve a city code, and retrieve data for a chosen year.

Best practices and tips

- Prefer remote HTTP access for quick testing and lightweight integrations. - Use local stdio mode when you need tight control over the runtime process or offline development. - When building locally, follow the install-build-start flow to ensure the index script is compiled before running. - Use the HTTP option if you want to integrate with chat clients, IDEs, or automation that expects a standard REST/JSON-RPC style endpoint.

Troubleshooting

If you encounter connection issues, verify the URL for the HTTP method and ensure the local process is running in stdio mode with the correct path to the built index. Check your network permissions, CORS settings where applicable, and that you are using the expected MCP endpoint path.

Tools and capabilities

The server provides programmatic access to search for statistical tables, resolve region codes, and fetch data from specific tables. Common functions include searching by query, finding region codes by name, and getting data for a given table with selections for region, time, and data contents.

Example capabilities you can invoke from your client include: search_tables, find_region_code, and get_table_data to retrieve values from the SCB data catalog.

Available tools

search_tables

Search for statistical tables by natural language query or keywords and apply filters to limit results.

find_region_code

Resolve region names to official region codes, with fuzzy matching for misspelled names.

get_table_data

Fetch data from a specified table using a selection of Region, Time, ContentsCode, and other dimensions.