Home / MCP / NumPy MCP Server

NumPy MCP Server

Provides numerical computations via MCP using NumPy, including arithmetic, linear algebra, statistics, and polynomial fitting.

python
Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
    "mcpServers": {
        "numpy_calculator": {
            "command": "python",
            "args": [
                "server.py"
            ]
        }
    }
}

You can perform numerical computations directly through the MCP interface using NumPy. This server exposes core mathematical operations, linear algebra, statistics, and polynomial fitting in a standardized way so you can integrate with Claude or any MCP-compatible client for fast, reproducible numerical work.

How to use

You interact with the server through an MCP client by sending function calls that map to NumPy-based operations. Typical tasks include computing matrix products, eigenvalues, basic statistics, and polynomial fits. You can compose multiple calls in a session to build up a sequence of numerical analyses, and you can combine results with other MCP-enabled tools in your workflow.

How to install

Prerequisites you need before installation:

- Python 3.8 or newer

- UV for dependency management (as shown in the installation flow)

Follow these steps to get the server running locally using the standard development flow.

Step by step installation commands

# Install UV if you haven't already
curl -LsSf https://astral.sh/uv/install.sh | sh

# Create and activate a virtual environment via UV
uv venv
source .venv/bin/activate  # On Unix/macOS
# or
# .venv\Scripts\activate  # On Windows

# Install Python dependencies
uv pip install -r requirements.txt

# Run development server for testing
python server.py
# or for MCP runtime
mcp run server.py

Claude Desktop integration commands

Install the server into Claude Desktop so it becomes an accessible MCP endpoint:

mcp install server.py --name "NumPy Calculator"

Direct execution for advanced usage

If you want to run the server directly without Claude, you can start it with the following commands:

python server.py
# or
mcp run server.py

Additional setup notes

Development testing can be performed with the MCP Inspector by launching a local dev server session. Use the command shown in the testing workflow to verify endpoints and responses before deploying to Claude Desktop or a production environment.

Notes on available functions

The server provides a focused set of numerical tools through the MCP interface, including basic arithmetic, linear algebra, statistics, and polynomial fitting. These endpoints are designed to be called from an MCP client and return results in a structured, easy-to-consume format.

Security and maintenance

Run the server in a controlled environment and manage dependencies with UV to ensure reproducible builds. Regularly update the requirements as needed and monitor input data to prevent numerical instability or unexpected edge cases.

Examples of typical usage

- Compute eigenvalues of a 2x2 matrix: eigenvalues of [[1, 2], [3, 4]] - Calculate mean and standard deviation of a data set: mean and standard deviation of [1, 2, 3, 4, 5] - Multiply two matrices: [[1,0],[0,1]] and [[2,3],[4,5]] - Fit a quadratic to data points: x and y arrays with degree 2

Troubleshooting

If you encounter issues starting the server, verify that your Python environment is active, dependencies are installed, and the command you run matches the available MCP entry points. Check the console for error messages and confirm that the port and host configuration (if applicable) are accessible from your client.

Available tools

add

Add two numbers and return the sum.

matrix_multiply

Multiply two matrices, returning the resulting matrix.

eigen_decomposition

Compute eigenvalues and eigenvectors of a square matrix.

statistical_analysis

Calculate basic statistics for a dataset including mean, median, standard deviation, min, and max.

polynomial_fit

Fit a polynomial of a specified degree to data points.