Serves as the HTTP transport layer for the math server, enabling HTTP endpoints for MCP protocol messages, health checks, and Server-Sent Events for streaming intensive computations
Provides integration with GitHub for documentation, issue tracking, and project management through GitHub Wiki and Issues
Includes test suite integration for verifying functionality of the mathematical computation server
Built as a Python package requiring Python 3.11+ with comprehensive mathematical functions across multiple domains like arithmetic, number theory, and advanced math
Integrates with Shields.io for displaying status badges in the README for Python version, MCP compatibility, version, and license information
Supports YAML configuration files for server setup, allowing detailed configuration of transport options, function filtering, performance settings, and more
🧮 Chuk MCP Math Server
A highly configurable Mathematical Computation Protocol (MCP) server that provides comprehensive mathematical functions with flexible transport options and streaming capabilities.
✨ Features
🔢 Mathematical Capabilities
- 286 Mathematical Functions across multiple domains
- Number Theory: Prime testing, factorization, GCD, LCM, sequences
- Arithmetic: Basic operations, advanced calculations, statistics
- Real-time Computation: Async processing with timeout support
- Function Filtering: Configurable whitelisting/blacklisting by domain or category
🚀 Transport & Streaming
- Dual Transport: STDIO and HTTP support
- HTTP Streaming: Server-Sent Events for intensive computations
- WebSocket Ready: Extensible for real-time applications
- CORS Support: Cross-origin requests enabled
⚙️ Configuration
- CLI Configuration: Comprehensive command-line options
- File Configuration: YAML and JSON config file support
- Environment Variables: Container-friendly configuration
- Dynamic Filtering: Runtime function filtering capabilities
🛡️ Production Ready
- Health Monitoring: Built-in health check endpoints
- Error Handling: Graceful failure management
- Logging: Configurable log levels and output
- Rate Limiting: Optional request throttling
- Timeout Management: Configurable computation timeouts
🚀 Quick Start
Installation
Basic Usage
STDIO Transport (MCP Standard)
HTTP Transport
Example Client Usage
Test with Examples
Basic HTTP API Usage
📖 Documentation
Available Functions
The server provides 286 mathematical functions across these domains:
Domain | Functions | Examples |
---|---|---|
Arithmetic | Basic operations, statistics | add , multiply , mean , variance |
Number Theory | Primes, factorization, sequences | is_prime , next_prime , fibonacci , gcd |
Advanced Math | Complex calculations | sqrt , power , factorial , combinations |
Configuration Options
Command Line
Configuration File
Environment Variables
MCP Protocol Usage
Initialize Connection
List Available Tools
Call Mathematical Function
🛠️ Development
Project Structure
Development Setup
Adding New Functions
- Add mathematical functions to the
chuk-mcp-math
library - Functions are automatically discovered and registered
- Use function filtering to control exposure
Custom Configuration
🌐 HTTP API Reference
Endpoints
Endpoint | Method | Description |
---|---|---|
/ | GET | Server status and information |
/health | GET | Health check and function count |
/mcp | POST | MCP protocol messages |
HTTP Streaming
The server supports Server-Sent Events (SSE) for computationally intensive operations:
📊 Performance
Benchmarks
- Function Calls: ~1000 ops/sec (simple arithmetic)
- Prime Testing: ~100 ops/sec (medium-sized numbers)
- Memory Usage: ~50MB baseline + computation overhead
- Startup Time: ~2 seconds (286 functions loaded)
Optimization Tips
- Use
cache_strategy: "smart"
for repeated calculations - Increase
max_concurrent_calls
for high-throughput scenarios - Use function filtering to reduce memory footprint
- Enable HTTP streaming for long-running computations
🔧 Troubleshooting
Common Issues
Server Won't Start
Function Not Available
HTTP Connection Issues
Debug Information
🤝 Contributing
We welcome contributions! Please see our Contributing Guide for details.
Development Workflow
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Run the test suite
- Submit a pull request
Code Style
- Use
black
for code formatting - Use
isort
for import sorting - Follow PEP 8 guidelines
- Add type hints where appropriate
📋 Requirements
Core Dependencies
- Python 3.11+
chuk-mcp >= 0.5
chuk-mcp-math >= 0.1.0
fastapi >= 0.116.1
uvicorn >= 0.35.0
httpx >= 0.28.1
pyyaml >= 6.0.2
Optional Dependencies
- Development tools:
pytest
,black
,isort
,mypy
- All optional:
pip install chuk-mcp-math-server[full]
📝 License
This project is licensed under the MIT License - see the LICENSE file for details.
🙏 Acknowledgments
- Built on the Model Context Protocol (MCP)
- Mathematical functions provided by chuk-mcp-math
- Inspired by the need for accessible mathematical computation services
🔗 Links
- Documentation: GitHub Wiki
- Issues: GitHub Issues
- MCP Protocol: Official MCP Docs
- Mathematical Functions: chuk-mcp-math
Made with ❤️ by the Chuk MCP Team
Bringing mathematical computation to the Model Context Protocol ecosystem
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
A Mathematical Computation Protocol server providing 286 mathematical functions across multiple domains with flexible transport options (STDIO/HTTP) and streaming capabilities.
Related MCP Servers
- AsecurityAlicenseAqualityA mathematical computation service that enables users to perform symbolic calculations including basic arithmetic, algebra, calculus, equation solving, and matrix operations through the MCP protocol.Last updated -14PythonMIT License
- -securityFlicense-qualityA calculator server that exposes mathematical functions as tools (add, subtract, multiply, divide, square, power, square root), enabling language models to perform calculations through Model Context Protocol (MCP).Last updated -
- AsecurityFlicenseAqualityA simple server that provides basic mathematical operations (sum and subtraction) through the Model Context Protocol.Last updated -21JavaScript
- -securityFlicense-qualityA Model Context Protocol (MCP) server that demonstrates mathematical capabilities through a LangChain integration, allowing clients to perform math operations via the MCP protocol.Last updated -Python