- Home
- MCP servers
- Math
Math
- typescript
0
GitHub Stars
typescript
Language
7 months ago
First Indexed
3 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
You can run a lightweight MCP server that performs basic math operations (add, subtract, multiply, divide) and connect to clients either locally via Stdio or over HTTP with Server-Sent Events. It’s designed to be simple to deploy and integrate with MCP clients that support SSE streaming or standard I/O communication.
How to use
You have two running modes to choose from. In Stdio mode, you launch the server as a local process and communicate through standard input and output. In HTTP mode, you start a long‑running HTTP server that streams responses via SSE at a fixed endpoint.
How to install
Prerequisites you need before installing the server are Node.js version 18 or higher and npm.
Step by step install flow follows. Run these commands in your terminal.
# 1. Clone the repository
# (Replace with your preferred clone URL)
git clone https://example.com/wxt2rr/mcp-server-test.git
cd mcp-server-test
# 2. Install dependencies
npm install
# 3. Build the TypeScript project
npx tsc
Run in stdio mode (local, default)
To run in Stdio mode, which is the default and commonly used when integrating with local MCP clients, start the server with the following command.
node dist/index.js
# or explicitly in stdio mode
node dist/index.js stdio
Run in HTTP mode (Streamable HTTP & SSE)
To run a long‑lived HTTP server that supports Streamable HTTP and Server-Sent Events, start the server in HTTP mode. The server will listen on port 3000 by default and expose the MCP endpoint at /mcp.
node dist/index.js http
Deployment notes
Recommended deployment options are containerized solutions or hosted services that keep the process alive. The project includes guidance for Docker and cloud platform deployments.
If you run HTTP mode, you can access the MCP endpoint at http://localhost:3000/mcp when you are on the same host. When deployed, replace localhost with your deployment domain.
Tools and capabilities
This server exposes a built‑in tool named calculate. It supports the following parameters:
- operation: one of add, subtract, multiply, divide
- a: first numeric operand
- b: second numeric operand
Available tools
calculate
Tool to perform basic arithmetic operations using parameters operation, a, and b