Skip to main content
Glama
souravjai

Calculator MCP Server

by souravjai

Calculator MCP Server

Небольшой сервер Model Context Protocol (MCP), который предоставляет базовые операции калькулятора через stdio.

Учебное пособие по серверу Calculator MCP

Возможности

Сервер предоставляет следующие инструменты:

Инструмент

Описание

Аргументы

add

Складывает два числа

op1, op2

sub

Вычитает второе число из первого

op1, op2

mul

Умножает два числа

op1, op2

div

Делит первое число на второе

op1, op2

Все аргументы должны быть числами. div возвращает ошибку, когда op2 равен 0.

Related MCP server: Math MCP Server

Требования

  • Node.js 18 или новее

  • npm

Установка

Установите зависимости из этого каталога:

npm install

Запуск сервера

Запустите MCP-сервер через stdio:

npm start

Сервер ожидает подключения MCP-клиента, поэтому он не выводит обычные результаты работы приложения в терминал.

Тестирование с примером клиента

Пример клиента запускает сервер, выводит список его инструментов и вызывает div с числами 10 и 0, чтобы продемонстрировать ошибку деления на ноль:

npm run test-client

Чтобы проверить успешную операцию, измените аргументы callTool в файле mcp-client-test.ts, например:

arguments: { op1: 10, op2: 2 },

Использование MCP Inspector

Запустите интерактивный MCP Inspector командой:

npm run mcp-inspect

Откройте URL, выведенный командой, затем выберите инструмент калькулятора и укажите значения для op1 и op2.

Файлы проекта

  • mcp-server.ts — определения MCP-сервера и инструментов калькулятора

  • mcp-client-test.ts — пример MCP-клиента

  • mcp-calculator.gif — видеопрохождение учебного пособия

  • package.json — сценарии и зависимости

A
license - permissive license
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

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

Related MCP Servers

  • A
    license
    A
    quality
    C
    maintenance
    Enables basic arithmetic operations (addition, subtraction, multiplication, division) with 64-bit precision and matrix multiplication capabilities. Provides mathematical computation tools for AI assistants through the Model Context Protocol.
    5
    1
    MIT
  • F
    license
    A
    quality
    D
    maintenance
    Provides basic mathematical operations including addition, subtraction, multiplication, division, and power calculations through a Model Context Protocol interface.
    5
    1
  • F
    license
    Not graded
    quality
    D
    maintenance
    Provides file reading and mathematical calculation tools through the Model Context Protocol. Enables reading file contents and evaluating mathematical expressions via stdio transport.

View all related MCP servers

Related MCP Connectors

  • Precision math engine for AI agents. 203 exact methods. Zero hallucination.

  • A Model Context Protocol server for Wix AI tools

  • AI-callable calculators and engineering models with real formulas. No hallucinated math.

View all MCP Connectors

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/souravjai/calculator-mcp-server'

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