Skip to main content
Glama
cyanheads

calculator-mcp-server

by cyanheads

Version License Docker MCP SDK npm TypeScript Bun

Install in Claude Desktop Install in Cursor Install in VS Code

Framework

공개 호스팅 서버: https://calculator.caseyjhand.com/mcp


도구

모든 수학 연산을 위한 단일 도구:

도구 이름

설명

calculate

수학 표현식 평가, 대수 표현식 단순화, 또는 기호 미분 계산.

calculate

서버의 목적을 100% 충족하는 단일 도구입니다. operation 매개변수의 기본값은 evaluate이므로, 일반적인 경우는 { expression: "..." }만 전달하면 됩니다.

  • Evaluate(평가) — 산술, 삼각법, 로그, 통계, 행렬, 복소수, 단위 변환, 조합론

  • Simplify(단순화) — 대수 표현식을 기호적으로 축소합니다 (예: 2x + 3x -> 5 * x). 대수 및 삼각 항등식을 지원합니다

  • Derivative(미분) — 기호 미분을 계산합니다 (예: 3x^2 + 2x + 1 -> 6 * x + 2)

  • scope 매개변수를 통한 변수 범위: { "x": 5, "y": 3 }

  • 숫자 결과에 대한 정밀도 설정 가능

  • 폼 기반 MCP 클라이언트에서 전달된 빈 variableprecision 값은 생략된 것으로 처리됩니다


Related MCP server: math-mcp

리소스

URI 패턴

설명

calculator://help

사용 가능한 함수, 연산자, 상수 및 구문 참조.


기능

@cyanheads/mcp-ts-core 기반:

  • 선언적 도구 정의 — 도구당 단일 파일, 프레임워크가 등록 및 검증 처리

  • 모든 도구에 대한 통합 오류 처리

  • 선택적 OpenTelemetry 추적을 지원하는 구조화된 로깅

  • 로컬(stdio/HTTP) 또는 Docker에서 실행

계산기 전용:

  • 강화된 math.js v15 인스턴스 — 위험한 함수 비활성화, vm.runInNewContext() 및 타임아웃으로 평가 샌드박싱

  • 인증 불필요 — 모든 작업은 읽기 전용이며 상태 비저장

  • 입력 검증: 표현식 길이 제한, 표현식 구분자 거부(세미콜론 및 줄바꿈), 숫자 전용 scope 값

  • 결과 검증: 차단된 결과 유형(함수, 파서, 결과 집합), 구성 가능한 최대 결과 크기

  • Scope 정화: 숫자 전용 값, 프로토타입 오염 방지(__proto__, constructor 등 차단)


시작하기

공개 호스팅 인스턴스

공개 인스턴스는 https://calculator.caseyjhand.com/mcp에서 사용할 수 있습니다 — 설치가 필요 없습니다. Streamable HTTP를 통해 모든 MCP 클라이언트를 연결하세요:

{
  "mcpServers": {
    "calculator-mcp-server": {
      "type": "streamable-http",
      "url": "https://calculator.caseyjhand.com/mcp"
    }
  }
}

자체 호스팅 / 로컬

MCP 클라이언트 구성 파일에 다음 중 하나를 추가하세요:

{
  "mcpServers": {
    "calculator-mcp-server": {
      "type": "stdio",
      "command": "bunx",
      "args": ["@cyanheads/calculator-mcp-server@latest"]
    }
  }
}

또는 npx 사용(Bun 불필요):

{
  "mcpServers": {
    "calculator-mcp-server": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@cyanheads/calculator-mcp-server@latest"]
    }
  }
}

또는 Docker 사용:

{
  "mcpServers": {
    "calculator-mcp-server": {
      "type": "stdio",
      "command": "docker",
      "args": [
        "run", "-i", "--rm",
        "-e", "MCP_TRANSPORT_TYPE=stdio",
        "ghcr.io/cyanheads/calculator-mcp-server:latest"
      ]
    }
  }
}

사전 요구 사항

설치

  1. 저장소를 클론합니다:

