Skip to main content
Glama

MCP 계산 서버

MCP 프로토콜과 SymPy 라이브러리를 기반으로 강력한 기호 계산 기능을 제공하는 수학 계산 서비스입니다.

보안

0.1.1 버전부터 이 서버는 제한된 SymPy 전용 평가기를 통해 표현식을 구문 분석합니다. 임의의 Python 코드를 실행하지 않으며, 엄선된 수학 기호, 함수 및 행렬 메서드만 지원합니다.

또한 이번 릴리스에서는 비용이 많이 드는 기호 계산으로 인한 서비스 거부(DoS) 위험을 줄이기 위해 지나치게 큰 표현식과 방대한 결과값에 대한 유효성 검사가 추가되었습니다.

Related MCP server: mcp-sympy

주요 기능

  • 기본 연산: 덧셈, 뺄셈, 곱셈, 나눗셈, 거듭제곱

  • 대수 연산: 식 전개, 인수분해, 단순화

  • 미적분: 미분, 적분(정적분/부정적분), 극한 계산

  • 방정식 풀이: 대수 방정식, 연립 방정식

  • 행렬 연산: 행렬 역행렬, 고유값/고유벡터 계산

  • 급수 전개: 테일러 급수 전개

  • 특수 함수: 삼각 함수, 로그 함수, 지수 함수

사용 예시

# Basic operations
"2 + 3*5" → 17

# Algebraic operations
"expand((x + 1)**2)" → x² + 2x + 1
"factor(x**2 - 2*x - 15)" → (x - 5)(x + 3)

# Calculus
"diff(sin(x), x)" → cos(x)
"integrate(exp(x), (x, 0, 1))" → E - 1
"integrate(exp(-x**2)*sin(x), (x, -oo, oo))" → 0
"limit(tan(x)/x, x, 0)" → 1

# Equation solving
"solve(x**2 - 4, x)" → [-2, 2]
"solve([x**2 + y**2 - 1, x + y - 1], [x, y])" → [(0, 1), (1, 0)]

# Matrix operations
"Matrix([[1, 2], [3, 4]]).inv()" → [[-2, 1], [3/2, -1/2]]
"Matrix([[1, 2, 3], [4, 5, 6]]).eigenvals()" → {9/2 - sqrt(33)/2: 1, 9/2 + sqrt(33)/2: 1}
"Sum(k, (k, 1, 10)).doit()" → 55
"series(cos(x), x, 0, 4)" → 1 - x²/2 + O(x⁴)

설치

Smithery를 통한 설치

Smithery를 통해 Claude Desktop용 계산 서버를 자동으로 설치하려면 다음을 수행하세요:

npx -y @smithery/cli install @611711Dark/mcp_sympy_calculate_server --client claude

로컬 설치

  1. 저장소 복제:

git clone https://github.com/611711Dark/mcp_calculate_server.git
cd mcp_calculate_server
  1. 가상 환경 생성 및 의존성 설치:

uv venv
source .venv/bin/activate
uv pip install -e .
  1. 구성:

"calculate_expression1": {
   "isActive": false,
   "command": "python",
   "args": [
     "server.py"
   ],
   "cwd": "/path/to/mcp_calculate_server"
 }

API 사용법

수학 표현식 문자열을 전달하여 MCP 프로토콜을 통해 calculate_expression 도구를 호출하세요. 파서는 산술, expand, factor, simplify, diff, integrate, limit, series, solve, Matrix(...).det()/inv()/eigenvals()/eigenvects(), Sum(...).doit()과 같은 제한된 SymPy 표현식 세트를 허용합니다.

지원되는 이름

  • 기호: x, y, z, k와 같은 소문자 변수

  • 상수: pi, E, oo, I

  • 함수: Abs, sin, cos, tan, log, exp, sqrt, expand, factor, simplify, diff, integrate, limit, series, solve, Sum, Matrix

  • 행렬 메서드: .det(), .inv(), .eigenvals(), .eigenvects()

  • SymPy 메서드: Sum(...)과 같이 지원되는 객체에 대한 .doit()

유효성 검사 규칙

