vibe-math-mcp


Namevibe-math-mcp JSON
Version 2.0.2 PyPI version JSON
download
home_pageNone
SummaryHigh-performance MCP server for mathematical operations using Polars and scientific Python
upload_time2025-10-30 18:26:31
maintainerNone
docs_urlNone
authorAkshay Petta
requires_python>=3.11
licenseNone
keywords mcp math mathematics statistics calculus linear-algebra finance polars numpy scipy
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Vibe Math MCP

[![PyPI version](https://badge.fury.io/py/vibe-math-mcp.svg)](https://badge.fury.io/py/vibe-math-mcp)
[![Python Version](https://img.shields.io/pypi/pyversions/vibe-math-mcp.svg)](https://pypi.org/project/vibe-math-mcp/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Smithery](https://smithery.ai/badge/@apetta/vibe-math-mcp)](https://smithery.ai/server/@apetta/vibe-math-mcp)
[![Test Coverage](https://img.shields.io/badge/coverage-87%25-brightgreen)](https://github.com/apetta/vibe-math)
[![Tests](https://img.shields.io/badge/tests-245%20passing-brightgreen)](https://github.com/apetta/vibe-math)

A high-performance Model Context Protocol (MCP) server for math-ing whilst vibing with LLMs. Built with Polars, Pandas, NumPy, SciPy, and SymPy for optimal calculation speed and comprehensive mathematical capabilities from basic arithmetic to advanced calculus and linear algebra.

## Features

**21 Mathematical Tools** across 6 domains + batch orchestration:

- **Basic Calculations** (4 tools): Expression evaluation, percentages, rounding, unit conversion
- **Array Operations** (4 tools): Element-wise operations, statistics, aggregations, transformations
- **Statistics** (3 tools): Descriptive statistics, pivot tables, correlations
- **Financial Mathematics** (3 tools): Time value of money, compound interest, perpetuity
- **Linear Algebra** (3 tools): Matrix operations, system solving, decompositions
- **Calculus** (3 tools): Derivatives, integrals, limits & series
- **Batch Execution** (1 tool): Multi-tool orchestration for complex workflows

## Installation

### IDEs

[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install_Math-0098FF?style=flat-square&logo=visualstudiocode&logoColor=ffffff)](vscode:mcp/install?%7B%22name%22%3A%22Math%22%2C%22type%22%3A%22stdio%22%2C%22command%22%3A%22uvx%22%2C%22args%22%3A%5B%22vibe-math-mcp%22%5D%7D)

[![Install MCP Server](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=Math&config=eyJjb21tYW5kIjoidXZ4IHZpYmUtbWF0aC1tY3AifQ%3D%3D)

### Claude Desktop

Open **Settings > Developer > Edit Config** and add:

**For published package:**

```json
{
  "mcpServers": {
    "Math": {
      "command": "uvx",
      "args": ["vibe-math-mcp"]
    }
  }
}
```

**For local development:**

```json
{
  "mcpServers": {
    "Math": {
      "command": "uv",
      "args": [
        "--directory",
        "/absolute/path/to/vibe-math-mcp",
        "run",
        "vibe-math-mcp"
      ]
    }
  }
}
```

### Claude Code

**Quick setup (CLI):**

Published package:

```bash
claude mcp add --transport stdio math -- uvx vibe-math-mcp
```

Local development:

```bash
claude mcp add --transport stdio math -- uvx --from /absolute/path/to/vibe-math-mcp vibe-math-mcp
```

**Team setup** (create `mcp.json` in project root for shared use with Claude Code and/or IDEs)

```json
{
  "mcpServers": {
    "math": {
      "command": "uvx",
      "args": ["vibe-math-mcp"]
    }
  }
}
```

**Verify:** Run `claude mcp list` or use `/mcp` or view available servers in IDEs.

### Try it

- "Calculate 15% of 250" → uses `percentage`
- "Find determinant of [[1,2],[3,4]]" → uses `matrix_operations`
- "Integrate x^2 from 0 to 1" → uses `integral`
- "If I invest $1000 at 5% annual interest compounded monthly for 10 years, what will be the future value?" → uses `compound_interest`
- If I was paid the square root of $69m in 10 years, what's the present value at 7% discount rate? → uses `batch_execute (calculate -> financial_calcs)`

## Output Control

All tools automatically support output control for maximum flexibility and token efficiency. The LLM can specify the desired verbosity.

Control response verbosity using the `output_mode` parameter (available on **every tool**):

| Mode      | Description                                        | Token Savings | Use Case                                    |
| --------- | -------------------------------------------------- | ------------- | ------------------------------------------- |
| `full`    | Complete response with all metadata (default)      | 0% (baseline) | Debugging, full context needed              |
| `compact` | Remove null fields, minimize whitespace            | ~20-30%       | Moderate reduction, preserve structure      |
| `minimal` | Primary value(s) only, strip metadata              | ~60-70%       | Fast extraction, minimal context            |
| `value`   | Normalized `{value: X}` structure                  | ~70-80%       | Consistent chaining, maximum simplicity     |
| `final`   | For sequential chains, return only terminal result | ~95%          | Simple calculations, predictable extraction |

## Batch Execution

For multi-step workflows, `batch_execute` chains multiple calculations in a single request—**achieving 90-95% token reduction**. Reference prior outputs using `$operation_id.result` syntax, and the engine automatically handles dependency resolution and parallel execution for speed.

**Perfect for:** Bond pricing, financial models, statistical pipelines, complex transformations

## Complete Tool Reference

**Note:** All tool parameters include detailed descriptions with concrete examples directly in the MCP interface. Each parameter shows expected format, use cases, and sample values to make usage obvious without referring to external documentation.

### Basic Calculations

| Tool            | Description                                                  |
| --------------- | ------------------------------------------------------------ |
| `calculate`     | Evaluate mathematical expressions with variable substitution |
| `percentage`    | Percentage calculations (of, increase, decrease, change)     |
| `round`         | Advanced rounding (round, floor, ceil, trunc)                |
| `convert_units` | Unit conversions (degrees � radians)                         |

### Array Operations

| Tool               | Description                                                      |
| ------------------ | ---------------------------------------------------------------- |
| `array_operations` | Element-wise operations (add, subtract, multiply, divide, power) |
| `array_statistics` | Statistical measures (mean, median, std, min, max, sum)          |
| `array_aggregate`  | Aggregations (sumproduct, weighted average, dot product)         |
| `array_transform`  | Transformations (normalise, standardise, scale, log)             |

### Statistics

| Tool          | Description                                            |
| ------------- | ------------------------------------------------------ |
| `statistics`  | Comprehensive analysis (describe, quartiles, outliers) |
| `pivot_table` | Create pivot tables with aggregation                   |
| `correlation` | Correlation matrices (Pearson, Spearman)               |

### Financial Mathematics

| Tool                | Description                                 |
| ------------------- | ------------------------------------------- |
| `financial_calcs`   | Time value of money (PV, FV, PMT, IRR, NPV) |
| `compound_interest` | Compound interest with various frequencies  |

### Linear Algebra

| Tool                   | Description                                                          |
| ---------------------- | -------------------------------------------------------------------- |
| `matrix_operations`    | Matrix operations (multiply, inverse, transpose, determinant, trace) |
| `solve_linear_system`  | Solve Ax = b systems                                                 |
| `matrix_decomposition` | Decompositions (eigen, SVD, QR, Cholesky, LU)                        |

### Calculus

| Tool            | Description                            |
| --------------- | -------------------------------------- |
| `derivative`    | Symbolic and numerical differentiation |
| `integral`      | Symbolic and numerical integration     |
| `limits_series` | Limits and series expansions           |

---

````

## Development

### Running Tests

```bash
# Install dependencies
uv sync

# Run all tests
uv run poe test

````

### Local Development Modes

**STDIO Mode** (default - for Claude Desktop, IDEs):

```bash
uv run vibe-math-mcp
```

**HTTP Mode** (for container testing):

```bash
uv run python -m vibe_math_mcp.http_server
```

## License

MIT License. See `LICENSE` file for details.

## Contributing

Contributions welcome via PRs! Please ensure:

1. Tests pass, and new ones are added if applicable
2. Code is linted & formatted
3. Type hints are included
4. Clear, actionable error messages are provided

## Support

For issues and questions, please open an issue on GitHub.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "vibe-math-mcp",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.11",
    "maintainer_email": null,
    "keywords": "mcp, math, mathematics, statistics, calculus, linear-algebra, finance, polars, numpy, scipy",
    "author": "Akshay Petta",
    "author_email": "Akshay Petta <33671231+apetta@users.noreply.github.com>",
    "download_url": "https://files.pythonhosted.org/packages/a7/16/b3214f5e1ed70a92867881c3ccb711b2a8b98db6bd0785e8640d85467340/vibe_math_mcp-2.0.2.tar.gz",
    "platform": null,
    "description": "# Vibe Math MCP\n\n[![PyPI version](https://badge.fury.io/py/vibe-math-mcp.svg)](https://badge.fury.io/py/vibe-math-mcp)\n[![Python Version](https://img.shields.io/pypi/pyversions/vibe-math-mcp.svg)](https://pypi.org/project/vibe-math-mcp/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Smithery](https://smithery.ai/badge/@apetta/vibe-math-mcp)](https://smithery.ai/server/@apetta/vibe-math-mcp)\n[![Test Coverage](https://img.shields.io/badge/coverage-87%25-brightgreen)](https://github.com/apetta/vibe-math)\n[![Tests](https://img.shields.io/badge/tests-245%20passing-brightgreen)](https://github.com/apetta/vibe-math)\n\nA high-performance Model Context Protocol (MCP) server for math-ing whilst vibing with LLMs. Built with Polars, Pandas, NumPy, SciPy, and SymPy for optimal calculation speed and comprehensive mathematical capabilities from basic arithmetic to advanced calculus and linear algebra.\n\n## Features\n\n**21 Mathematical Tools** across 6 domains + batch orchestration:\n\n- **Basic Calculations** (4 tools): Expression evaluation, percentages, rounding, unit conversion\n- **Array Operations** (4 tools): Element-wise operations, statistics, aggregations, transformations\n- **Statistics** (3 tools): Descriptive statistics, pivot tables, correlations\n- **Financial Mathematics** (3 tools): Time value of money, compound interest, perpetuity\n- **Linear Algebra** (3 tools): Matrix operations, system solving, decompositions\n- **Calculus** (3 tools): Derivatives, integrals, limits & series\n- **Batch Execution** (1 tool): Multi-tool orchestration for complex workflows\n\n## Installation\n\n### IDEs\n\n[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install_Math-0098FF?style=flat-square&logo=visualstudiocode&logoColor=ffffff)](vscode:mcp/install?%7B%22name%22%3A%22Math%22%2C%22type%22%3A%22stdio%22%2C%22command%22%3A%22uvx%22%2C%22args%22%3A%5B%22vibe-math-mcp%22%5D%7D)\n\n[![Install MCP Server](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=Math&config=eyJjb21tYW5kIjoidXZ4IHZpYmUtbWF0aC1tY3AifQ%3D%3D)\n\n### Claude Desktop\n\nOpen **Settings > Developer > Edit Config** and add:\n\n**For published package:**\n\n```json\n{\n  \"mcpServers\": {\n    \"Math\": {\n      \"command\": \"uvx\",\n      \"args\": [\"vibe-math-mcp\"]\n    }\n  }\n}\n```\n\n**For local development:**\n\n```json\n{\n  \"mcpServers\": {\n    \"Math\": {\n      \"command\": \"uv\",\n      \"args\": [\n        \"--directory\",\n        \"/absolute/path/to/vibe-math-mcp\",\n        \"run\",\n        \"vibe-math-mcp\"\n      ]\n    }\n  }\n}\n```\n\n### Claude Code\n\n**Quick setup (CLI):**\n\nPublished package:\n\n```bash\nclaude mcp add --transport stdio math -- uvx vibe-math-mcp\n```\n\nLocal development:\n\n```bash\nclaude mcp add --transport stdio math -- uvx --from /absolute/path/to/vibe-math-mcp vibe-math-mcp\n```\n\n**Team setup** (create `mcp.json` in project root for shared use with Claude Code and/or IDEs)\n\n```json\n{\n  \"mcpServers\": {\n    \"math\": {\n      \"command\": \"uvx\",\n      \"args\": [\"vibe-math-mcp\"]\n    }\n  }\n}\n```\n\n**Verify:** Run `claude mcp list` or use `/mcp` or view available servers in IDEs.\n\n### Try it\n\n- \"Calculate 15% of 250\" \u2192 uses `percentage`\n- \"Find determinant of [[1,2],[3,4]]\" \u2192 uses `matrix_operations`\n- \"Integrate x^2 from 0 to 1\" \u2192 uses `integral`\n- \"If I invest $1000 at 5% annual interest compounded monthly for 10 years, what will be the future value?\" \u2192 uses `compound_interest`\n- If I was paid the square root of $69m in 10 years, what's the present value at 7% discount rate? \u2192 uses `batch_execute (calculate -> financial_calcs)`\n\n## Output Control\n\nAll tools automatically support output control for maximum flexibility and token efficiency. The LLM can specify the desired verbosity.\n\nControl response verbosity using the `output_mode` parameter (available on **every tool**):\n\n| Mode      | Description                                        | Token Savings | Use Case                                    |\n| --------- | -------------------------------------------------- | ------------- | ------------------------------------------- |\n| `full`    | Complete response with all metadata (default)      | 0% (baseline) | Debugging, full context needed              |\n| `compact` | Remove null fields, minimize whitespace            | ~20-30%       | Moderate reduction, preserve structure      |\n| `minimal` | Primary value(s) only, strip metadata              | ~60-70%       | Fast extraction, minimal context            |\n| `value`   | Normalized `{value: X}` structure                  | ~70-80%       | Consistent chaining, maximum simplicity     |\n| `final`   | For sequential chains, return only terminal result | ~95%          | Simple calculations, predictable extraction |\n\n## Batch Execution\n\nFor multi-step workflows, `batch_execute` chains multiple calculations in a single request\u2014**achieving 90-95% token reduction**. Reference prior outputs using `$operation_id.result` syntax, and the engine automatically handles dependency resolution and parallel execution for speed.\n\n**Perfect for:** Bond pricing, financial models, statistical pipelines, complex transformations\n\n## Complete Tool Reference\n\n**Note:** All tool parameters include detailed descriptions with concrete examples directly in the MCP interface. Each parameter shows expected format, use cases, and sample values to make usage obvious without referring to external documentation.\n\n### Basic Calculations\n\n| Tool            | Description                                                  |\n| --------------- | ------------------------------------------------------------ |\n| `calculate`     | Evaluate mathematical expressions with variable substitution |\n| `percentage`    | Percentage calculations (of, increase, decrease, change)     |\n| `round`         | Advanced rounding (round, floor, ceil, trunc)                |\n| `convert_units` | Unit conversions (degrees \ufffd radians)                         |\n\n### Array Operations\n\n| Tool               | Description                                                      |\n| ------------------ | ---------------------------------------------------------------- |\n| `array_operations` | Element-wise operations (add, subtract, multiply, divide, power) |\n| `array_statistics` | Statistical measures (mean, median, std, min, max, sum)          |\n| `array_aggregate`  | Aggregations (sumproduct, weighted average, dot product)         |\n| `array_transform`  | Transformations (normalise, standardise, scale, log)             |\n\n### Statistics\n\n| Tool          | Description                                            |\n| ------------- | ------------------------------------------------------ |\n| `statistics`  | Comprehensive analysis (describe, quartiles, outliers) |\n| `pivot_table` | Create pivot tables with aggregation                   |\n| `correlation` | Correlation matrices (Pearson, Spearman)               |\n\n### Financial Mathematics\n\n| Tool                | Description                                 |\n| ------------------- | ------------------------------------------- |\n| `financial_calcs`   | Time value of money (PV, FV, PMT, IRR, NPV) |\n| `compound_interest` | Compound interest with various frequencies  |\n\n### Linear Algebra\n\n| Tool                   | Description                                                          |\n| ---------------------- | -------------------------------------------------------------------- |\n| `matrix_operations`    | Matrix operations (multiply, inverse, transpose, determinant, trace) |\n| `solve_linear_system`  | Solve Ax = b systems                                                 |\n| `matrix_decomposition` | Decompositions (eigen, SVD, QR, Cholesky, LU)                        |\n\n### Calculus\n\n| Tool            | Description                            |\n| --------------- | -------------------------------------- |\n| `derivative`    | Symbolic and numerical differentiation |\n| `integral`      | Symbolic and numerical integration     |\n| `limits_series` | Limits and series expansions           |\n\n---\n\n````\n\n## Development\n\n### Running Tests\n\n```bash\n# Install dependencies\nuv sync\n\n# Run all tests\nuv run poe test\n\n````\n\n### Local Development Modes\n\n**STDIO Mode** (default - for Claude Desktop, IDEs):\n\n```bash\nuv run vibe-math-mcp\n```\n\n**HTTP Mode** (for container testing):\n\n```bash\nuv run python -m vibe_math_mcp.http_server\n```\n\n## License\n\nMIT License. See `LICENSE` file for details.\n\n## Contributing\n\nContributions welcome via PRs! Please ensure:\n\n1. Tests pass, and new ones are added if applicable\n2. Code is linted & formatted\n3. Type hints are included\n4. Clear, actionable error messages are provided\n\n## Support\n\nFor issues and questions, please open an issue on GitHub.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "High-performance MCP server for mathematical operations using Polars and scientific Python",
    "version": "2.0.2",
    "project_urls": null,
    "split_keywords": [
        "mcp",
        " math",
        " mathematics",
        " statistics",
        " calculus",
        " linear-algebra",
        " finance",
        " polars",
        " numpy",
        " scipy"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "d9a5560b764b52b670df4605291ad01f20be6e9b957b2ca867cea9758c3d458b",
                "md5": "d5750bc2b6c15ce6cef06756874030cf",
                "sha256": "fac06e4070b235dd9854f5b7c3f86e21f97472f4a8711bff81c1aeccb12120ac"
            },
            "downloads": -1,
            "filename": "vibe_math_mcp-2.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d5750bc2b6c15ce6cef06756874030cf",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11",
            "size": 50523,
            "upload_time": "2025-10-30T18:26:30",
            "upload_time_iso_8601": "2025-10-30T18:26:30.862537Z",
            "url": "https://files.pythonhosted.org/packages/d9/a5/560b764b52b670df4605291ad01f20be6e9b957b2ca867cea9758c3d458b/vibe_math_mcp-2.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "a716b3214f5e1ed70a92867881c3ccb711b2a8b98db6bd0785e8640d85467340",
                "md5": "afcc4cd49956b8b58b1f404a832e4bda",
                "sha256": "629d7c5ad55b0081fb5dbf7a0160526a39d983adafdbd3f5bfb6325562d06cf6"
            },
            "downloads": -1,
            "filename": "vibe_math_mcp-2.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "afcc4cd49956b8b58b1f404a832e4bda",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11",
            "size": 41942,
            "upload_time": "2025-10-30T18:26:31",
            "upload_time_iso_8601": "2025-10-30T18:26:31.773584Z",
            "url": "https://files.pythonhosted.org/packages/a7/16/b3214f5e1ed70a92867881c3ccb711b2a8b98db6bd0785e8640d85467340/vibe_math_mcp-2.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-10-30 18:26:31",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "vibe-math-mcp"
}
        
Elapsed time: 0.78702s