estv-tax
Swiss Tax Calculator — Servidor MCP y API de Python
Licenciado bajo MIT por Aiyatullah Saiyed.
Un conjunto de herramientas fiscales suizas de doble propósito: úsalo como cliente de API de Python en tus aplicaciones, o ejecútalo como servidor MCP para asistentes de IA como Claude. Envuelve la calculadora oficial ESTV Swiss Federal Tax Calculator — sin clave de API ni autenticación.
Cubre los impuestos sobre la renta, el patrimonio, el capital en pago único, las suesiones/donaciones y los impuestos de sociedades para todos los municipios suizos en los ejercicios fiscales 2010–2026.
Funcionalidades
Categoría | Herramientas |
Impuestos del hogar |
|
Compararestares |
|
Planificación fiscale |
|
Otros impuestos |
|
Referencia |
|
Related MCP server: Swiss Health MCP Server
Inicio rápid
Instalación
# Clone the repository
git clone https://github.com/aiyatullah/swiss-tax-calculator-mcp.git
cd swiss-tax-calculator-mcp
# Install dependencies
uv syncUso como API de Python
Importa EstvClient directamente en tu código Python para consult con programáticamente el calcuador de impuestos de ESTV.
Ejemplo básico TaxEncontrar una ub icación
from estv_mcp import EstvClient
client = EstvClient()
# Search for a municipality by name or postal code
locations = client.search_location("Zug", tax_year=2026)
for loc in locations[:3]:
print(f"{loc['City']} ({loc['Canton']}) — ID: {loc['TaxLocationID']}")Calcular el impuesto sobre la renta
from estv_mcp.api import EstvClient, RELATIONSHIP, CONFESSION, INCOME_TYPE
client = EstvClient()
# Step 1: Find the tax location
locations = client.search_location("8001", tax_year=2026)
location_id = locations[0]["TaxLocationID"]
# Step 2: Get the tax budget (deduction sheet)
budget = client.tax_budget({
"SimKey": None,
"TaxYear": 2026,
"TaxLocationID": location_id,
"Relationship": RELATIONSHIP["single"],
"Confession1": CONFESSION["none"],
"Confession2": 0,
"Children": [],
"Age1": 35,
"RevenueType1": INCOME_TYPE["employed"],
"Revenue1": 120_000,
"Age2": 0,
"RevenueType2": 0,
"Revenue2": 0,
"Fortune": 50_000,
})
# Step 3: Calculate detailed taxes
result = client.detailed_taxes({
"SimKey": None,
"TaxYear": 2026,
"TaxLocationID": location_id,
"Relationship": RELATIONSHIP["single"],
"Confession1": CONFESSION["none"],
"Confession2": 0,
"Children": [],
"Age1": 35,
"RevenueType1": INCOME_TYPE["employed"],
"Revenue1": 120_000,
"Age2": 0,
"RevenueType2": 0,
"Revenue2": 0,
"Fortune": 0,
"Budget": budget,
})
print(f"Total tax: CHF {result['TotalTax']:,.0f}")
print(f"Federal: CHF {result.get('IncomeTaxFed', 0):,.0f}")
print(f"Cantonal: CHF {result.get('IncomeTaxCanton', 0):,.0f}")
print(f"Municipal: CHF {result.get('IncomeTaxCity', 0):,.0f}")Comparar muniepios
from estv_mcp.api import EstvClient, RELATIONSHIP, CONFESSION, INCOME_TYPE, GROUP_CAPITALS
client = EstvClient()
# Compare tax burden across all 26 cantonal capitals
rows = client.many_simple_taxes({
"SimKey": None,
"TaxYear": 2026,
"TaxGroupID": GROUP_CAPITALS,
"Relationship": RELATIONSHIP["single"],
"Confession1": CONFESSION["none"],
"Confession2": 0,
"Children": [],
"Age1": 35,
"RevenueType1": INCOME_TYPE["employed"],
"Revenue1": 100_000,
"Age2": 0,
"RevenueType2": 0,
"Revenue2": 0,
"Fortune": 0,
})
ranked = sorted(rows, key=lambda r: r["TotalTax"])
print("Top 5 cheapest cantonal capitals:")
for r in ranked[:5]:
loc = r["Location"]
print(f" {loc['City']} ({loc['Canton']}): CHF {r['TotalTax']:,.0f}")Impuesto de suesiones
from estv_mcp.api import EstvClient, BENEFICIARY, GROUP_CAPITALS
client = EstvClient()
# Inheritance tax for a sibling across cantonal capitals
rows = client.many_inheritance_taxes({
"SimKey": None,
"TaxYear": 2026,
"TaxGroupID": GROUP_CAPITALS,
"OnlyGroupID": BENEFICIARY["sibling"][0],
"OnlyPersonID": BENEFICIARY["sibling"][1],
"Donation": False,
"Amount": 500_000,
})
ranked = sorted(rows, key=lambda r: r["TaxTotal"])
print(f"Cheapest: {ranked[0]['Location']['City']} — CHF {ranked[0]['TaxTotal']:,.0f}")
print(f"Most expensive: {ranked[-1]['Location']['City']} — CHF {ranked[-1]['TaxTotal']:,.0f}")Operaciones de API disponible
Método | Descripción |
| Enrique municipios por nombre o código postal. |
| Enrique municipios dentro de un radio. |
| Obtién la hoja de deducciones/presupuesto de un hogar. |
| Cálculo fiscale completo con desglose. |
| Impuesto a partir de importes imponible precalculados. |
| Compare l'importe entre all |
| Impuesto del retiro de capital en pago único en v-rios municidores. |
| Sucesiones/donaciones en varios municipios. |
| Impuestos de sociedades en varios municipios. |
| Tablas bras de trames fiscales. |
| Rango de ejercicios protegidos per calcuador. |
| Versión actual de los datos de ESTV. |
Referencia de Enum
from estv_mcp.api import (
RELATIONSHIP, # single=1, married=2, concubinage=3, registered_partnership=4
CONFESSION, # reformed=1, roman_catholic=2, christ_catholic=3, none=4, other=5
INCOME_TYPE, # employed=1, self_employed=2, pensioner=3, other=4
GENDER, # male=1, female=2
LANGUAGE, # de=1, fr=2, it=3, en=4
CANTON_GROUP, # AG=1 ... ZH=26
GROUP_CAPITALS, # 88 — all 26 cantonal capitals
GROUP_SWITZERLAND, # 99 — every municipality (~2100)
CALCULATOR, # income_wealth=1, capital_payment=2, legal_entity=3, inheritance=5
BENEFICIARY, # spouse, child, sibling, unrelated, etc. → (GroupID, PersonID)
)Caché
Las respuestas se alacenan en caché in ~/.chache/estv-mcp perdurante una semana. Controla el caché usando herramias de orno:
Varible | Efelto |
| Desabilita el caché por completo. |
| Besides directory de caché personalizado. |
| Vida útil del caché en segundos. |
Uso como servidor MCP
Este project as un servidor MCP para die a los asistentes de IA (Claude, etc.) access to todas las herramientas fiscales suizas.
Registro con Claude Code
# Project-local (this repo only)
claude mcp add estv-tax -- uv run --directory "$PWD" estv-mcp
# User-wide (available in every project)
claude mcp add -s user estv-tax -- uv run --directory "$PWD" estv-mcpConfiguración del cline MCP (JSON)
Para cualquier cliente compatible con MCP, grega lo following a tu configuración:
{
"mcpServers": {
"estv-tax": {
"command": "uv",
"args": ["run", "--directory", "/path/to/swiss-tax-calculator-mcp", "estv-mcp"]
}
}
}Lo que puede hacer la IA
Una vez conectado, el asiente de IA puede:
"¿Cuánto impuesto pagaría en Zúrich sobre CHF 150,000?" — invoca una
find_location+calculate_tax"Comparar Zug con Schwyz para un matrimonio con 2 hijos" — invoca
compare_locations"¿Qué lugar es el más barato en 30 km de Zhrich HB?" — invoca
find_cheapest_nearby"¿Debería dividir my retiro del pilar 2 entre varios años?" — invoca
plan_capital_withdrawals"¿Cuál es el impuesto de suesiones para un umano en Genebre?" — invoca
calculate_inheritance_tax"¿Cuanto pagaría my emprensa in Zug como comparition con Lucerna?" — invoca a
calculate_company_tax
Desarrollo
uv sync # Install dependencies (including dev)
uv run pytest -q # Run tests (hits live ESTV API)
uv run python scripts/stdio_smoke.py # MCP stdio handshake test
uv run ruff check . && uv run ruff format --check . # Lint & format checkValores de oro
tests/golden.json fija las cifras de impuestos para los ejercicios cerrados. El CI semanal los chequea de nuevo contra la API en vivo para detectar els.
uv run python scripts/update_golden.py # Update golden values (prints diffs)CI
Las tests se ejecutan en Python 3.11/3.12/3.13 en cada push, con un "cronogram semanal" para se detectar los changes en los datos de ESTV.
Notas importas
Todos los importados están en CHF por año
income_type='empleado'significa "salario brto — las aportaciones sociales (AHV/IV/EO, ALV, BUV, BVG) se derivan "automaticáticamente"Sobrescribir las deducciones con
deductions={id: valor:usando los IDs delist_eductions(p. ej.PRAEMIEN3Apara pilar 3A,SCHULDZINSENpara intereses de la hipoteca)compare_locations(scope="switzerland")cubr ~2,100 municipios; en los resultados se suean paralegibilityEl impuesto de iglesia solo aplica si
confessiones nonone* Las cifras se basan en officiales ESTV — no son una testación vinculante
Este es el final.
Licencia
Licencia MIT — ver LICENSE
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- FlicenseBqualityDmaintenanceEnables AI assistants to calculate French individual income tax and retrieve current tax brackets using official government data. Supports household composition calculations and provides up-to-date tax information for French residents.1114
- AlicenseBqualityDmaintenanceProvides AI assistants access to 1.6 million Swiss health insurance premium records from 55 insurers across 11 years (2016-2026), enabling price comparisons, historical analysis, and finding the cheapest insurance options based on location, age, and coverage preferences.4561MIT
- AlicenseAqualityAmaintenanceProvides AI-native access to Swiss Federal Statistical Office datasets through 9 tools for querying education, population, and cross-cantonal comparisons without authentication.152MIT
- AlicenseBqualityCmaintenanceEnables AI assistants to answer tax compliance questions (VAT, sales tax, GST) and validate EU VAT numbers in real time via the VIES registry.212MIT
Related MCP Connectors
Current source-cited 2026 US tax constants and calculators for AI agents; every answer cites IRS.
Free public tax MCP: GST/VAT, income, company & capital-gains tax for 50+ countries, source-cited.
Validate EU, UK, AU VAT numbers for AI agents. EU ViDA e-invoicing compliance.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Aiyatullah/swiss-tax-calculator-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server