- 3 consolidated tools (symbolic_tool, numpy_tool, scipy_tool) - 22+ mathematical operations - Complete MCP compliance (STDIO, JSON-RPC 2.0) - Validated with 10 university-level math problems - Full documentation and deployment guide
4.0 KiB
4.0 KiB
Quick Start Guide for MCP Scientific Calculator
For End Users
Installation
pip install sympy numpy scipy pandas
Claude Desktop Configuration
Windows:
- Open
%APPDATA%\Claude\claude_desktop_config.json - Add this configuration:
{
"mcpServers": {
"scientific-calculator": {
"command": "python",
"args": ["-u", "F:\\path\\to\\mcp_server.py"]
}
}
}
macOS/Linux:
- Open
~/Library/Application Support/Claude/claude_desktop_config.json - Add this configuration:
{
"mcpServers": {
"scientific-calculator": {
"command": "python3",
"args": ["-u", "/path/to/mcp_server.py"]
}
}
}
- Restart Claude Desktop
- You'll see 3 new tools:
symbolic_tool,numpy_tool,scipy_tool
Available Tools
1. symbolic_tool
Symbolic mathematics operations:
simplify,expand,factor- algebraic manipulationderivative,integral- calculussolve- equation solvinglimit,taylor- advanced calculusmatrix- symbolic matrix operations
Example:
Calculate the derivative of x³ + 2x²
→ Use symbolic_tool with operation="derivative", expression="x**3 + 2*x**2", variable="x"
2. numpy_tool
Numerical computing and data analysis:
eigenvalues,eigenvectors,determinant,inverse- linear algebramatmul,dot,hadamard- matrix productssvd,qr,cholesky- matrix decompositionssum,mean,std,max,min- array operationssin,cos,tan- trigonometrypandas_describe,pandas_corr,pandas_value_counts- data analysisimage_stats,image_normalize,image_threshold- image processing
Example:
Find eigenvalues of matrix [[1,2],[2,1]]
→ Use numpy_tool with operation="eigenvalues", matrix_a="[[1,2],[2,1]]"
3. scipy_tool
Scientific computing:
integrate- numerical integrationoptimize_minimize,optimize_root- optimizationinterpolate_linear,interpolate_cubic- interpolationsolve_ode- differential equationsfft,rfft- signal processingstatistics- statistical analysis
Example:
Solve ODE: dy/dt = -2y, y(0)=1, from t=0 to t=5
→ Use scipy_tool with operation="solve_ode", expression="lambda t, y: -2*y", initial_conditions="[1]", t_values="[0,1,2,3,4,5]"
Testing
Run the verification script:
python verify_production_readiness.py
Expected output:
[OK] 工具数量正确
[OK] 工具名称完整
[OK] symbolic_tool.derivative 工作正常
[OK] symbolic_tool.integral 工作正常
[OK] symbolic_tool.solve 工作正常
[OK] numpy_tool.determinant 工作正常
[OK] 问题集完整
[OK] 所有验证通过 - 生产就绪!
Example Problems
The server includes 10 university-level math problems:
- Second-order ODE with initial conditions
- Matrix eigenvalue decomposition
- Fourier series expansion
- Lagrange multipliers (constrained optimization)
- Complex integration (residue theorem)
- Heat equation (PDE)
- Surface tangent planes
- Linear ODE systems
- Green's theorem (line integrals)
- Calculus of variations
See advanced_math_problems.py for complete solutions.
Troubleshooting
Tools not appearing in Claude Desktop:
- Check config file syntax (valid JSON)
- Verify Python path in "command" field
- Ensure all dependencies installed:
pip install sympy numpy scipy pandas - Restart Claude Desktop after config changes
Import errors:
- Install missing packages:
pip install -r requirements.txt - Verify Python version ≥ 3.8
Tool execution errors:
- Check input format (JSON strings for arrays/matrices)
- Review operation name spelling
- Consult README.md for parameter requirements