Skip to main content
Glama
bahfahh

Basic Math MCP Server

by bahfahh
README.md
# 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:
```bash
npm install
```

2. Build the TypeScript code:
```bash
npm run build
```

## Usage

### Testing the server directly
```bash
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:

```json
{
  "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
```

TDQS

B3.1/5.0

Scored across 2 tools

Disambiguation5/5

The two tools have perfectly distinct purposes: 'sum' for addition and 'subtraction' for subtraction. There is no overlap or ambiguity between them, making it impossible for an agent to confuse which tool to use for each operation.

Naming Consistency4/5

The tool names are clear and descriptive ('sum' and 'subtraction'), but they do not follow a strict verb_noun pattern. 'sum' is a noun while 'subtraction' is a noun, which is slightly inconsistent, though both are readable and functional for this simple domain.

Tool Count2/5

With only 2 tools, the server feels too thin for a 'Basic Math' domain, as it lacks fundamental operations like multiplication, division, or more advanced functions. This minimal set limits the server's utility and scope, making it incomplete for typical math tasks.

Completeness2/5

The tool surface is severely incomplete for a basic math server, missing essential operations such as multiplication, division, exponentiation, and handling of more than two numbers. This creates significant gaps that will cause agent failures when trying to perform common mathematical tasks.

Maintenance

ActivityInactive
ResponsivenessNo issues