# Financial Gateway MCP Server (`constant_quadruped/financial-gateway-mcp`) Actor

Model Context Protocol (MCP) server providing access to simulated CRM and accounting workflows.

- **URL**: https://apify.com/constant\_quadruped/financial-gateway-mcp.md
- **Developed by:** [CQ](https://apify.com/constant_quadruped) (community)
- **Categories:** AI, Developer tools, Integrations
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-usage

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## 💵 Financial Gateway MCP Server

**Give your AI assistant a built-in financial calculator.** This [Model Context Protocol (MCP)](https://modelcontextprotocol.io) server hands Claude, Cursor, or any MCP client three precise money tools — **client estimates, loan amortization, and currency conversion** — so it can crunch real numbers instead of guessing them.

Every result is pure deterministic math: the same input always gives the same answer, computed entirely from the values you pass in. **No API keys. No outbound calls. No made-up data.**

---

### ✨ Why use it

LLMs are notoriously unreliable at arithmetic — they'll happily "estimate" a loan payment and be off by hundreds of dollars. This Actor gives your AI a tool that returns **exact, auditable, repeatable** figures every time, with the formula and inputs visible in the output.

**Perfect for:**
- 🧾 AI agents that draft **quotes & estimates** for clients (line items → subtotal → discount → tax → total)
- 🏦 Assistants that answer **"what would the monthly payment be?"** with the real amortization formula
- 💱 Workflows that need **deterministic currency math** from a rate you control (no surprise live-rate drift)
- 🤖 Any MCP client (Claude Desktop, Cursor, MCP Inspector) that should *calculate*, not hallucinate

---

### 🛠️ The three tools

| Tool | What it does |
|------|--------------|
| **`calculate_estimate`** | Builds a line-item estimate — per-line totals, subtotal, optional discount, optional tax, and grand total. |
| **`amortize_loan`** | Fixed-rate loan summary — monthly payment, total paid, and total interest (standard amortization formula). |
| **`currency_convert`** | Converts an amount using an FX rate **you supply** (no live-rate lookups, so results stay reproducible). |

Speaks MCP over JSON-RPC 2.0 — supports `initialize`, `tools/list`, and `tools/call`.

---

### 🚀 Quick start

**On Apify** — paste a single JSON-RPC request into the `query` input and run. The Actor executes it, saves the response as `OUTPUT`, logs it to the dataset, and exits. *(Leave `query` empty to get the tool catalog back.)*

Example — amortize a $25,000 loan at 6.5% over 60 months:

```json
{
  "query": "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"tools/call\",\"params\":{\"name\":\"amortize_loan\",\"arguments\":{\"principal\":25000,\"annualRatePct\":6.5,\"termMonths\":60}}}"
}
````

**Locally as an MCP server** — run `node src/main.js` with no input. It reads newline-delimited JSON-RPC on `stdin` and replies on `stdout` — the standard transport for Claude Desktop and the MCP Inspector.

***

### 📥 Tool arguments

**`calculate_estimate`**

| Argument | Type | Required | Notes |
|----------|------|----------|-------|
| `items` | array of `{ description?, quantity, unitPrice }` | Yes | Non-empty; `quantity` and `unitPrice` must be numbers. |
| `discountPct` | number | No | 0–100, applied to the subtotal. Default 0. |
| `taxPct` | number | No | ≥ 0, applied after the discount. Default 0. |
| `client` | string | No | Echoed back on the result. |
| `currency` | string | No | Label only; defaults to `"USD"`. |

**`amortize_loan`**

| Argument | Type | Required | Notes |
|----------|------|----------|-------|
| `principal` | number | Yes | > 0. |
| `annualRatePct` | number | Yes | ≥ 0 (a 0% rate becomes straight-line repayment). |
| `termMonths` | integer | Yes | Integer > 0. |

**`currency_convert`**

| Argument | Type | Required | Notes |
|----------|------|----------|-------|
| `amount` | number | Yes | |
| `rate` | number | Yes | FX multiplier > 0 — **you supply it**, it is not fetched. |
| `from` / `to` | string | No | Labels only. |

***

### 📤 What you get back

The JSON-RPC response is saved as `OUTPUT`, and every tool call is appended to the dataset with its arguments, result, and timestamp.

Example — `amortize_loan` for $350,000 @ 5.5% over 180 months:

```json
{
  "principal": 350000,
  "annualRatePct": 5.5,
  "termMonths": 180,
  "monthlyPayment": 2859.79,
  "totalPaid": 514762.58,
  "totalInterest": 164762.58
}
```

Example — `calculate_estimate` for 8 units @ $175 with 7% tax:

```json
{
  "client": "Acme LLC", "currency": "USD",
  "lineItems": [{ "description": "Consulting", "quantity": 8, "unitPrice": 175, "lineTotal": 1400 }],
  "subtotal": 1400, "discountPct": 0, "discountAmount": 0,
  "taxPct": 7, "taxAmount": 98, "total": 1498
}
```

***

### 🔒 No setup, no surprises

- **Zero configuration.** No API keys, OAuth, or credentials. The Actor makes **no outbound network calls** — your numbers never leave the run.
- **Deterministic & auditable.** Same input → same output, every time. The result echoes the inputs so the math is checkable.
- **Honest by design.** It does **not** connect to QuickBooks, Stripe, Xero, banks, or any FX feed, and it does **not** store or retrieve real invoices or accounts. It's a stateless calculator — nothing is faked.

### ⚠️ Good to know

- `amortize_loan` uses the standard fixed-rate formula with monthly compounding — it doesn't model fees, escrow, variable rates, or extra payments.
- `calculate_estimate` applies one flat discount and one flat tax rate.
- Results are arithmetic only and rounded to 2 decimals — **verify before using in any financial, accounting, or regulatory context.** This is not financial or tax advice.
- Bad arguments return a clean JSON-RPC error (`-32602`), unknown tools return `-32601`, and a malformed `query` fails with an explanatory message — never a crash.

# Actor input Schema

## `query` (type: `string`):

A single MCP JSON-RPC 2.0 request to execute in one-shot mode (e.g. a tools/call). Leave empty when running as a long-lived stdio MCP server. If empty on the Apify platform, the Actor returns the tool catalog (tools/list) and exits.

## Actor input object example

```json
{
  "query": "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"tools/call\",\"params\":{\"name\":\"calculate_estimate\",\"arguments\":{\"items\":[{\"description\":\"Consulting\",\"quantity\":8,\"unitPrice\":175}],\"taxPct\":7,\"client\":\"Acme LLC\"}}}"
}
```

# Actor output Schema

## `results` (type: `string`):

JSON-RPC tool-call results persisted by the MCP server. Each item contains the tool name, the input arguments, and the computed result object.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "query": "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"tools/call\",\"params\":{\"name\":\"calculate_estimate\",\"arguments\":{\"items\":[{\"description\":\"Consulting\",\"quantity\":8,\"unitPrice\":175}],\"taxPct\":7,\"client\":\"Acme LLC\"}}}"
};

// Run the Actor and wait for it to finish
const run = await client.actor("constant_quadruped/financial-gateway-mcp").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "query": "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"tools/call\",\"params\":{\"name\":\"calculate_estimate\",\"arguments\":{\"items\":[{\"description\":\"Consulting\",\"quantity\":8,\"unitPrice\":175}],\"taxPct\":7,\"client\":\"Acme LLC\"}}}" }

# Run the Actor and wait for it to finish
run = client.actor("constant_quadruped/financial-gateway-mcp").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "query": "{\\"jsonrpc\\":\\"2.0\\",\\"id\\":1,\\"method\\":\\"tools/call\\",\\"params\\":{\\"name\\":\\"calculate_estimate\\",\\"arguments\\":{\\"items\\":[{\\"description\\":\\"Consulting\\",\\"quantity\\":8,\\"unitPrice\\":175}],\\"taxPct\\":7,\\"client\\":\\"Acme LLC\\"}}}"
}' |
apify call constant_quadruped/financial-gateway-mcp --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=constant_quadruped/financial-gateway-mcp",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Financial Gateway MCP Server",
        "description": "Model Context Protocol (MCP) server providing access to simulated CRM and accounting workflows.",
        "version": "2.0",
        "x-build-id": "eT3oH38yrP1b2SJqG"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/constant_quadruped~financial-gateway-mcp/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-constant_quadruped-financial-gateway-mcp",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/constant_quadruped~financial-gateway-mcp/runs": {
            "post": {
                "operationId": "runs-sync-constant_quadruped-financial-gateway-mcp",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/constant_quadruped~financial-gateway-mcp/run-sync": {
            "post": {
                "operationId": "run-sync-constant_quadruped-financial-gateway-mcp",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "query": {
                        "title": "JSON-RPC request (query)",
                        "type": "string",
                        "description": "A single MCP JSON-RPC 2.0 request to execute in one-shot mode (e.g. a tools/call). Leave empty when running as a long-lived stdio MCP server. If empty on the Apify platform, the Actor returns the tool catalog (tools/list) and exits.",
                        "default": ""
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
