Skip to main content
Glama

mcp-numpy

An MCP server that exposes NumPy functionality

PyPI Python Coverage Ruff

Install

pip install mcp-numpy

Related MCP server: Math MCP Server

Usage

As an MCP Server

To use with Claude Desktop or other MCP clients, add to your mcp.json:

{
  "mcpServers": {
    "mcp-numpy": {
      "command": "mcp-numpy"
    }
  }
}

Available Tools

The server exposes the following NumPy functionality as MCP tools:

Array Creation

  • np_array - Create a NumPy array

  • np_zeros - Create zeros array

  • np_ones - Create ones array

  • np_full - Create array filled with value

  • np_arange - Create array with range

  • np_linspace - Create evenly spaced array

  • np_eye - Create identity matrix

  • np_diag - Create diagonal array

Array Manipulation

  • np_reshape - Reshape array

  • np_transpose - Transpose array

  • np_concatenate - Concatenate arrays

  • np_split - Split array

  • np_tile - Tile array

  • np_repeat - Repeat elements

  • np_squeeze - Remove single-dimensional entries

  • np_flatten - Flatten array

Mathematical Operations

  • np_sum, np_mean, np_std, np_var - Summary statistics

  • np_min, np_max, np_argmin, np_argmax - Min/max operations

  • np_dot, np_matmul, np_cross - Matrix operations

  • np_trace, np_cumsum, np_cumprod, np_diff - Array operations

Linear Algebra

  • np_inv - Matrix inverse

  • np_det - Matrix determinant

  • np_eig - Eigenvalues and eigenvectors

  • np_svd - Singular value decomposition

  • np_solve - Solve linear system

  • np_linalg_norm - Matrix/vector norm

Random

  • np_rand - Random floats

  • np_randn - Random normal

  • np_randint - Random integers

  • np_random_choice - Random choice

  • np_shuffle - Shuffle array

Statistics

  • np_percentile, np_quantile - Percentiles/quantiles

  • np_histogram - Histogram

  • np_correlate, np_corrcoef - Correlation

Element-wise Math

  • np_add, np_subtract, np_multiply, np_divide - Arithmetic

  • np_power, np_mod - Power and modulo

  • np_sqrt, np_abs - Basic math

  • np_exp, np_log, np_log10 - Logarithms

  • np_sin, np_cos, np_tan - Trigonometry

  • np_arcsin, np_arccos, np_arctan - Inverse trig

  • np_sinh, np_cosh, np_tanh - Hyperbolic

Array Properties

  • np_shape, np_ndim, np_size, np_dtype - Properties

  • npastype - Type conversion

Development

git clone https://github.com/daedalus/mcp-numpy.git
cd mcp-numpy
pip install -e ".[test]"

# run tests
pytest

# format
ruff format src/ tests/

# lint
ruff check src/ tests/

# type check
mypy src/

mcp-name: io.github.daedalus/mcp-numpy

Available Tools

72 tools
np_absA

Calculate the absolute value of array elements.

Inputs: array (required). Returns: result

np_addB

Element-wise addition of two arrays.

Inputs: a (required), b (required). Returns: result

np_arangeC

Create an array with evenly spaced values within a given interval.

Inputs: start (required), stop (required), step, dtype. Returns: result

np_arccosB

Inverse cosine, element-wise.

Inputs: array (required). Returns: result

np_arcsinB

Inverse sine, element-wise.

Inputs: array (required). Returns: result

np_arctanB

Inverse tangent, element-wise.

Inputs: array (required). Returns: result

np_argmaxA

Return the indices of the maximum values along an axis.

Inputs: array (required), axis. Returns: result

np_argminB

Return the indices of the minimum values along an axis.

Inputs: array (required), axis. Returns: result

np_arrayB

Create a NumPy array from a list.

Inputs: data (required), dtype. Returns: result

npastypeC

Copy of the array, cast to a specified type.

Inputs: array (required), dtype (required). Returns: result

np_concatenateB

Join a sequence of arrays along an existing axis.

Inputs: arrays (required), axis. Returns: result

np_corrcoefB

Return Pearson product-moment correlation coefficients.

