- Home
- MCP servers
- MCP Math Tools
MCP Math Tools
- 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.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"codewithmsunke-mcpmathtools": {
"command": "node",
"args": [
"d:/Proj/3/mcp-demo/dist/index.js"
]
}
}
}You have an MCP Math Server that exposes a suite of arithmetic and comparison tools along with a greeting resource. It’s designed to be easily integrated with AI assistants and tooling environments, providing reliable math operations and simple interactions through the MCP protocol.
How to use
You will access the MCP Math Server using an MCP client. Call the available tools by name and provide the required inputs. Each tool returns a clear, human-friendly result that you can use directly in your workflows. For a greeting, you can request a personalized message with a name.
How to install
Prerequisites: Node.js and npm install on your machine.
Install dependencies and compile TypeScript code.
npm install
npx tsc
Running and configuring the MCP server
To run the server locally and expose it to an MCP client via stdio, use the following runtime command configured for the MCP integration.
The MCP client integration expects a stdio server that runs Node.js and starts from the built distribution.
{
"servers": {
"mcp_math": {
"type": "stdio",
"command": "node",
"args": ["d:/Proj/3/mcp-demo/dist/index.js"]
}
},
"inputs": []
}
Notes and usage tips
The server provides tools for arithmetic, square and square root (with appropriate error handling), GCM and LCM, multiple comparison tools, and a greeting resource. Use the provided tool names exactly as shown to obtain consistent results.
Available tools
add
Add two numbers; input shape { a: number, b: number }; output describes the sum.
subtract
Subtract b from a; input shape { a: number, b: number }; output describes the difference.
multiply
Multiply two numbers; input shape { a: number, b: number }; output describes the product.
divide
Divide a by b; input shape { a: number, b: number }; output describes the quotient with division-by-zero error handling.
square
Square a number; input shape { a: number }; output describes the square.
sqrt
Square root of a number; input shape { x: number }; output describes the square root rounded to two decimals with error if x is negative.
gcm
Greatest Common Measure of two numbers; input shape { a: number, b: number }; output describes the GCM.
lcm
Least Common Multiple of two numbers; input shape { a: number, b: number }; output describes the LCM.
lessThan
Compare if a is less than b; input shape { a: number, b: number }; output indicates whether a is less.
greaterThan
Compare if a is greater than b; input shape { a: number, b: number }; output indicates whether a is greater.
lessThanOrEqual
Compare if a is less than or equal to b; input shape { a: number, b: number }; output indicates the relation.
greaterThanOrEqual
Compare if a is greater than or equal to b; input shape { a: number, b: number }; output indicates the relation.
compare
General comparison tool; input shape { a: number, b: number }; output provides a comparison result value.
greet
Greeting resource that returns a personalized hello for a given name; uses the greet://{name} scheme.