Skip to main content
Glama
amandhunna

MCP Calculator Service

by amandhunna

MCP-Rechnerdienst

Eine Model-Context-Protocol (MCP)-Implementierung für einen Rechnerdienst, der Claude AI verwendet, um Anfragen in natürlicher Sprache zu verarbeiten und mathematische Berechnungen durchzuführen.

Architektur

Der Service besteht aus drei Hauptkomponenten:

  1. Rechner-API ( calculator-api.js ): Behandelt grundlegende mathematische Operationen

  2. MCP-Server ( mcp-server.js ): Verwaltet die LLM-Integration und Tool-Orchestrierung

  3. MCP-Client ( mcp-client.js ): Bietet eine Benutzeroberfläche für die Interaktion mit dem Dienst

Related MCP server: Calculator MCP

Aufstellen

  1. Installieren Sie Abhängigkeiten:

npm install
  1. Erstellen Sie im Stammverzeichnis eine .env Datei mit den folgenden Variablen:

ANTHROPIC_API_KEY=your_api_key_here
PORT=3000
MCP_PORT=3001

Ausführen des Dienstes

Sie können alle Komponenten gleichzeitig ausführen:

npm start

Oder führen Sie sie einzeln aus:

# Calculator API
npm run start:calculator

# MCP Server
npm run start:mcp

# MCP Client
npm run start:client

Verwendung

Sobald der Dienst läuft, können Sie über die Client-Oberfläche mit ihm interagieren. Hier sind einige Beispielbefehle:

  • "Addiere 5 und 3"

  • "Was ist 10 plus 20?"

  • "Berechnen Sie 7,5 + 2,25"

  • "Multipliziere 4 mit 6"

  • "Was ist 8 mal 3?"

Geben Sie „help“ für weitere Beispiele oder „exit“ zum Beenden ein.

API-Endpunkte

Rechner-API (Port 3000)

  • POST /:operation - Führen Sie mathematische Operationen aus (Addieren, Subtrahieren, Multiplizieren, Dividieren, Potenzieren)

  • GET /health – Endpunkt für die Integritätsprüfung

MCP-Server (Port 3001)

  • GET /tools - Liste der verfügbaren Tools

  • POST /execute/:toolId – Ein bestimmtes Tool ausführen

  • POST /agent – Anfragen in natürlicher Sprache verarbeiten

  • GET /health – Endpunkt für die Integritätsprüfung

Fehlerbehandlung

Der Service umfasst eine umfassende Fehlerbehandlung für:

  • Ungültige mathematische Operationen

  • Division durch Null

  • Ungültige Parametertypen

  • LLM-Antwortanalysefehler

  • Netzwerkfehler

Abhängigkeiten

  • @anthropic-ai/sdk: ^0.51.0

  • Axios: ^1.6.7

  • Body-Parser: ^1.20.2

  • Kors: ^2.8.5

  • dotenv: ^16.4.5

  • Express: ^4.18.3

  • gleichzeitig: ^8.2.2 (Entwicklerabhängigkeit)

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

ActivityInactive
ResponsivenessNo issues

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
    A
    quality
    C
    maintenance
    A Model Context Protocol server that provides basic mathematical and statistical functions to LLMs, enabling them to perform accurate numerical calculations through a simple API.
    13
    37
    174
    MIT
  • A
    license
    B
    quality
    C
    maintenance
    A Model Context Protocol server that provides basic calculator functionality for LLMs, enabling them to perform mathematical operations like addition, subtraction, multiplication, division, modulo, and square root.
    6
    304
    16
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    A backend service that provides accurate arithmetic calculation capabilities to AI models via the Model Context Protocol, allowing LLMs to offload mathematical computations for numerical queries.
    1
    MIT
  • A
    license
    B
    quality
    D
    maintenance
    A simple Model Context Protocol (MCP) server that provides basic calculation functions to Claude. It enables users to perform mathematical operations like addition directly through natural language commands.
    1
    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/amandhunna/mcpserver'

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