git clone https://github.com/cyanheads/calculator-mcp-server.git
  1. 디렉터리로 이동합니다:

cd calculator-mcp-server
  1. 의존성을 설치합니다:

bun install

구성

변수

설명

기본값

CALC_MAX_EXPRESSION_LENGTH

허용되는 최대 표현식 문자열 길이 (10–10,000).

1000

CALC_EVALUATION_TIMEOUT_MS

최대 평가 시간(밀리초) (100–30,000).

5000

CALC_MAX_RESULT_LENGTH

최대 결과 문자열 길이(문자 수) (1,000–1,000,000).

100000

MCP_TRANSPORT_TYPE

전송 방식: stdio 또는 http.

stdio

MCP_HTTP_HOST

HTTP 서버의 호스트 이름.

localhost

MCP_HTTP_PORT

HTTP 서버 포트.

3010

MCP_HTTP_ENDPOINT_PATH

HTTP MCP 엔드포인트 경로.

/mcp

MCP_HTTP_MAX_BODY_BYTES

최대 인바운드 HTTP 요청 크기; 0은 제한을 비활성화합니다.

1048576

MCP_AUTH_MODE

인증 모드: none, jwt 또는 oauth.

none

MCP_LOG_LEVEL

로그 수준 (RFC 5424).

info

선택적 세션, 재개 가능성, 로깅 및 텔레메트리 설정은 .env.example을 참조하세요.


서버 실행

로컬 개발

  • 프로덕션 버전 빌드 및 실행:

    bun run build
    bun run start:http   # or start:stdio
  • 검사 및 테스트 실행:

    bun run devcheck     # Lints, formats, type-checks
    bun run test         # Runs test suite

Docker

docker build -t calculator-mcp-server .
docker run -p 3010:3010 calculator-mcp-server

이미지는 기본적으로 포트 3010에서 Streamable HTTP, 상태 비저장 세션, /var/log/calculator-mcp-server에 로그를 기록합니다.


프로젝트 구조

디렉터리

용도

src/mcp-server/tools/

도구 정의 (*.tool.ts).

src/mcp-server/resources/

리소스 정의 (*.resource.ts).

src/services/

도메인 서비스 통합 (MathService).

src/config/

Zod를 사용한 환경 변수 파싱 및 검증.

docs/

생성된 디렉터리 트리.


개발 가이드

개발 지침 및 아키텍처 규칙은 AGENTS.md 또는 CLAUDE.md를 참조하세요. 요약:

  • 핸들러는 throw하고 프레임워크가 catch합니다 — 도구 로직에 try/catch 없음

  • 로깅에는 ctx.log 사용

  • 새 도구 및 리소스는 src/index.ts에 등록


기여

이슈 및 풀 리퀘스트를 환영합니다. 제출 전에 검사를 실행하세요:

bun run devcheck
bun run test

라이선스

Apache-2.0 — 자세한 내용은 LICENSE를 참조하세요.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

No tool schema history has been recorded yet.

Maintenance

ActivityMaintained
ResponsivenessResponsive

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    B
    quality
    A
    maintenance
    Provides secure mathematical computation capabilities including expression evaluation, symbolic math (derivatives, simplification), matrix operations, statistics, and unit conversion, with multi-tier acceleration through WebAssembly and WebWorkers for high-performance calculations.
    7
    178
    ISC
  • A
    license
    A
    quality
    C
    maintenance
    A secure MCP server for evaluating mathematical expressions with grammar validation, function whitelisting, and sandboxed execution. It provides tools for expression evaluation, variable management, and resources for grammar and function documentation.
    6
    37
    MIT
  • A
    license
    B
    quality
    C
    maintenance
    High-precision mathematics server for MCP clients, providing exact integer arithmetic, symbolic derivatives, and numerical calculus via LaTeX-style input.
    6
    17
    2
    MIT
  • A
    license
    Not graded
    quality
    A
    maintenance
    Provides a token-efficient exact math engine for AI agents, enabling computation of derivatives, integrals, equations, and optimized Python/NumPy code via a single MCP tool.
    4
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/cyanheads/calculator-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server