Skip to content

p0ss/OpenFisca-MCP

Repository files navigation

OpenFisca MCP

MCP (Model Context Protocol) tools for interacting with OpenFisca tax-benefit systems.

Installation

poetry install

Usage

Start the OpenFisca server

./scripts/serve.sh

Run the MCP server

poetry run openfisca-mcp

Configure with Claude Desktop

Add to your Claude Desktop config:

{
  "mcpServers": {
    "openfisca": {
      "command": "poetry",
      "args": ["run", "openfisca-mcp"],
      "cwd": "/path/to/RaMCP"
    }
  }
}

Available Tools

Tool Description
list_entities List entity types (person, household) and their roles
list_variables List all available variables, optionally filtered by entity
describe_variable Get detailed variable info (type, period, formulas)
list_parameters List all parameters (rates, thresholds, amounts)
get_parameter Get parameter values and history
search_variables Search variables by keyword
calculate Compute variable values for a situation
trace_calculation Calculate with dependency tracing for explainability
validate_situation Validate situation structure without calculating

Development

Run tests

poetry run pytest

Generate golden fixtures

./scripts/serve.sh &
poetry run python tests/generate_golden.py

┌────────────────────┬───────┬───────────────────────────────────────────────────────────────────────────────────────────┐ │ Package │ Tests │ Key Findings │ ├────────────────────┼───────┼───────────────────────────────────────────────────────────────────────────────────────────┤ │ openfisca-france │ 14 ✅ │ 4 entities, MONTH periods for age, all 4 entities required in situations   │ ├────────────────────┼───────┼───────────────────────────────────────────────────────────────────────────────────────────┤ │ openfisca-aotearoa │ 17 ✅ │ 5 entities (including property entities), DAY periods for age, minimal situations allowed │ └────────────────────┴───────┴───────────────────────────────────────────────────────────────────────────────────────────┘

About

Allows agents to query Rules as Code, using a Model Content Protocol wrapper for OpenFisca

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors