### Development Setup for MCP Calc Tools Source: https://github.com/nbiish/mcp-calc-tools/blob/main/README.md Install project dependencies and start the development server. This is typically used for local development and testing. ```bash pnpm install pnpm start ``` -------------------------------- ### Install Dependencies Source: https://github.com/nbiish/mcp-calc-tools/blob/main/llms.txt Install all project dependencies using pnpm. ```bash pnpm install ``` -------------------------------- ### Start MCP Server Source: https://github.com/nbiish/mcp-calc-tools/blob/main/llms.txt Start the MCP server using Node.js. ```bash pnpm start ``` -------------------------------- ### Install MCP Calc Tools Source: https://github.com/nbiish/mcp-calc-tools/blob/main/README.md Configure your MCP client to use the calc-tools server. Ensure the command and path to the index.js file are correct for your environment. ```json { "mcpServers": { "calc-tools": { "command": "node", "args": ["/path/to/mcp-calc-tools/index.js"], "env": {} } } } ``` -------------------------------- ### Build Project Source: https://github.com/nbiish/mcp-calc-tools/blob/main/llms.txt Build the project. This command primarily ensures executable permissions for index.js. ```bash pnpm build ``` -------------------------------- ### Synchronize Core Documentation Files Source: https://github.com/nbiish/mcp-calc-tools/blob/main/critical.md Use these curl commands to download and update essential documentation files from the license-for-all-works repository. ```bash # License curl -fLo LICENSE https://raw.githubusercontent.com/nbiish/license-for-all-works/refs/heads/main/working-LICENSE # Contributing Guidelines curl -fLo CONTRIBUTING.md https://raw.githubusercontent.com/nbiish/license-for-all-works/refs/heads/main/CONTRIBUTING.md # Terms of Service curl -fLo Terms-of-Service.md https://raw.githubusercontent.com/nbiish/license-for-all-works/refs/heads/main/Terms-of-Service.md # Privacy Policy curl -fLo Privacy-Policy.md https://raw.githubusercontent.com/nbiish/license-for-all-works/refs/heads/main/Privacy-Policy.md # Critical Standards (Self-update) curl -fLo critical.md https://raw.githubusercontent.com/nbiish/license-for-all-works/refs/heads/main/critical.md ``` -------------------------------- ### Configure TLS 1.3 with ML-KEM-768 for Client Source: https://github.com/nbiish/mcp-calc-tools/blob/main/AGENTS.md Sets up an SSL context for a TLS 1.3 client, specifying ML-KEM-768 as a supported curve. Requires the oqs-provider. ```python import ssl ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT) ctx.minimum_version = ssl.TLSVersion.TLSv1_3 ctx.set_curves(["x25519_mlkem768", "mlkem768"]) ``` -------------------------------- ### Run Tests Source: https://github.com/nbiish/mcp-calc-tools/blob/main/llms.txt Execute the assert-based smoke tests for math functionalities. ```bash node test/math.test.js ``` -------------------------------- ### Run Code Formatting and Security Checks Source: https://github.com/nbiish/mcp-calc-tools/blob/main/AGENTS.md Execute build, linting, testing, security auditing, and secret detection tools. Ensure all checks pass before committing. ```bash uv build && uv run ruff check src/ && uv run pytest tests/ uv run bandit -r src/ && uv run pip-audit detect-secrets scan --all-files && gitleaks detect --source . --uncommitted ``` -------------------------------- ### GitHub Funding Configuration Source: https://github.com/nbiish/mcp-calc-tools/blob/main/critical.md Configure the .github/FUNDING.yml file with these details to enable the 'Sponsor' button on your GitHub repository. ```yaml # GitHub Sponsors and funding platforms for Nbiish's repositories # This file enables the "Sponsor" button on GitHub repositories github: [nbiish] # GitHub Sponsors username ko_fi: nbiish # Ko-fi username custom: [ "https://raw.githubusercontent.com/nbiish/license-for-all-works/8e9b73b269add9161dc04bbdd79f818c40fca14e/qr-stripe-donation.png", "https://www.buymeacoffee.com/nbiish" ] ``` -------------------------------- ### Download Donation Assets Source: https://github.com/nbiish/mcp-calc-tools/blob/main/critical.md Use these curl commands to download the Stripe QR code and the Buy Me a Coffee button SVG. ```bash # Stripe QR Code curl -fLo qr-stripe-donation.png https://raw.githubusercontent.com/nbiish/license-for-all-works/8e9b73b269add9161dc04bbdd79f818c40fca14e/qr-stripe-donation.png # Buy Me a Coffee Button curl -fLo buy-me-a-coffee.svg "https://img.buymeacoffee.com/button-api/?text=Buy%20me%20a%20coffee&emoji=&slug=nbiish&button_colour=FFDD00&font_colour=000000&font_family=Cookie&outline_colour=000000&coffee_colour=ffffff" ``` -------------------------------- ### Project Copyright Notice Source: https://github.com/nbiish/mcp-calc-tools/blob/main/critical.md This is the official copyright notice for the project. It should be used where appropriate. ```markdown Copyright © 2025 ᓂᐲᔥ ᐙᐸᓂᒥᑮ-ᑭᓇᐙᐸᑭᓯ (Nbiish Waabanimikii-Kinawaabakizi), also known legally as JUSTIN PAUL KENWABIKISE, professionally documented as Nbiish-Justin Paul Kenwabikise, Anishinaabek Dodem (Anishinaabe Clan): Animikii (Thunder), a descendant of Chief ᑭᓇᐙᐸᑭᓯ (Kinwaabakizi) of the Beaver Island Band, and an enrolled member of the sovereign Grand Traverse Band of Ottawa and Chippewa Indians. This work embodies Traditional Knowledge and Traditional Cultural Expressions. All rights reserved. ``` -------------------------------- ### Basic Symbolic Integration Source: https://github.com/nbiish/mcp-calc-tools/blob/main/llms.txt Performs basic symbolic integration for polynomials and common functions. Limited in scope. ```javascript integral(expression, variable?) ``` -------------------------------- ### PQC Audit Checklist Source: https://github.com/nbiish/mcp-calc-tools/blob/main/AGENTS.md This checklist must be run before any code output to ensure adherence to Post-Quantum Cryptography standards and security best practices. ```text - Banned Algorithms: [zero RSA/ECDSA/ECDH/MD5/SHA-1/AES-CBC?] - Encryption at Rest: [data stored? → AES-256-GCM + ML-KEM-768 key wrapping] - Encryption in Transit: [network calls? → TLS 1.3 + ML-KEM-768/hybrid + ML-DSA-65 certs] - Hash Integrity: [files/payloads? → SHA3-256 chunked + ML-DSA-65 signatures] - Key Management: [keys in KMS/HSM, not hardcoded or in .env?] - Input Validation: [paths contained, inputs sanitized, types checked?] - Secrets in Output: [none printed or leaked?] ``` -------------------------------- ### Value at Risk (VaR) Calculation Source: https://github.com/nbiish/mcp-calc-tools/blob/main/llms.txt Estimates the Value at Risk using the historical method. Requires a series of returns and a confidence level. ```javascript value_at_risk(returns[] (≥10), confidence?) ``` -------------------------------- ### BibTeX Citation for README.md Source: https://github.com/nbiish/mcp-calc-tools/blob/main/critical.md Include this BibTeX entry in your README.md file to cite the repository. Remember to replace <|repo_title|> with the actual repository name. ```bibtex @misc{<|repo_title|><|2025|>, author/creator/steward = {ᓂᐲᔥ ᐙᐸᓂᒥᑮ-ᑭᓇᐙᐸᑭᓯ (Nbiish Waabanimikii-Kinawaabakizi), also known legally as JUSTIN PAUL KENWABIKISE, professionally documented as Nbiish-Justin Paul Kenwabikise, Anishinaabek Dodem (Anishinaabe Clan): Animikii (Thunder), descendant of Chief ᑭᓇᐙᐸᑭᓯ (Kinwaabakizi) of the Beaver Island Band and enrolled member of the sovereign Grand Traverse Band of Ottawa and Chippewa Indians}, title/description = {<|repo_title|>}, type_of_work = {Indigenous digital creation/software incorporating traditional knowledge and cultural expressions}, year = {2025}, publisher/source/event = {GitHub repository under tribal sovereignty protections}, howpublished = {\url{https://github.com/nbiish/<|repo_title|>}}, note = {Authored and stewarded by ᓂᐲᔥ ᐙᐸᓂᒥᑮ-ᑭᓇᐙᐸᑭᓯ (Nbiish Waabanimikii-Kinawaabakizi), also known legally as JUSTIN PAUL KENWABIKISE, professionally documented as Nbiish-Justin Paul Kenwabikise, Anishinaabek Dodem (Anishinaabe Clan): Animikii (Thunder), descendant of Chief ᑭᓇᐙᐸᑭᓯ (Kinwaabakizi) of the Beaver Island Band and enrolled member of the sovereign Grand Traverse Band of Ottawa and Chippewa Indians. This work embodies Indigenous intellectual property, traditional knowledge systems (TK), traditional cultural expressions (TCEs), and associated data protected under tribal law, federal Indian law, treaty rights, Indigenous Data Sovereignty principles, and international indigenous rights frameworks including UNDRIP. All usage, benefit-sharing, and data governance are governed by the COMPREHENSIVE RESTRICTED USE LICENSE FOR INDIGENOUS CREATIONS WITH TRIBAL SOVEREIGNTY, DATA SOVEREIGNTY, AND WEALTH RECLAMATION PROTECTIONS.} } ``` -------------------------------- ### Calculus Tools Source: https://github.com/nbiish/mcp-calc-tools/blob/main/llms.txt Provides functions for symbolic and numerical calculus operations. ```APIDOC ## derivative ### Description Calculates the symbolic derivative of an expression with respect to a variable. ### Method N/A (Tool Function) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **expression** (string) - Required - The mathematical expression to differentiate. - **variable** (string) - Optional - The variable with respect to which to differentiate. Defaults to the first variable found. ### Request Example ```json { "expression": "x^2 + 2*x + 1", "variable": "x" } ``` ### Response #### Success Response (200) - **result** (string) - The symbolic derivative of the expression. #### Response Example ```json { "result": "2*x + 2" } ``` ## integral ### Description Performs basic symbolic integration of an expression with respect to a variable. Supports polynomials and common functions. ### Method N/A (Tool Function) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **expression** (string) - Required - The mathematical expression to integrate. - **variable** (string) - Optional - The variable with respect to which to integrate. Defaults to the first variable found. ### Request Example ```json { "expression": "x^2", "variable": "x" } ``` ### Response #### Success Response (200) - **result** (string) - The integrated expression. #### Response Example ```json { "result": "x^3/3" } ``` ## riemann_sum ### Description Approximates the definite integral of an expression using Riemann sums. ### Method N/A (Tool Function) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **expression** (string) - Required - The mathematical expression to integrate. - **variable** (string) - Required - The variable of integration. - **a** (number) - Required - The lower limit of integration. - **b** (number) - Required - The upper limit of integration. - **n** (number) - Optional - The number of subintervals (default: 1000, max: 100000). Higher values increase accuracy. - **method** (string) - Optional - The method for approximating the sum ('left', 'right', 'midpoint', 'trapezoid'). Defaults to 'midpoint'. ### Request Example ```json { "expression": "x^2", "variable": "x", "a": 0, "b": 1, "n": 1000, "method": "midpoint" } ``` ### Response #### Success Response (200) - **result** (number) - The approximate value of the definite integral. #### Response Example ```json { "result": 0.3333335 } ``` ## limit ### Description Numerically evaluates the limit of an expression as a variable approaches a certain value. ### Method N/A (Tool Function) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **expression** (string) - Required - The mathematical expression. - **variable** (string) - Required - The variable whose limit is being evaluated. - **approach** (number) - Required - The value the variable approaches. ### Request Example ```json { "expression": "(x^2 - 1) / (x - 1)", "variable": "x", "approach": 1 } ``` ### Response #### Success Response (200) - **result** (number | string) - The evaluated limit. Can be a number or a string if the limit cannot be determined numerically. #### Response Example ```json { "result": 2 } ``` ## volume_of_revolution ### Description Calculates the volume of a solid of revolution using the disk method. ### Method N/A (Tool Function) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **expression** (string) - Required - The function defining the curve (e.g., 'x^2'). - **start** (number) - Required - The starting point of the interval. - **end** (number) - Required - The ending point of the interval. - **steps** (number) - Optional - The number of steps for numerical integration (default: 1000). ### Request Example ```json { "expression": "sqrt(x)", "start": 0, "end": 4 } ``` ### Response #### Success Response (200) - **result** (number) - The calculated volume of revolution. #### Response Example ```json { "result": 25.1327 } ``` ``` -------------------------------- ### Python: Encryption at Rest with AES-GCM and ML-KEM-768 Source: https://github.com/nbiish/mcp-calc-tools/blob/main/AGENTS.md Demonstrates encrypting sensitive data using AES-256-GCM with a shared secret derived from ML-KEM-768 key encapsulation. The private key for ML-KEM should be managed securely in KMS/HSM in production. ```python import os from cryptography.hazmat.primitives.ciphers.aead import AESGCM from oqs import KeyEncapsulation # Receiver generates ML-KEM-768 keypair (production: private key in KMS/HSM) with KeyEncapsulation("ML-KEM-768") as receiver: receiver_pk = receiver.generate_keypair() # Sender encapsulates shared secret using Receiver's public key with KeyEncapsulation("ML-KEM-768") as sender: ciphertext_kem, shared_secret = sender.encap_secret(receiver_pk) # Use shared secret as AES-256 DEK nonce = os.urandom(12) # MUST be unique per encryption aesgcm = AESGCM(shared_secret) ciphertext_aes = aesgcm.encrypt( nonce, b"Sensitive data", b"metadata-id-101" # AAD binds ciphertext to context ) # Decrypt: shared_secret = receiver.decap_secret(ciphertext_kem) # plaintext = AESGCM(shared_secret).decrypt(nonce, ciphertext_aes, aad) ``` -------------------------------- ### Verify File Integrity with SHA3-256 Source: https://github.com/nbiish/mcp-calc-tools/blob/main/AGENTS.md Calculates the SHA3-256 hash of a file in 64KB chunks and compares it against an expected hexadecimal string. Handles large files efficiently. ```python import hashlib from oqs import Signature def verify_file_sha3(filepath: str, expected_hex: str) -> bool: hasher = hashlib.sha3_256() with open(filepath, 'rb') as f: for chunk in iter(lambda: f.read(65536), b''): # 64KB chunks (CWE-400) hasher.update(chunk) return hasher.hexdigest() == expected_hex ``` -------------------------------- ### Probability Tools Source: https://github.com/nbiish/mcp-calc-tools/blob/main/llms.txt Provides functions for probability distributions. ```APIDOC ## normal_distribution ### Description Evaluates the probability density function (PDF) of the normal distribution. ### Method N/A (Tool Function) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **x** (number) - Required - The value at which to evaluate the PDF. - **mu** (number) - Optional - The mean of the distribution. Defaults to 0. - **sigma** (number) - Optional - The standard deviation of the distribution. Defaults to 1. ### Request Example ```json { "x": 0, "mu": 0, "sigma": 1 } ``` ### Response #### Success Response (200) - **result** (number) - The value of the probability density function at x. #### Response Example ```json { "result": 0.39894 } ``` ## binomial_distribution ### Description Calculates the probability of exactly k successes in n independent Bernoulli trials. ### Method N/A (Tool Function) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **k** (number) - Required - The number of successes. - **n** (number) - Required - The number of trials. - **p** (number) - Required - The probability of success on a single trial. ### Request Example ```json { "k": 2, "n": 5, "p": 0.5 } ``` ### Response #### Success Response (200) - **result** (number) - The probability P(X=k). #### Response Example ```json { "result": 0.3125 } ``` ## poisson_distribution ### Description Calculates the probability of exactly k events occurring in a fixed interval of time or space, given a constant average rate. ### Method N/A (Tool Function) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **k** (number) - Required - The number of events. - **lambda** (number) - Required - The average rate of events (expected number of events). ### Request Example ```json { "k": 3, "lambda": 2.5 } ``` ### Response #### Success Response (200) - **result** (number) - The probability P(X=k). #### Response Example ```json { "result": 0.213763 } ``` ``` -------------------------------- ### Finance Tools Source: https://github.com/nbiish/mcp-calc-tools/blob/main/llms.txt Provides functions for financial calculations, including option pricing and risk assessment. ```APIDOC ## black_scholes ### Description Calculates the price of a European put or call option using the Black-Scholes model. ### Method N/A (Tool Function) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **S** (number) - Required - Current price of the underlying asset. - **K** (number) - Required - Strike price of the option. - **T** (number) - Required - Time to expiration in years. - **r** (number) - Required - Annual risk-free interest rate (e.g., 0.05 for 5%). - **sigma** (number) - Required - Annual volatility of the underlying asset (e.g., 0.2 for 20%). - **optionType** (string) - Optional - Type of option ('call' or 'put'). Defaults to 'call'. ### Request Example ```json { "S": 100, "K": 100, "T": 1, "r": 0.05, "sigma": 0.2, "optionType": "call" } ``` ### Response #### Success Response (200) - **result** (number) - The calculated price of the option. #### Response Example ```json { "result": 7.9653 } ``` ## option_greeks ### Description Calculates the option Greeks (Delta, Gamma, Vega, Theta, Rho) for a European option. ### Method N/A (Tool Function) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **S** (number) - Required - Current price of the underlying asset. - **K** (number) - Required - Strike price of the option. - **T** (number) - Required - Time to expiration in years. - **r** (number) - Required - Annual risk-free interest rate (e.g., 0.05 for 5%). - **sigma** (number) - Required - Annual volatility of the underlying asset (e.g., 0.2 for 20%). - **optionType** (string) - Optional - Type of option ('call' or 'put'). Defaults to 'call'. ### Request Example ```json { "S": 100, "K": 100, "T": 1, "r": 0.05, "sigma": 0.2, "optionType": "call" } ``` ### Response #### Success Response (200) - **result** ({delta, gamma, vega, theta, rho}) - An object containing the calculated Greek values. #### Response Example ```json { "result": { "delta": 0.5797, "gamma": 0.025, "vega": 10.0, "theta": -5.0, "rho": 3.0 } } ``` ## sharpe_ratio ### Description Calculates the Sharpe ratio for a series of returns. ### Method N/A (Tool Function) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **returns** (number[]) - Required - An array of historical returns. - **riskFreeRate** (number) - Optional - The risk-free rate (annualized). Defaults to 0. ### Request Example ```json { "returns": [0.01, 0.02, -0.01, 0.03, 0.015], "riskFreeRate": 0.02 } ``` ### Response #### Success Response (200) - **result** (number) - The calculated Sharpe ratio. #### Response Example ```json { "result": 1.0 } ``` ## value_at_risk ### Description Calculates the Value at Risk (VaR) using the historical method. ### Method N/A (Tool Function) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **returns** (number[]) - Required - An array of historical returns (at least 10). - **confidence** (number) - Optional - The confidence level (e.g., 0.95 for 95%). Defaults to 0.95. ### Request Example ```json { "returns": [0.01, -0.02, 0.03, -0.015, 0.02, -0.005, 0.015, -0.01, 0.025, -0.008], "confidence": 0.95 } ``` ### Response #### Success Response (200) - **result** (number) - The calculated Value at Risk. #### Response Example ```json { "result": -0.015 } ``` ## cashflow_schedule ### Description Generates a schedule of loan payments, including principal and interest over time. ### Method N/A (Tool Function) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **principal** (number) - Required - The initial loan amount. - **rate** (number) - Required - The annual interest rate (e.g., 0.05 for 5%). - **periods** (number) - Required - The total number of periods (e.g., years). - **compounds** (number) - Optional - The number of times interest is compounded per period. Defaults to 1 (annually). ### Request Example ```json { "principal": 10000, "rate": 0.05, "periods": 5, "compounds": 1 } ``` ### Response #### Success Response (200) - **result** ({period, interest, balance}[]) - An array of objects, each representing a payment period with details on interest paid and remaining balance. #### Response Example ```json { "result": [ {"period": 1, "interest": 500, "balance": 10500}, {"period": 2, "interest": 525, "balance": 11025}, {"period": 3, "interest": 551.25, "balance": 11576.25}, {"period": 4, "interest": 578.81, "balance": 12155.06}, {"period": 5, "interest": 607.75, "balance": 12762.82} ] } ``` ```