mcp-sinim
Pull Chilean municipal data from SINIM with a searchable catalog, tidy municipal panels, and the same package from Python or any MCP-compatible client.
An open-source project by Maykol Medrano.
What You Can Do
- Search roughly 480 SINIM variables by natural language instead of memorizing
id_datocodes. - Pull one or many municipal indicators as tidy
pandaspanels in one call. - Discover available years and municipality codes directly from the live portal.
- Use the same package in notebooks, scripts, or MCP clients.
- Work with an offline catalog snapshot plus optional metadata caching.
Installation
pip install mcp-sinim
Python Example
from mcp_sinim import SINIMClient
client = SINIMClient(corrmon=True)
# 1) Find the right variable code
hits = client.search("patentes municipales")
print(hits[["code", "name"]].head(3).to_string(index=False))
# 4173 = Ingresos por Patentes Municipales de Beneficio Municipal
# 1311 = Monto Patentes Municipales Pagadas
# 13101 = Santiago, 13114 = Las Condes, 13123 = Providencia
# 2) Pull a tidy panel for several years and municipalities
df = client.get(
["4173", "1311"],
years=[2022, 2023, 2024],
municipios=["13101", "13114", "13123"], # Santiago, Las Condes, Providencia
)
print(df.head(12).to_string(index=False))
# 3) Explore metadata when needed
print(client.years()[-5:])
print(client.search_municipios("providencia"))
print(client.municipios(region="13")) # official region code: Metropolitana
Main things you will use:
search(...)to find variable codesget(...)to pull municipal datamunicipios(...)andsearch_municipios(...)to work with legal municipality codesyears()to see what is currently available
MCP Server
Use mcp-sinim when you want an MCP client to search SINIM variables, inspect
their metadata, and fetch municipal data without writing a custom wrapper.
Run the server after installation:
mcp-sinim
Typical MCP configuration:
{
"mcpServers": {
"sinim": {
"command": "mcp-sinim"
}
}
}
Optional environment variable:
MCP_SINIM_CACHE_DIRfor the metadata disk cache
MCP tools
| Tool | Description |
|---|---|
search_variables |
Search the SINIM variable catalog by keyword. |
get_variable_info |
Return metadata for one SINIM variable code. |
get_data |
Retrieve tidy municipal records for one or many variables. |
preview_data |
Preview up to 100 records to check a query before exporting. |
export_data |
Write a full municipal panel to Parquet or CSV on disk. |
list_areas |
List the 9 catalog subject areas. |
list_municipios |
List municipalities, optionally filtered by region. |
search_municipalities |
Search municipalities by name, optionally filtered by region. |
list_years |
List currently available SINIM years. |
Important Notes
cod_municipiomatches the official SUBDERE CUT codes for the 345 municipalities present in SINIM.- Pass those legal CUT codes to
municipios=. The client translates them to SINIM's internal identifiers automatically. - Region filters accept official Chilean region codes (
"1"through"16"), as well as SINIM's portal identifiers for compatibility. corrmon=Truerequests SINIM's real-value series, expressed in pesos of the most recent published year.- This is an independent open-source client for the public SINIM portal. It is not affiliated with SUBDERE or the Gobierno de Chile.
Development
git clone https://github.com/MaykolMedrano/mcp_sinim
cd mcp_sinim
python -m venv .venv
.venv/Scripts/activate
pip install -e ".[dev]"
python -m ruff check .
python -m ruff format --check .
python -m pytest
License
MIT. See LICENSE.
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 mcp_sinim-0.3.0.tar.gz.
File metadata
- Download URL: mcp_sinim-0.3.0.tar.gz
- Upload date:
- Size: 118.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6c425f232d66b53b7a143d891ce12356144fbb3426fddb6637b9b3d915630c6b
|
|
| MD5 |
c4c96ce730ee52714d9bb3f38c5953db
|
|
| BLAKE2b-256 |
e2107916966d3b9d2014a4c5c76e0fe1d8fec3afe5746030f3d8c0d276796fb8
|
Provenance
The following attestation bundles were made for mcp_sinim-0.3.0.tar.gz:
Publisher:
publish.yml on MaykolMedrano/mcp_sinim
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcp_sinim-0.3.0.tar.gz -
Subject digest:
6c425f232d66b53b7a143d891ce12356144fbb3426fddb6637b9b3d915630c6b - Sigstore transparency entry: 2372618108
- Sigstore integration time:
-
Permalink:
MaykolMedrano/mcp_sinim@5ef81d30c6c96f4255efdfdf3627cda75cc286de -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/MaykolMedrano
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5ef81d30c6c96f4255efdfdf3627cda75cc286de -
Trigger Event:
push
-
Statement type:
File details
Details for the file mcp_sinim-0.3.0-py3-none-any.whl.
File metadata
- Download URL: mcp_sinim-0.3.0-py3-none-any.whl
- Upload date:
- Size: 42.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b8794e37ba68b9da990ece5552e5f11f0a0687516058bf889cff02a7d0fee714
|
|
| MD5 |
50b69fdc73fa6051fb1d852cf05db4c0
|
|
| BLAKE2b-256 |
7036273bee2cf8a4e634cfbab06727ed70f251500f86b24a537f866e59d7530d
|
Provenance
The following attestation bundles were made for mcp_sinim-0.3.0-py3-none-any.whl:
Publisher:
publish.yml on MaykolMedrano/mcp_sinim
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcp_sinim-0.3.0-py3-none-any.whl -
Subject digest:
b8794e37ba68b9da990ece5552e5f11f0a0687516058bf889cff02a7d0fee714 - Sigstore transparency entry: 2372618125
- Sigstore integration time:
-
Permalink:
MaykolMedrano/mcp_sinim@5ef81d30c6c96f4255efdfdf3627cda75cc286de -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/MaykolMedrano
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5ef81d30c6c96f4255efdfdf3627cda75cc286de -
Trigger Event:
push
-
Statement type: