MathJS Calculator MCP Server
Provides mathematical calculation capabilities using MathJS, enabling expression evaluation and derivative calculation.
README
MathJS Calculator MCP Server
An MCP server implementation that provides mathematical calculation capabilities using the MathJS library.
Features
- Evaluate mathematical expressions
- Calculate derivatives of expressions
- Handle complex mathematical operations
- Provide clear error messages for invalid inputs
Tools
calculate
Evaluates mathematical expressions and returns the result.
Inputs:
expression(string): The mathematical expression to evaluate
derivative
Calculates the derivative of a mathematical expression with respect to a variable.
Inputs:
expression(string): The mathematical expression to differentiatevariable(string): The variable to differentiate with respect to
Usage
The MathJS Calculator tool is designed for:
- Evaluating mathematical expressions
- Computing derivatives
- Handling complex calculations
- Providing clear feedback for calculation errors
Configuration
Usage with Claude Desktop
Add this to your claude_desktop_config.json:
npx
{
"mcpServers": {
"mathjs-calculator": {
"command": "npx",
"args": [
"-y",
"mathjs-mcp-server"
]
}
}
}
Building and Testing
Build
To build the project:
npm install
npm run build
Testing with Inspector
To test the server with the MCP Inspector:
- Open the MCP Inspector in another terminal:
npm run inspector
-
Connect to the server at
http://localhost:5173(default port) -
Test the available tools:
- Use the "calculate" tool to evaluate expressions
- Use the "derivative" tool to compute derivatives
Example Usage
// Calculate expression
{
"expression": "2 * (3 + 4)"
}
// Result: 14
// Calculate derivative
{
"expression": "x^2 + 2*x",
"variable": "x"
}
// Result: The derivative of x^2 + 2*x with respect to x is: 2*x + 2
License
This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.