MCP 계산기 서비스
Claude AI를 사용하여 자연어 요청을 처리하고 수학적 계산을 수행하는 계산기 서비스에 대한 MCP(모델-컨텍스트-프로토콜) 구현입니다.
건축학
이 서비스는 세 가지 주요 구성 요소로 구성됩니다.
- 계산기 API (
calculator-api.js
): 기본적인 수학 연산을 처리합니다. - MCP 서버 (
mcp-server.js
): LLM 통합 및 도구 오케스트레이션을 관리합니다. - MCP 클라이언트 (
mcp-client.js
): 서비스와 상호 작용하기 위한 사용자 인터페이스를 제공합니다.
설정
- 종속성 설치:
지엑스피1
- 다음 변수를 사용하여 루트 디렉토리에
.env
파일을 만듭니다.
서비스 실행
모든 구성 요소를 동시에 실행할 수 있습니다.
또는 개별적으로 실행합니다.
용법
서비스가 실행되면 클라이언트 인터페이스를 통해 서비스와 상호 작용할 수 있습니다. 다음은 몇 가지 명령 예시입니다.
- "5와 3을 더하세요"
- "10 더하기 20은 몇인가요?"
- "7.5 + 2.25를 계산하세요"
- "4에 6을 곱하세요"
- "8 곱하기 3은 얼마입니까?"
더 많은 예를 보려면 "help"를 입력하고, 종료하려면 "exit"를 입력하세요.
API 엔드포인트
계산기 API(포트 3000)
POST /:operation
- 수학 연산(덧셈, 뺄셈, 곱셈, 나눗셈, 거듭제곱)을 수행합니다.GET /health
- 상태 확인 엔드포인트
MCP 서버(포트 3001)
GET /tools
- 사용 가능한 도구 나열POST /execute/:toolId
- 특정 도구 실행POST /agent
- 자연어 요청 처리GET /health
- 상태 확인 엔드포인트
오류 처리
이 서비스에는 다음에 대한 포괄적인 오류 처리가 포함됩니다.
- 잘못된 수학 연산
- 0으로 나누기
- 잘못된 매개변수 유형
- LLM 응답 구문 분석 오류
- 네트워크 오류
종속성
- @anthropic-ai/sdk: ^0.51.0
- 악시오스: ^1.6.7
- 바디 파서: ^1.20.2
- 코르스: ^2.8.5
- dotenv: ^16.4.5
- 표현: ^4.18.3
- 동시: ^8.2.2 (개발 종속성)
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
모델-컨텍스트-프로토콜 아키텍처를 통해 Claude AI와 계산기 API를 통합하여 수학적 계산을 수행하기 위한 자연어 요청을 처리하는 서비스입니다.
Related MCP Servers
- -securityFlicense-qualityA Node.js server that processes mathematical calculations and natural language math queries through RESTful API endpoints.Last updated -JavaScript
- AsecurityFlicenseAqualityA simple server that provides basic arithmetic operations (addition, subtraction, multiplication, division) as tools that can be called by Large Language Models through the Model Context Protocol.Last updated -4JavaScript
- -securityAlicense-qualityA mathematical expression calculator that processes user-input expressions and returns computed results, supporting basic operations and built-in constants like PI and E.Last updated -4082TypeScriptMIT License
- AsecurityAlicenseAqualityA Model Context Protocol server implementation that enables AI assistants like Claude to perform Google searches and retrieve web data directly through natural language requests.Last updated -111428TypeScriptMIT License