Skip to main content
Glama

Basic Math MCP Server

by bahfahh

Basic Math MCP Server

A simple Model Context Protocol (MCP) server that provides basic mathematical operations.

Features

This MCP server provides two tools:

  • sum: Add two numbers together

  • subtraction: Subtract the second number from the first number

Installation

  1. Install dependencies:

npm install
  1. Build the TypeScript code:

npm run build

Usage

Testing the server directly

npm start

Connecting to AI clients (Claude Desktop, etc.)

  1. Copy the mcp.json configuration to your AI client's MCP configuration directory

  2. Update the path in mcp.json to point to your server's location

  3. Restart your AI client

Configuration for Claude Desktop

Add this to your Claude Desktop MCP configuration file:

{ "mcpServers": { "basic-math-server": { "command": "node", "args": ["/path/to/your/project/build/index.js"], "cwd": "/path/to/your/project", "description": "A basic math server providing sum and subtraction operations" } } }

Available Tools

sum

  • Description: Add two numbers together

  • Parameters:

    • a (number): First number

    • b (number): Second number

  • Returns: The sum of the two numbers

subtraction

  • Description: Subtract the second number from the first number

  • Parameters:

    • a (number): First number (minuend)

    • b (number): Second number (subtrahend)

  • Returns: The result of a - b

Development

  • Build: npm run build

  • Start: npm start

  • Development: npm run dev (builds and starts)

Project Structure

├── src/ │ └── index.ts # Main server implementation ├── build/ # Compiled JavaScript output ├── package.json # Node.js dependencies and scripts ├── tsconfig.json # TypeScript configuration ├── mcp.json # MCP server configuration └── README.md # This file
Deploy Server
A
security – no known vulnerabilities
F
license - not found
A
quality - confirmed to work

Related MCP Servers

  • A
    security
    F
    license
    A
    quality
    A server that provides tools for performing basic arithmetic operations (addition, subtraction, multiplication, division) via the Model Context Protocol.
    Last updated -
    4
    • Apple
  • -
    security
    -
    license
    -
    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.
  • -
    security
    -
    license
    -
    quality
    A simple Model Context Protocol server that provides basic arithmetic operations (addition, subtraction, multiplication, division) as tools that can be called by Large Language Models.
  • A
    security
    A
    license
    A
    quality
    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.
    Last updated -
    6
    60
    15
    MIT License
    • Linux

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/bahfahh/mcptest'

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