Skip to main content
Glama
Yash-synergy

basic-mcp-calculator-server

by Yash-synergy
README.md
# Basic MCP Calculator Server

A simple Model Context Protocol (MCP) server that provides basic calculator functionality.

## Features

- **Add**: Add two numbers together
- **Subtract**: Subtract second number from first number  
- **Multiply**: Multiply two numbers together
- **Divide**: Divide first number by second number (with division by zero protection)

## Installation

1. Install dependencies:
```bash
npm install
```

2. Build the project:
```bash
npm run build
```

## Usage

### Running the Server

```bash
npm start
```

The server runs on stdio and communicates using the MCP protocol.

### Available Tools

- `add(a, b)` - Returns the sum of a and b
- `subtract(a, b)` - Returns a minus b
- `multiply(a, b)` - Returns the product of a and b  
- `divide(a, b)` - Returns a divided by b

### Example MCP Configuration

Add this to your MCP client configuration:

```json
{
  "mcpServers": {
    "calculator": {
      "command": "node",
      "args": ["path/to/basic-mcp-calculator-server/dist/index.js"]
    }
  }
}
```

## Development

```bash
npm run dev
```

This will build and start the server in one command.

## License

MIT

TDQS

A4/5.0

Scored across 4 tools

Disambiguation5/5

Each tool performs a distinct arithmetic operation with no overlap. An agent can easily select the correct tool for the intended calculation.

Naming Consistency5/5

All tool names are single lowercase verbs representing the operation: add, subtract, multiply, divide. The naming pattern is perfectly uniform and intuitive.

Tool Count5/5

Four tools is exactly right for a basic calculator, covering the essential operations without any redundancy or unnecessary extras.

Completeness5/5

The four basic arithmetic operations provide complete coverage for the stated purpose of a basic calculator. There are no obvious gaps in functionality.

Maintenance

ActivityInactive
ResponsivenessNo issues