MCP Calculator Service

by amandhunna
Integrations
  • Manages environment variables for the MCP server, including Anthropic API keys and port configurations.

  • Used for making HTTP requests to the calculator API endpoints, enabling the MCP server to perform mathematical operations like addition, subtraction, multiplication, division, and power calculations.

  • Powers the API endpoints for both the calculator service and MCP server, handling requests for mathematical operations and tool execution.

MCP 계산기 서비스

Claude AI를 사용하여 자연어 요청을 처리하고 수학적 계산을 수행하는 계산기 서비스에 대한 MCP(모델-컨텍스트-프로토콜) 구현입니다.

건축학

이 서비스는 세 가지 주요 구성 요소로 구성됩니다.

  1. 계산기 API ( calculator-api.js ): 기본적인 수학 연산을 처리합니다.
  2. MCP 서버 ( mcp-server.js ): LLM 통합 및 도구 오케스트레이션을 관리합니다.
  3. MCP 클라이언트 ( mcp-client.js ): 서비스와 상호 작용하기 위한 사용자 인터페이스를 제공합니다.

설정

  1. 종속성 설치:

지엑스피1

  1. 다음 변수를 사용하여 루트 디렉토리에 .env 파일을 만듭니다.
ANTHROPIC_API_KEY=your_api_key_here PORT=3000 MCP_PORT=3001

서비스 실행

모든 구성 요소를 동시에 실행할 수 있습니다.

npm start

또는 개별적으로 실행합니다.

# Calculator API npm run start:calculator # MCP Server npm run start:mcp # MCP Client npm run start:client

용법

서비스가 실행되면 클라이언트 인터페이스를 통해 서비스와 상호 작용할 수 있습니다. 다음은 몇 가지 명령 예시입니다.

  • "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 (개발 종속성)
-
security - not tested
F
license - not found
-
quality - not tested

모델-컨텍스트-프로토콜 아키텍처를 통해 Claude AI와 계산기 API를 통합하여 수학적 계산을 수행하기 위한 자연어 요청을 처리하는 서비스입니다.

  1. 건축학
    1. 설정
      1. 서비스 실행
        1. 용법
          1. API 엔드포인트
            1. 계산기 API(포트 3000)
            2. MCP 서버(포트 3001)
          2. 오류 처리
            1. 종속성

              Related MCP Servers

              • -
                security
                F
                license
                -
                quality
                A Node.js server that processes mathematical calculations and natural language math queries through RESTful API endpoints.
                Last updated -
                JavaScript
              • A
                security
                F
                license
                A
                quality
                A 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 -
                4
                JavaScript
              • -
                security
                A
                license
                -
                quality
                A 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 -
                408
                2
                TypeScript
                MIT License
              • A
                security
                A
                license
                A
                quality
                A 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 -
                1
                75
                3
                TypeScript
                MIT License

              View all related MCP servers

              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/amandhunna/mcpserver'

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