Skip to content

Gaspatchio MCP Server

The Gaspatchio Model Context Protocol (MCP) server provides intelligent documentation assistance and code generation for Gaspatchio projects. It combines semantic search over documentation, code examples, and Excel conversion patterns to help actuaries write idiomatic Gaspatchio code directly in your IDE.

What It Does

The Gaspatchio MCP server brings comprehensive Gaspatchio knowledge directly into Cursor:

  • Documentation Search: Semantic search across all Gaspatchio functions, classes, and examples
  • Excel Conversion: Convert Excel formulas to equivalent Gaspatchio code with explanations
  • Code Examples: Get specific, runnable examples for any Gaspatchio function
  • Assumption Queries: Access actuarial assumption tables and lookup patterns
  • Code Writing Assistance: Get help writing and debugging Gaspatchio code

Installation in Cursor

Click this button to add the Gaspatchio MCP server to Cursor:

Add gaspatchio MCP server to Cursor

How to Use

Excel to Gaspatchio Conversion

Convert your Excel formulas directly:

Convert this Excel formula to Gaspatchio: YEARFRAC(A1, B1, 0)

The MCP server will provide: - Equivalent Gaspatchio code: af['col'].excel.yearfrac(end_date, start_date, basis=0) - Explanation of parameters - Working code examples

Function Discovery

Find the right function for your task:

How do I filter an ActuarialFrame based on multiple conditions?
Show me date manipulation functions
What's the Gaspatchio equivalent of VLOOKUP?

Code Examples

Get specific examples for any function:

Show me examples of ActuarialFrame.filter
Give me code examples for date calculations
How do I use excel.yearfrac?

Debugging Help

Get help fixing code issues:

I'm getting an error with this code: af['duration'] = af['issue_date'].dt.year() - af['val_date'].dt.year()
This date calculation isn't working as expected: [paste your code]

Real-World Examples

Converting Complex Excel Logic

Excel Formula:

=IF(YEARFRAC(PolicyDate, ValuationDate) > 1, 
    VLOOKUP(Age, MortalityTable, 2, FALSE), 
    0.001)

Ask the MCP server:

Convert this Excel formula to Gaspatchio: IF(YEARFRAC(PolicyDate, ValuationDate) > 1, VLOOKUP(Age, MortalityTable, 2, FALSE), 0.001)

Get Gaspatchio equivalent:

af.with_columns([
    pl.when(af['policy_date'].excel.yearfrac(af['valuation_date']) > 1)
    .then(
        af.join(mortality_table, left_on='age', right_on='age')['mortality_rate']
    )
    .otherwise(0.001)
    .alias('final_rate')
])

Building Actuarial Calculations

Ask:

Help me calculate policy reserves using mortality assumptions
Show me how to build a projection model with monthly cash flows
How do I implement surrender charge calculations?

Get: - Complete working code examples - Best practices for actuarial modeling - Performance optimization tips

Learning Gaspatchio Concepts

Ask:

Explain ActuarialFrame vs regular Polars DataFrame
What's the difference between dt and excel namespace?
How do assumptions work in Gaspatchio?

Get: - Clear conceptual explanations - Code comparisons - When to use each approach

Available Tools

The MCP server provides these specialized tools:

  • search_gaspatchio_docs - Search across all documentation and examples
  • convert_excel_to_gaspatchio - Convert Excel formulas to Gaspatchio code
  • get_gaspatchio_examples - Get specific code examples for functions
  • query_assumptions - Access actuarial assumption tables
  • explain_gaspatchio_concept - Get detailed concept explanations
  • help_write_gaspatchio_code - Comprehensive coding assistance

Tips for Best Results

  1. Be Specific: "Show me ActuarialFrame filtering examples" works better than "help with filtering"

  2. Include Context: When converting Excel formulas, mention what the calculation does: "Convert VLOOKUP formula for mortality table lookup"

  3. Ask Follow-ups: Build on previous responses: "Now show me how to add error handling to that code"

  4. Share Your Code: When debugging, paste your actual code for specific help

Getting Started

  1. Install the MCP server using the button above
  2. Open any Gaspatchio project in Cursor
  3. Start asking questions about Gaspatchio functions, Excel conversions, or actuarial calculations
  4. The server will provide code examples, explanations, and working solutions

The Gaspatchio MCP server transforms your IDE into an intelligent actuarial coding assistant, making it faster and easier to write robust, idiomatic Gaspatchio code.