Cover image
Try Now
2025-03-11

模型上下文协议(MCP)服务器,该服务器为Claude提供高级数学计算功能

3 years

Works with Finder

1

Github Watches

2

Github Forks

5

Github Stars

Mathematical Calculator MCP Server

This is a Model Context Protocol (MCP) server that provides Claude with advanced mathematical calculation capabilities, including symbolic math, statistical analysis, and matrix operations.

Features

The Mathematical Calculator MCP Server provides the following tools:

  • Basic Calculations: Evaluate mathematical expressions safely
  • Symbolic Mathematics:
    • Solve equations (linear, quadratic, polynomial, etc.)
    • Calculate derivatives of expressions
    • Compute integrals of expressions
  • Statistical Analysis:
    • Mean, median, mode
    • Variance, standard deviation
    • Correlation coefficient
    • Linear regression
    • Confidence intervals
  • Matrix Operations:
    • Matrix addition
    • Matrix multiplication
    • Matrix transposition

Installation

Prerequisites

  • Python 3.10+ (recommended: Python 3.11+)
  • uv (recommended) or pip
  • Claude Desktop app (to use the MCP server with Claude)

Installation Steps

  1. Clone the repository:

    git clone https://github.com/huhabla/calculator-mcp-server.git
    cd calculator-mcp-server
    
  2. (Option 1) Setup with the provided script:

    chmod +x setup_venv.sh
    ./setup_venv.sh
    

    (Option 2) Or manually set up the virtual environment:

    python3 -m venv venv
    source venv/bin/activate
    pip install -r requirements.txt
    
  3. Run doc-tests to verify everything works:

    bash run_doctests.sh
    

Integration with Claude Desktop

To use this MCP server with Claude Desktop:

  1. Make sure you have uv installed (Installation Guide)

  2. Install the MCP server in Claude Desktop:

    fastmcp install calculator_server.py
    

    Or with a custom name:

    fastmcp install calculator_server.py --name "Math Calculator"
    
  3. Once installed, Claude will automatically have access to all the mathematical tools and functions.

Usage Examples

After integrating with Claude Desktop, you can ask Claude to perform various mathematical operations. Here are some examples:

Basic Calculations

Can you calculate 3.5^2 * sin(pi/4)?

Solving Equations

Solve the following equation: x^2 - 5x + 6 = 0

Calculating Derivatives

What's the derivative of sin(x^2) with respect to x?

Computing Integrals

Calculate the integral of x^2 * e^x

Statistical Analysis

Find the mean, median, mode, and standard deviation of this dataset: [23, 45, 12, 67, 34, 23, 18, 95, 41, 23]

Linear Regression

Perform a linear regression on these points: (1,2), (2,3.5), (3,5.1), (4,6.5), (5,8.2)

Matrix Operations

Multiply these two matrices:
[1, 2, 3]
[4, 5, 6]

and

[7, 8]
[9, 10]
[11, 12]

Development

Testing

Run the comprehensive doctest suite:

bash run_doctests.sh

Interactive Development Mode

For development and debugging, you can use the FastMCP development mode:

fastmcp dev calculator_server.py

This will start a local web interface where you can test all tools interactively.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgements

  • FastMCP for the Pythonic MCP server framework
  • SymPy for symbolic mathematics
  • NumPy and SciPy for numerical and statistical computations

相关推荐

  • NiKole Maxwell
  • I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Callycode Limited
  • A geek-themed horoscope generator blending Bitcoin prices, tech jargon, and astrological whimsy.

  • Khalid kalib
  • Write professional emails

  • ANGEL LEON
  • A world class elite tech co-founder entrepreneur, expert in software development, entrepreneurship, marketing, coaching style leadership and aligned with ambition for excellence, global market penetration and worldy perspectives.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • Alexandru Strujac
  • Efficient thumbnail creator for YouTube videos

  • INFOLAB OPERATIONS 2
  • A medical specialist offering assistance grounded in clinical guidelines. Disclaimer: This is intended for research and is NOT safe for clinical use!

  • apappascs
  • 发现市场上最全面,最新的MCP服务器集合。该存储库充当集中式枢纽,提供了广泛的开源和专有MCP服务器目录,并提供功能,文档链接和贡献者。

  • ShrimpingIt
  • MCP系列GPIO Expander的基于Micropython I2C的操作,源自ADAFRUIT_MCP230XX

  • OffchainLabs
  • 进行以太坊的实施

  • huahuayu
  • 统一的API网关,用于将多个Etherscan样区块链Explorer API与对AI助手的模型上下文协议(MCP)支持。

  • deemkeen
  • 用电源组合控制您的MBOT2:MQTT+MCP+LLM

  • zhaoyunxing92
  • MCP(消息连接器协议)服务

  • pontusab
  • 光标与风浪冲浪社区,查找规则和MCP

    Reviews

    4 (1)
    Avatar
    user_B7r8GBmI
    2025-04-16

    I have been using the calculator-mcp-server by huhabla and it's an outstanding tool! The server handles complex mathematical computations with exceptional speed and accuracy. The integration process is seamless and the documentation is thorough. Highly recommend for anyone needing a reliable mathematical computing solution.