calculator-mcp-server
공개 호스팅 서버: https://calculator.caseyjhand.com/mcp
도구
모든 수학 연산을 위한 단일 도구:
도구 이름 | 설명 |
| 수학 표현식 평가, 대수 표현식 단순화, 또는 기호 미분 계산. |
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 클라이언트에서 전달된 빈
variable및precision값은 생략된 것으로 처리됩니다
Related MCP server: pycodemath
리소스
URI 패턴 | 설명 |
| 사용 가능한 함수, 연산자, 상수 및 구문 참조. |
기능
선언적 도구 정의 — 도구당 단일 파일, 프레임워크가 등록 및 검증 처리
모든 도구에 대한 통합 오류 처리
선택적 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"
]
}
}
}사전 요구 사항
Bun v1.3.0 이상
설치
저장소를 클론합니다:
git clone https://github.com/cyanheads/calculator-mcp-server.git디렉터리로 이동합니다:
cd calculator-mcp-server의존성을 설치합니다:
bun install구성
변수 | 설명 | 기본값 |
| 허용되는 최대 표현식 문자열 길이 (10–10,000). |
|
| 최대 평가 시간(밀리초) (100–30,000). |
|
| 최대 결과 문자열 길이(문자 수) (1,000–1,000,000). |
|
| 전송 방식: |
|
| HTTP 서버의 호스트 이름. |
|
| HTTP 서버 포트. |
|
| HTTP MCP 엔드포인트 경로. |
|
| 최대 인바운드 HTTP 요청 크기; |
|
| 인증 모드: |
|
| 로그 수준 (RFC 5424). |
|
선택적 세션, 재개 가능성, 로깅 및 텔레메트리 설정은 .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에 로그를 기록합니다.
프로젝트 구조
디렉터리 | 용도 |
| 도구 정의 ( |
| 리소스 정의 ( |
| 도메인 서비스 통합 (MathService). |
| Zod를 사용한 환경 변수 파싱 및 검증. |
| 생성된 디렉터리 트리. |
개발 가이드
개발 지침 및 아키텍처 규칙은 AGENTS.md 또는 CLAUDE.md를 참조하세요. 요약:
핸들러는 throw하고 프레임워크가 catch합니다 — 도구 로직에
try/catch없음로깅에는
ctx.log사용새 도구 및 리소스는
src/index.ts에 등록
기여
이슈 및 풀 리퀘스트를 환영합니다. 제출 전에 검사를 실행하세요:
bun run devcheck
bun run test라이선스
Apache-2.0 — 자세한 내용은 LICENSE를 참조하세요.
This server cannot be deployed
Maintenance
Related MCP Connectors
Math.js MCP — wraps the mathjs.org API (free, no auth)
Safe scientific calculator MCP for numeric expressions
Newton MCP — wraps the Newton math solver API (free, no auth)
Find and call the right MCP server for any task - pay per use, no install.
Related MCP Servers
- AlicenseBqualityDmaintenanceHigh-precision mathematics server for MCP clients, providing exact integer arithmetic, symbolic derivatives, and numerical calculus via LaTeX-style input.65 npm2MIT
- AlicenseNot gradedqualityBmaintenanceProvides 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.8MIT
- AlicenseAqualityDmaintenanceSafe MCP server for math operations: evaluate, simplify, and differentiate expressions with configurable precision, using a sandboxed worker thread and strict AST allowlist to block dangerous input.3MIT
- AlicenseNot gradedqualityAmaintenanceEnables AI agents to perform safe sandboxed expression evaluation, symbolic calculus such as derivatives, simplification, equation solving and integration, statistical analysis, and JSON-native matrix operations. Everything is computed statelessly through the Model Context Protocol over stdio, HTTP, or SSE.118 npmMIT