{
  "markdown": "# MCP Server for Statistics Sweden (SCB) API\n\n[![PyPI](https://img.shields.io/pypi/v/scb-opendata-mcp)](https://pypi.org/project/scb-opendata-mcp/)\n\nA FastMCP server that provides access to Statistics Sweden's PxWebApi v2, offering statistical tables covering employment, labor costs, wages, and other civil data from Sweden.\n\n## Features\n\n- **Table Discovery**: Browse and search 5,155 statistical tables\n- **Data Retrieval**: Fetch statistical data with optional filtering\n- **Codelists**: Access code lists for valid filter values\n- **Saved Queries**: Save and retrieve frequently used queries\n- **Pagination**: Handle large result sets efficiently\n- **Language Support**: English and Swedish\n- **Error Handling**: Robust error handling with retry logic\n\n## Installation\n\n### Prerequisites\n\n- Python 3.11 or higher\n- pip or uv package manager\n\n### Install from PyPI\n\n```bash\npip install scb-opendata-mcp\n\n# Or with uv\nuvx scb_opendata_mcp\n```\n\n### Install from source\n\n```bash\n# Clone the repository\ngit clone https://github.com/ashwinvis/scb-opendata-mcp.git\ncd scb-opendata-mcp\n\n# Install dependencies\npip install .\n\n# Or with uv\nuv sync\n```\n\n## Usage\n\n### Running the server\n\nThe package on installation \n\n```bash\nscb_opendata_mcp\n\n# Or with uv\nuv run scb_opendata_mcp\n```\n\nSee `scb_opendata_mcp --help` for available options. An `stdio` transport mechanism also exists.\n\n**Fallback option**\n\n```bash\nuv run fastmcp run src/scb_opendata_mcp/server.py -t http  # HTTP server\n```\n\n## Configuration for common agent harnesses\n\n### Claude Code\n\n```bash\nclaude mcp add --scope user --transport http scb_opendata_mcp http://localhost:6767\n```\n\n### Mistral Vibe\n\nIn `~/.vibe/config.toml` or `~/.vibe/agents/name_of_agent.toml`:\n\n```toml\n[[mcp_servers]]\nname = \"scb_opendata_mcp\"\ntransport = \"http\"\nurl = \"http://localhost:6767/mcp\"\n```\n\n### OpenCode\n\nIn `~/.config/opencode/opencode.jsonc`:\n\n```json\n{\n  \"mcp\": {\n    \"scb_opendata_mcp\": {\n      \"type\": \"remote\",\n      \"url\": \"https://localhost:6767/mcp\",\n      \"enabled\": true\n    }\n  }\n}\n```\n\n## Tools Available\n\n### Table Discovery\n- `list_tables()` - List all available statistical tables with pagination\n- `get_table_metadata(table_id)` - Get detailed metadata including variables\n- `search_tables(query)` - Convenience wrapper over `list_tables`, to search tables by name or description\n\n### Data Retrieval\n- `get_table_data(table_id, filters)` - Fetch data with optional filtering\n- `get_table_default_selection(table_id)` - Get default data selection for a table\n\n### Codelist Tools\n- `list_codelists(table_id)` - List all available codelists for the table\n- `get_codelist(codelist_id)` - Get specific codelist details\n\n### Saved Query Tools\n- `get_saved_query(query_id)` - Get a saved query including data and selection criteria\n- `get_saved_query_data(query_id)` - Get data from a specific saved query\n- `get_saved_query_selection(query_id)` - Get the selection query used in a specific saved query\n- `save_query(table_id, selection)` - Save a data query\n- `delete_saved_query(query_id)` - Delete a saved query\n\n## Development\n\n### Running Tests\n\n```bash\nuv run pytest\n```\n\n### Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## License\n\n[MIT License](LICENSE)\n\n## Support\n\nFor issues or questions:\n- Review the [OpenAPI specification](docs/PxAPI-2.yml) or alternatively from <https://github.com/PxTools/PxApiSpecs/blob/master/PxAPI-2.yml>.\n- Visit Statistics Sweden API documentation:\n  - På svenska: <https://www.scb.se/vara-tjanster/oppna-data/pxwebapi/pxwebapi-v2/>\n  - In English: <https://www.scb.se/en/services/open-data-api/pxwebapi/>\n\n## SCB Open Data Skills\n\nThis is an unofficial companion repository [SCB Open Data Skills](https://github.com/ashwinvis/scb-opendata-skills) that provides skill definitions for accessing Statistics Sweden's data through this MCP server. These skills are designed to work with major coding agent tools and provide workflows for various statistical domains.\n\n## Disclaimer\n\nThis is an unofficial tool. The code was generated using AI while using official documents and the API specification as context.\nTests are also added to verify the functionality. A thorough rigorous verification test is recommended before using it in any\nserious application.\n\n<!-- mcp-name: io.github.ashwinvis/scb-opendata-mcp -->\n",
  "bytes": 4345,
  "sha": "3adda0b452a7a37bce6ce96270f66b8e88d6fbd2f587649c91f0145e1f5535d3",
  "repo_slug": "ashwinvis/scb-opendata-mcp",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_ashwinvis_scb_opendata_mcp_22150751/readme"
}