@mcp-decorator/plugin-math
v0.1.3
Published
Math operations plugin for MCP Decorator Framework
Downloads
20
Readme
@mcp-decorator/plugin-math
Math operations plugin for MCP Decorator Framework.
Installation
npm install @mcp-decorator/plugin-math
# or
pnpm add @mcp-decorator/plugin-math
# or
bun add @mcp-decorator/plugin-mathUsage
import { createStdioServer } from "@mcp-decorator/core";
import { MathPlugin } from "@mcp-decorator/plugin-math";
createStdioServer({
name: "my-server",
plugins: [new MathPlugin()],
});Available Commands
math.add
Add two numbers.
Parameters:
a(number): First numberb(number): Second number
Example:
{
"type": "math.add",
"params": { "a": 5, "b": 3 }
}Response:
5 + 3 = 8math.subtract
Subtract two numbers.
Parameters:
a(number): First numberb(number): Second number
Example:
{
"type": "math.subtract",
"params": { "a": 10, "b": 4 }
}Response:
10 - 4 = 6math.multiply
Multiply two numbers.
Parameters:
a(number): First numberb(number): Second number
Example:
{
"type": "math.multiply",
"params": { "a": 6, "b": 7 }
}Response:
6 × 7 = 42math.divide
Divide two numbers.
Parameters:
a(number): Numeratorb(number): Denominator
Example:
{
"type": "math.divide",
"params": { "a": 20, "b": 4 }
}Response:
20 ÷ 4 = 5Error Handling:
Division by zero returns an error:
{
"type": "math.divide",
"params": { "a": 10, "b": 0 }
}Response:
Error: Division by zero is not allowedLicense
MIT