Inputs: array (required), rowvar. Returns: result

np_correlateB

Cross-correlation of two 1-dimensional sequences.

Inputs: a (required), b (required), mode. Returns: result

np_cosB

Trigonometric cosine, element-wise.

Inputs: array (required). Returns: result

np_coshA

Hyperbolic cosine, element-wise.

Inputs: array (required). Returns: result

np_crossB

Compute the cross product of two arrays.

Inputs: a (required), b (required). Returns: result

np_cumprodA

Return the cumulative product of the array along a given axis.

Inputs: array (required), axis. Returns: result

np_cumsumB

Return the cumulative sum of the array along a given axis.

Inputs: array (required), axis. Returns: result

np_detC

Compute the determinant of an array.

Inputs: array (required). Returns: result

np_diagC

Create a diagonal array or extract the diagonal of an array.

Inputs: k (required), dtype. Returns: result

np_diffB

Calculate the n-th discrete difference along the given axis.

Inputs: array (required), n, axis. Returns: result

np_divideC

Element-wise division of two arrays.

Inputs: a (required), b (required). Returns: result

np_dotB

Compute the dot product of two arrays.

Inputs: a (required), b (required). Returns: result

np_dtypeB

Return the dtype of an array.

Inputs: array (required). Returns: result

np_eigA

Compute the eigenvalues and eigenvectors of a square array.

Inputs: array (required). Returns: object

np_expA

Calculate the exponential of all elements in the array.

Inputs: array (required). Returns: result

np_eyeC

Return a 2D identity array.

Inputs: n (required), m, dtype. Returns: result

np_flattenB

Return a flattened copy of the array.

Inputs: array (required). Returns: result

np_fullC

Create an array filled with a constant value.

Inputs: shape (required), fill_value (required), dtype. Returns: result

np_histogramB

Compute the histogram of a set of data.

Inputs: array (required), bins, range. Returns: object

np_invA

Compute the (multiplicative) inverse of a matrix.

Inputs: array (required). Returns: result

np_linalg_normB

Matrix or vector norm.

Inputs: array (required), ord. Returns: result

np_linspaceB

Create an array with evenly spaced numbers over a specified interval.

Inputs: start (required), stop (required), num, dtype. Returns: result

np_logA

Natural logarithm, element-wise.

Inputs: array (required). Returns: result

np_log10B

Base-10 logarithm, element-wise.

Inputs: array (required). Returns: result

np_matmulB

Matrix product of two arrays.

Inputs: a (required), b (required). Returns: result

np_maxA

Return the maximum of an array or maximum along an axis.

Inputs: array (required), axis. Returns: result

np_meanA

Compute the arithmetic mean along the specified axis.

Inputs: array (required), axis. Returns: result

np_minA

Return the minimum of an array or minimum along an axis.

Inputs: array (required), axis. Returns: result

np_modA

Element-wise modulo of two arrays.

Inputs: a (required), b (required). Returns: result

np_multiplyA

Element-wise multiplication of two arrays.

Inputs: a (required), b (required). Returns: result

np_ndimA

Return the number of dimensions of an array.

Inputs: array (required). Returns: result

np_onesA

Create an array of ones.

Inputs: shape (required), dtype. Returns: result

np_percentileC

Compute the q-th percentile of the array elements.

Inputs: array (required), q (required). Returns: result

np_powerB

Element-wise exponentiation of array elements.

Inputs: a (required), b (required). Returns: result

np_quantileC

Compute the q-th quantile of the array elements.

Inputs: array (required), q (required). Returns: result

np_randC

Random values in a given shape.

Inputs: shape (required). Returns: result

np_randintB

Return random integers from low (inclusive) to high (exclusive).

Inputs: low (required), high, size. Returns: result

np_randnB

Return a sample (or samples) from the "standard normal" distribution.

Inputs: shape (required). Returns: result

np_random_choiceC

Generates a random sample from a given array.

Inputs: a (required), size, replace. Returns: result

np_repeatC

Repeat elements of an array.

Inputs: array (required), repeats (required), axis. Returns: result

np_reshapeB

Give a new shape to an array without changing its data.

