FI-MCP
Model Context Protocol (MCP) server for the Financial Independence community.
Overview
FI-MCP automatically generates MCP tools from the FI function library using introspection. This allows AI assistants to access the financial independence calculation functions we use as native tools. This gets rid of hallucinations by ensuring that the AI uses the right calculations for the job, rather than guessing or taking a random calculation from the web. It also boosts confidence for the user because it allows us to know where the calculation is coming from. Math can be checked in the FI library and the associated blog article or forum link (where applicable).
Features
Auto-discovery: Automatically finds all functions in the FI library
Type-safe: Converts Python type annotations to MCP tool schemas
Parameter validation: Validates and converts arguments before function calls
Comprehensive coverage: All 30+ FI functions available as MCP tools
Installation
For development:
For production use:
Configuration for AI Editors
Add these setttings to your Windsurf MCP config file, Claude ~/.claude/config.json,
or other analogous file:
After adding the configuration, restart your editor. The AI assistant will now have access to all FI calculation tools.
Usage
Once configured, you can ask your AI assistant questions like:
"Calculate my CoastFI number with $50k invested, 4% return, retiring at 65, currently 30"
"How much does it cost to buy a day of freedom with $40k annual spending?"
"How do I calculate cap rate?" - Get full documentation including what it calculates, parameters, and credits
"I don't remember how to calculate turnover costs" - Get full documentation including what it calculates, parameters, and credits
"What inputs does future_value take?" - See all parameters with descriptions
"Show me all available FI calculations" - Browse all available functions
The AI will automatically use the appropriate FI tool to perform a FI related calculation. It can access complete markdown-formatted docstrings for any function, including detailed explanations, parameter descriptions, return values, and attribution credits.
Available Tools
See the FI library for the full list of available tools.
Architecture
FI-MCP uses introspection patterns to:
Discover all functions in the FI module
Extract parameter types and descriptions from function signatures and markdown docstrings
Generate MCP tool schemas automatically
Expose function documentation via MCP Resources
Handle type conversion and validation
Execute functions with converted arguments
MCP Features
Tools: Each FI function is exposed as an MCP tool with full type information and parameter descriptions
Resources: Function documentation is available via
fi://help/{function_name}URIs, returning markdown-formatted docstrings
Development
Setup
Install the package in editable mode with development dependencies:
Running Tests
Run all tests:
Run specific test file:
Test Coverage
tests/test_docstring_validation.py- Validates that all FI functions have proper markdown docstringstests/test_basic.py- Integration tests for function discovery, schema generation, and execution
License
MIT License - Same as FI library
This server cannot be installed
local-only server
The server can only run on the client's local machine because it depends on local resources.
Provides AI assistants with access to 30+ validated financial independence calculation functions, eliminating hallucinations by ensuring accurate calculations for retirement planning, CoastFI, investment returns, and other FI metrics.