FastMCP Maths Servers
Maths tools using multiple FastMCP servers
Ask AI about FastMCP Maths Servers
Powered by Claude Β· Grounded in docs
I know everything about FastMCP Maths Servers. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Reviews
Documentation
π FastMCP Math Server
A modular and extensible Model Context Protocol (MCP) server built using FastMCP in Python. This project goes beyond basic arithmetic and provides a structured mathematical toolkit including algebra, statistics, number theory, and linear algebra.
π Project Overview
Project Name: fastmcp_server
This project implements an MCP server exposing multiple math-focused tool groups:
π’ Core Capabilities
-
Calculator
- add, subtract, multiply, divide
-
Equations
- linear solver
- quadratic solver
- system of equations (2 variables)
- Gaussian elimination (NxN)
-
Number Theory
- gcd, lcm
- prime check
- prime factorization
-
Statistics
- mean, median
- variance
- standard deviation
π§ Architecture
+---------------------------+
| VS Code Copilot (Client) |
+------------+-------------+
|
| MCP (HTTP + SSE)
|
+------------v----------------------+
| FastMCP Server (Python) |
|----------------------------------|
| calculator tools |
| equations solvers |
| number theory utilities |
| statistics functions |
+----------------------------------+
π οΈ Tech Stack
- Python
- FastMCP
- Model Context Protocol (MCP)
- VS Code Copilot (Client)
π Project Structure
fastmcp_server/
β
βββ .venv/ # Virtual environment
βββ .vscode/
β βββ mcp.json # MCP configuration for VS Code
β
βββ server_calculator.py # Basic arithmetic tools
βββ server_equations.py # Linear, quadratic, system solvers
βββ server_numberTheory.py # GCD, LCM, primes, factorization
βββ server_statistics.py # Mean, median, variance, std dev
β
βββ requirements.txt # Dependencies
βββ README.md # Documentation
βοΈ Setup Instructions
1οΈβ£ Create Virtual Environment (Recommended)
python -m venv .venv
source .venv/bin/activate # Linux/Mac
.venv\Scripts\activate # Windows
2οΈβ£ Install Dependencies
pip install -r requirements.txt
Or manually:
pip install fastmcp
3οΈβ£ Configure MCP in VS Code
Create:
.vscode/mcp.json
{
"servers": {
"mcpCalculator": {
"type": "http",
"url": "http://localhost:3000/mcp"
},
"mcpNumberTheory": {
"type": "http",
"url": "http://localhost:3001/mcp"
},
"mcpEquations": {
"type": "http",
"url": "http://localhost:3002/mcp"
},
"mcpStatistics": {
"type": "http",
"url": "http://localhost:9000/mcp"
}
}
}
βΆοΈ Running the Servers
Run each server (First try to run 1/2 servers)
python server_calculator.py
python server_equations.py
python server_statistics.py
python server_numberTheory.py
Servers runs at:
http://localhost:3000/mcp
http://localhost:3001/mcp
http://localhost:3002/mcp
http://localhost:9000/mcp
π Connecting to VS Code Copilot
- Open VS Code
- Ensure Copilot is enabled
- Open Command Palette:
> MCP: List Servers
- Select:
mcpCalculator
mcpNumberTheory
mcpEquations
mcpStatistics
π Connecting to VS Code Copilot (Easy Way For connection)
- Go in mcp.json
- Above each server there are multiple buttons (Start, Stop, Restart)
- You can connect servers from here
- Start to chat in Copilot window (ctrl + Alt + B)
π¬ Example Prompts
π’ Calculator
Add 10 and 20
Divide 100 by 5
π Equations
Solve 2x + 3y = 13 and x - y = 1
Solve quadratic equation 2x^2 + 5x + 3 = 0
π¬ Number Theory
Find gcd of 48 and 18
Check if 29 is prime
Prime factors of 84
π Statistics
Mean of [1,2,3,4,5]
Variance of [10,20,30]
Standard deviation of dataset
β οΈ Important Notes
- MCP is not REST
- It Uses:
- JSON-RPC
- Server-Sent Events (SSE)
Expected behavior:
- Accessing
/in browser β404 Not Found(expected) - Accessing
/mcpin browser β406 Not Acceptable(expected)
β This is normal
Use only MCP-compatible clients.
π Future Enhancements
- NxN matrix operations (determinant, inverse)
- LU / QR decomposition
- Symbolic math support
- Graph plotting tools
- Financial/statistical models
- Streaming statistics (real-time data)
π Acknowledgements
- FastMCP
- Model Context Protocol (MCP)
- VS Code Copilot
π οΈ Tech Stack
- Python
- FastMCP
- MCP (Model Context Protocol)
- VS Code Copilot (Client)
π License
MIT License