임의의 Python 기능, import, 파일 시스템 액세스 또는 기타 수학적이지 않은 구문에 의존하는 표현식은 의도적으로 거부됩니다. 매우 큰 전개식, 복잡도가 높은 풀이, 지나치게 큰 결과값 또한 서비스 거부 위험을 줄이기 위해 거부될 수 있습니다. 키워드 인수, 비공개 속성, 지원되지 않는 행렬 메서드, 잘못된 형식의 행렬 및 지원되지 않는 이름은 오류 메시지와 함께 거부됩니다.

의존성

  • mcp>=1.5.0

  • sympy>=1.13.3

감사의 말

소개 글을 작성해 준 이 블로그 게시물과 도움 및 책임 있는 공개를 해준 Stefano에게 감사드립니다.

라이선스

이 프로젝트는 MIT 라이선스 하에 배포됩니다. LICENSE 파일을 참조하세요.

中文版本

Available Tools

1 tool
calculate_expressionA

calculate mathematical expressions using the sympify function from sympy, parse and compute the input mathematical expression string, supports direct calls to SymPy functions (automatically recognizes x, y, z as symbolic variables) Parameters: expression (str): Mathematical expression, e.g., "223 - 344 * 6" or "sin(pi/2) + log(10)".Replace special symbols with approximate values, e.g., pi → 3.1415" Example expressions: "2 + 3*5" # Basic arithmetic → 17 "expand((x + 1)2)" # Expand → x² + 2x + 1 "diff(sin(x), x)" # Derivative → cos(x) "integrate(exp(x), (x, 0, 1))" # Definite integral → E - 1 "solve(x2 - 4, x)" # Solve equation → [-2, 2] "limit(tan(x)/x, x, 0)" # Limit → 1 "Sum(k, (k, 1, 10)).doit()" # Summation → 55 "Matrix([[1, 2], [3, 4]]).inv()" # Matrix inverse → [[-2, 1], [3/2, -1/2]] "simplify((x2 - 1)/(x + 1))" # Simplify → x - 1 "factor(x2 - 2*x - 15)" # Factorize → (x - 5)(x + 3) "series(cos(x), x, 0, 4)" # Taylor series → 1 - x²/2 + x⁴/24 + O(x⁴) "integrate(exp(-x*2)*sin(x), (x, -oo, oo))" # Complex integral "solve([x**2 + y*2 - 1, x + y - 1], [x, y])" # Solve system of equations "Matrix([[1, 2, 3], [4, 5, 6], [7, 8, 9]]).eigenvals()" # Matrix eigenvalues Returns: str: Calculation result. If the expression cannot be parsed or computed, returns an error message (str).

Inputs: expression (required). Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.1/5.0

    Scored across 1 tool

    Disambiguation5/5

    With only one tool, there is no possibility of ambiguity or confusion between tools. The single tool 'calculate_expression' has a clearly defined purpose that cannot be mistaken for any other tool in this server.

    Naming Consistency5/5

    The single tool name 'calculate_expression' follows a clear verb_noun pattern. With only one tool, naming consistency is inherently perfect as there are no other tools to compare against or create inconsistencies with.

    Tool Count2/5

    A single tool server is generally too minimal for most practical purposes, even for a focused domain like mathematical calculation. While the tool is powerful, having only one tool feels thin and limiting for what appears to be a comprehensive mathematical computation server.

    Completeness3/5

    The single tool covers a wide range of mathematical operations through expression parsing, but there are notable gaps in the surface area. For a calculation server, one might expect separate tools for different mathematical domains (algebra, calculus, matrix operations) or at least tools for common specific operations beyond general expression evaluation.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      C
      quality
      F
      maintenance
      A Mathematical Computation Protocol server providing 286 mathematical functions across multiple domains with flexible transport options (STDIO/HTTP) and streaming capabilities.
      100
      4
      Apache 2.0
    • A
      license
      C
      quality
      D
      maintenance
      An MCP server that provides access to SymPy's symbolic mathematics library for advanced algebraic computations. It enables users to perform complex tasks such as symbolic simplification, calculus, equation solving, matrix operations, and number theory.
      100
      50 PyPI
      1
      MIT
    • A
      license
      B
      quality
      D
      maintenance
      High-precision mathematics server for MCP clients, providing exact integer arithmetic, symbolic derivatives, and numerical calculus via LaTeX-style input.
      6
      5 npm
      2
      MIT