Inputs: array (required), newshape (required). Returns: result

np_shapeB

Return the shape of an array.

Inputs: array (required). Returns: result

np_shuffleA

Modify a sequence in-place by shuffling its contents.

Inputs: array (required). Returns: result

np_sinA

Trigonometric sine, element-wise.

Inputs: array (required). Returns: result

np_sinhB

Hyperbolic sine, element-wise.

Inputs: array (required). Returns: result

np_sizeA

Return the total number of elements in an array.

Inputs: array (required). Returns: result

np_solveB

Solve a linear matrix equation, or system of linear equations.

Inputs: a (required), b (required). Returns: result

np_splitC

Split an array into multiple sub-arrays.

Inputs: array (required), indices_or_sections (required), axis. Returns: result

np_sqrtB

Return the non-negative square root of an array element-wise.

Inputs: array (required). Returns: result

np_squeezeB

Remove single-dimensional entries from the shape of an array.

Inputs: array (required), axis. Returns: result

np_stdB

Compute the standard deviation along the specified axis.

Inputs: array (required), axis, ddof. Returns: result

np_subtractA

Element-wise subtraction of two arrays.

Inputs: a (required), b (required). Returns: result

np_sumB

Sum of array elements over given axis(es).

Inputs: array (required), axis, dtype. Returns: result

np_svdC

Singular Value Decomposition.

Inputs: array (required), full_matrices. Returns: object

np_tanA

Trigonometric tangent, element-wise.

Inputs: array (required). Returns: result

np_tanhC

Hyperbolic tangent, element-wise.

Inputs: array (required). Returns: result

np_tileA

Construct an array by repeating the input array the given number of times.

Inputs: array (required), reps (required). Returns: result

np_traceB

Return the sum along the main diagonal of the array.

Inputs: array (required), offset. Returns: result

np_transposeA

Reverse or permute the axes of an array.

Inputs: array (required), axes. Returns: result

np_varC

Compute the variance along the specified axis.

Inputs: array (required), axis, ddof. Returns: result

np_zerosB

Create an array of zeros.

Inputs: shape (required), dtype. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.1/5.0

    Scored across 72 tools

    Disambiguation5/5

    Each tool targets a distinct NumPy function with clear, specific descriptions. No two tools perform the same operation; even closely related functions like np_percentile and np_quantile are differentiated by definition and use case.

    Naming Consistency4/5

    Most tools follow a consistent 'np_operation' pattern. The only exception is 'npastype' which lacks an underscore, and 'np_linalg_norm' uses a submodule prefix while other linear algebra tools (np_eig, np_inv, etc.) do not. Overall, the pattern is clear and predictable.

    Tool Count2/5

    72 tools is excessive for an MCP server, making selection difficult for an agent. While the server aims to cover a broad library like NumPy, the count far exceeds the typical well-scoped range (3-15) and even the 'too many' threshold (25+).

    Completeness3/5

    The tools cover core array operations, math, statistics, linear algebra, and random sampling. However, common functions like sorting (np_sort), unique (np_unique), where (np_where), and fft are missing, representing notable gaps for a numpy-oriented server.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      A Model Context Protocol (MCP) server that provides mathematical calculations and operations using NumPy, enabling users to perform numerical computations like matrix operations, statistical analysis, and polynomial fitting directly through Claude.
      3
      -
    • A
      license
      A
      quality
      D
      maintenance
      A Model Context Protocol server that exposes 8 mathematical tools (arithmetic, algebra, calculus, matrix operations, statistics, probability, unit conversions) to any MCP-compatible AI agent, enabling mathematical computations without code.
      8
      15 npm
      1
      MIT
    • F
      license
      Not graded
      quality
      C
      maintenance
      A custom MCP server providing tools for date/time, calculations, mock weather, and note management, enabling AI agents to perform these tasks via natural language.
      -
    • A
      license
      A
      quality
      D
      maintenance
      A Model Context Protocol server providing mathematical and scientific computing capabilities via NumPy, pandas, SciPy, and Matplotlib, with 19 tools for linear algebra, statistics, numerical methods, data processing, and plotting.
      19
      MIT