# Fundamental Math MCP

> Fundamental Math is a deterministic math engine that guarantees 100% accurate calculations for critical workflows. It provides local computational tools for percentages, factorials, square roots, powers, and proportional reasoning (the rule of three). Stop relying on models for precise numbers; use this MCP to embed real calculator functionality directly into your agents.

## Overview
- **Category:** developer-tools
- **Price:** Free
- **Tags:** deterministic-math, computation, precision-engine, no-hallucination, local-processing, arithmetic

## Description

When your agent needs to crunch the actual numbers—like calculating tax percentages or figuring out probabilities—relying solely on a large language model is risky. LLMs are great at concepts, but they notoriously hallucinate when it comes to exact math. This MCP solves that by giving your AI client a deterministic computational core. You connect this via Vinkius and give your agent the power of a real calculator, every time. It runs purely locally in JavaScript, meaning no data leaves your secure environment while you get perfect results for complex ratios, factorials, or simple exponents. Instead of describing how to calculate something, you just ask, and the engine gives you the exact number.

## Tools

### calculate_factorial
This function calculates the factorial (n!) of any given whole number.

### calculate_percentage
Use this to find out what percentage one value represents compared to a total amount.

### calculate_power
It computes the result of raising one number (the base) to another number (the exponent).

### calculate_rule_of_three
This solves simple proportional problems, determining a missing value based on two known rates.

### calculate_square_root
It computes the positive square root of any given number.

## Prompt Examples

**Prompt:** 
```
I have a total budget of 4500 and I want to allocate 17.5% to marketing. Calculate the exact value.
```

**Response:** 
```
Using the calculate_percentage tool: The exact value for 17.5% of 4500 is 787.5.
```

**Prompt:** 
```
If an ad campaign generated 120 leads with a $500 investment, how many leads can I expect with a $2500 investment?
```

**Response:** 
```
Using the calculate_rule_of_three tool (A=500, B=120, C=2500): You can expect exactly 600 leads with a $2500 investment.
```

**Prompt:** 
```
Calculate the factorial of 12 for my probability distribution script.
```

**Response:** 
```
Using the calculate_factorial tool: The factorial of 12 (12!) is exactly 479,001,600.
```

## Capabilities

### Determine Proportions
Solve proportionality problems using established relationships, like finding missing variables in a rate equation.

### Calculate Percentages
Accurately determine what percentage one number represents of a larger total value.

### Find Exponents and Powers
Compute the result when a base number is raised to an assigned exponent.

### Calculate Factorials
Determine the factorial of any non-negative integer, essential for probability work.

### Find Square Roots
Compute the precise square root of a given number.

## Use Cases

### Calculating Investment Returns
A financial analyst needs to know the exact compounding value of an investment over several years. They ask their agent, which uses `calculate_power` to provide a guaranteed accurate final dollar figure, eliminating guesswork.

### Analyzing Campaign Efficiency
A marketing manager wants to compare lead generation rates across three regions. Asking the agent to use `calculate_rule_of_three` gives them an immediate, mathematically verified expected output for each region's investment.

### Completing Statistical Reports
A data scientist must calculate a required sample size for a survey. They prompt the agent to use `calculate_square_root` and receive the precise, non-hallucinated value needed to complete their report.

### Probability Scripting
An engineer is writing code that requires calculating combinations based on a fixed set of items. They use `calculate_factorial` to get the exact number, ensuring their probability distribution script runs flawlessly.

## Benefits

- Stop trusting LLM guesses. When you need a precise value, like calculating the factorial of 12, use `calculate_factorial` to get an exact number every time.
- Handle financial reporting with confidence. Use `calculate_percentage` to accurately determine allocations and tax rates without error-prone manual steps.
- Improve data modeling immediately. The `calculate_rule_of_three` tool lets you solve ratios—like lead generation per dollar spent—in a single prompt.
- Maintain privacy while computing. Because the engine runs locally, sensitive financial or statistical data never leaves your secure environment.
- Build robust scripts faster. By using tools like `calculate_power`, developers embed reliable math functions directly into their agent workflows.

## How It Works

The bottom line is that you bypass the model's conversational layer and talk directly to a reliable math processor.

1. You instruct your AI client to perform a specific calculation, such as finding 15% of $800.
2. The agent recognizes the need for precise data and calls the appropriate tool within this MCP, like `calculate_percentage`.
3. The engine returns a guaranteed accurate number (e.g., 120) to your client, which then incorporates it into its response.

## Frequently Asked Questions

**How does calculate_percentage improve accuracy over just asking an agent?**
It forces the agent to run a deterministic calculation engine instead of generating a number based on language patterns. This ensures 100% mathematical accuracy for financial use cases.

**Can I use Fundamental Math MCP to solve complex ratios?**
Yes, the `calculate_rule_of_three` tool is designed specifically for solving proportional problems (A is to B, C is to X). It handles these relationships precisely.

**Is using calculate_factorial safe with sensitive data?**
Yes. The MCP executes purely in local JavaScript and does not make external API calls, meaning your sensitive data never leaves your secure client environment.

**What is the difference between calculate_power and general math tools?**
The `calculate_power` tool handles base exponentiation (X to the Y power). It provides a reliable, dedicated function for this specific mathematical operation within your workflow.

**Does Fundamental Math MCP support complex statistics?**
It supports essential statistical math functions like finding square roots and calculating factorials. For broader modeling, you should pair it with specialized data analysis tools.