SharkMath MCP
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@SharkMath MCPsolve the equation 2x + 5 = 15"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
SharkMath MCP
A comprehensive Model Context Protocol (MCP) server providing 150+ mathematical functions consolidated into 15 powerful tools across all mathematical domains. This MCP server integrates seamlessly with VS Code Copilot and other MCP-compatible clients to provide powerful mathematical computation capabilities through parameter-based routing.
๐ Features
15 Consolidated Mathematical Tools
calculate_arithmetic- Basic arithmetic operations, expression evaluation, and power operationscalculate_trigonometry- Complete trigonometric and inverse functions with degree/radian supportcalculate_statistics- Statistical operations including central tendency, dispersion, and percentilesconvert_units- Universal unit converter supporting 80+ conversions across all measurement typescalculate_logarithmic- Logarithmic and exponential functions with domain validationcalculate_hyperbolic- Hyperbolic functions with overflow protectionformat_precision- Number formatting including rounding, floor, ceiling, and absolute valueanalyze_numbers- Number theory and combinatorial mathematics (primes, GCD, LCM, factorial, etc.)solve_equations- Equation solvers for quadratic and linear equationscalculate_geometry_2d- 2D geometry calculations for distance, slope, areas, and perimetersmanipulate_matrices- Matrix operations including addition, multiplication, determinant, and transposefinancial_calculations- Financial and business calculations including interest, loans, and investment analysiscomputer_science_tools- Programming utilities including base conversions, hash functions, and algorithm analysisdata_analysis- Advanced statistical analysis including correlation, distribution analysis, and outlier detectionutility_functions- Helper functions providing mathematical constants, validation, and operation help
Related MCP server: Calculator MCP Server
๐ฆ Installation
Prerequisites
Python 3.8+
VS Code with MCP extension support
uvpackage manager (recommended)
Setup
Clone the repository:
git clone https://github.com/tonygod/SharkMath-MCP.git
cd SharkMath-MCPInstall dependencies:
uv venv mcp-env
source mcp-env/bin/activate # On Windows: mcp-env\Scripts\activate
uv pip install mcp fastmcpRun the MCP server:
uv run sharkmath_server.py๐ง VS Code Integration
Configure the MCP server in your VS Code settings (.vscode/mcp.json):
{
"mcpServers": {
"sharkmath-mcp": {
"command": "uv",
"args": ["--directory", ".", "run", "sharkmath_server.py"],
"cwd": "/path/to/SharkMath-MCP"
}
}
}๐ API Reference
SharkMath uses parameter-based routing where each consolidated tool accepts an operation parameter to specify the desired function.
Arithmetic Operations - calculate_arithmetic
operation="add"- Addition:a + boperation="subtract"- Subtraction:a - boperation="multiply"- Multiplication:a * boperation="divide"- Division with zero-division protection:a / boperation="calculate"- Enhanced expression evaluation with 20+ mathematical functionsBasic Functions:
sqrt(),pow(),abs(),round()Trigonometric:
sin(),cos(),tan(),asin(),acos(),atan()Logarithmic:
log(),log10(),ln()(natural log alias)Hyperbolic:
sinh(),cosh(),tanh()Rounding:
floor(),ceil(),trunc()Constants:
pi,eExamples:
sqrt(25),sin(pi/2),log(e),sqrt((5-0)^2 + (12-0)^2)
operation="power"- Exponentiation:base^exponentoperation="square"- Square:nยฒoperation="cube"- Cube:nยณoperation="square_root"- Square root:โn
Statistical Functions - calculate_statistics
operation="mean"- Arithmetic meanoperation="median"- Median valueoperation="mode"- Most frequent valueoperation="standard_deviation"- Standard deviationoperation="variance"- Variance calculationoperation="range_stats"- Min, max, and rangeoperation="percentile"- Percentile calculation (requires percentile parameter)
Trigonometric Functions - calculate_trigonometry
operation="sin"- Sine functionoperation="cos"- Cosine functionoperation="tan"- Tangent functionoperation="asin"- Inverse sine (arcsine)operation="acos"- Inverse cosine (arccosine)operation="atan"- Inverse tangent (arctangent)operation="atan2"- Two-argument arctangent (requires x and y parameters)
Matrix Operations - manipulate_matrices
operation="add"- Matrix additionoperation="multiply"- Matrix multiplicationoperation="determinant"- Determinant calculationoperation="transpose"- Matrix transpose
Unit Conversions - convert_units
Energy: watts, kilowatts, horsepower, joules, calories, btu
Temperature: celsius, fahrenheit
Length: meters, feet, inches, centimeters, kilometers, miles
Weight: kilograms, pounds
Volume: liters, gallons
Time: seconds, minutes, hours, days, weeks, months, years
Area: square_meters, square_feet, acres, hectares
Speed: mps, kmh, mph, knots
Pressure: pascals, atmospheres, psi, bar
Data: bytes, kilobytes, megabytes, gigabytes, terabytes
Financial Calculations - financial_calculations
operation="compound_interest"- Compound interest calculationoperation="simple_interest"- Simple interest calculationoperation="present_value"- Present value calculationoperation="future_value"- Future value calculationoperation="loan_payment"- Monthly loan paymentoperation="roi"- Return on investmentoperation="mortgage_payment"- Mortgage payment calculation
๐ Complete API Documentation - Full reference for all tools and operations
๐๏ธ Architecture
The project uses a consolidated tool architecture with parameter-based routing and FastMCP:
sharkmath_server.py # Main MCP server (15 consolidated tools)
โโโ arithmetic.py # calculate_arithmetic (arithmetic + power operations + 20+ math functions)
โโโ trigonometric.py # calculate_trigonometry (trig + inverse trig functions)
โโโ stats_operations.py # calculate_statistics (statistical operations + percentiles)
โโโ convert_units.py # convert_units (80+ unit conversions)
โโโ logarithmic.py # calculate_logarithmic (log + exponential functions)
โโโ hyperbolic.py # calculate_hyperbolic (hyperbolic functions)
โโโ precision.py # format_precision (rounding + precision utilities)
โโโ number_theory.py # analyze_numbers (number theory + combinatorics)
โโโ solve_equations.py # solve_equations (quadratic + linear solvers)
โโโ calculate_geometry_2d.py # calculate_geometry_2d (2D geometry calculations)
โโโ matrix_operations.py # manipulate_matrices (matrix operations)
โโโ financial_calculations.py # financial_calculations (financial + business calcs)
โโโ computer_science_tools.py # computer_science_tools (CS + programming utilities)
โโโ data_analysis.py # data_analysis (advanced statistical analysis)
โโโ utility_functions.py # utility_functions (constants + validation + help)Consolidated Tool Pattern
Each module implements parameter-based routing:
Single tool registration with
operationparameterFunction routing based on operation parameter value
Comprehensive error handling with โ /โ prefixes
Input validation specific to each mathematical operation
Consistent return formatting across all operations
Key Architecture Benefits
Reduced tool count: 70+ individual tools โ 15 consolidated tools
Improved maintainability: Logical grouping of related functions
Better performance: Single tool registration per domain
Enhanced usability: Intuitive parameter-based operation selection
MCP compatibility: Avoids tool registration limits
๐งช Testing
Run the comprehensive test suite:
cd Tests
python test_runner.pyIndividual Consolidated Tool Testing
Each consolidated tool has its own dedicated test suite:
python test_calculate_arithmetic.py # 45+ arithmetic operation tests
python test_calculate_trigonometry.py # 42+ trigonometric function tests
python test_calculate_statistics.py # 37+ statistical operation tests
python test_convert_units.py # 51+ unit conversion tests
python test_manipulate_matrices.py # 31+ matrix operation tests
python test_financial_calculations.py # 31+ financial calculation tests
python test_computer_science_tools.py # 41+ CS utility tests
python test_data_analysis.py # 36+ advanced analysis tests
# ... and more for each consolidated toolTest Coverage
500+ individual tests across all consolidated tools
Parameter validation testing for all operation types
Error condition testing with comprehensive edge case coverage
Integration testing with MCP server registration verification
Regression testing ensuring all original functionality preserved
๐ค Contributing
Fork the repository
Create a feature branch (
git checkout -b feature/new-function)Add your mathematical function to the appropriate module
Include comprehensive tests
Update documentation
Submit a pull request
Adding New Functions
Choose the appropriate consolidated tool module
Add your operation to the module's operation routing dictionary
Implement the function with proper error handling and validation
Add comprehensive test coverage to the tool's test suite
Update documentation with the new operation parameter
Example: Adding a New Operation
# In arithmetic.py - adding a new operation
def calculate_arithmetic(operation: str, a: float = None, b: float = None, ...):
operations = {
"add": lambda: a + b,
"subtract": lambda: a - b,
"new_operation": lambda: your_new_function(a, b), # Add here
# ... other operations
}
if operation not in operations:
return f"โ Unsupported operation: {operation}"
try:
result = operations[operation]()
return f"โ
{operation.title()} result: {result}"
except Exception as e:
return f"โ Error in {operation}: {str(e)}"๐ Requirements
Python 3.8+
MCP (Model Context Protocol)
FastMCP framework
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Acknowledgments
Built on the Model Context Protocol (MCP) framework
Uses FastMCP for efficient server implementation
Inspired by the need for comprehensive mathematical tools in AI workflows
๐ Support
Create an issue for bug reports or feature requests
Check the Tests/ directory for comprehensive function validation
Review Docs/sharkmath_tools_refactor.md for architecture details
All 15 consolidated tools with 150+ operations are thoroughly tested and documented
SharkMath MCP - Empowering AI with comprehensive mathematical capabilities through efficient consolidated tools ๐ฆ๐
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/tonygod/SharkMath-MCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server