mcp-numpy
Exposes NumPy functionality as MCP tools, including array creation, manipulation, mathematical operations, linear algebra, random sampling, statistics, and element-wise math operations.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-numpy create a 3x3 identity matrix"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcp-numpy
An MCP server that exposes NumPy functionality
Install
pip install mcp-numpyRelated 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 arraynp_zeros- Create zeros arraynp_ones- Create ones arraynp_full- Create array filled with valuenp_arange- Create array with rangenp_linspace- Create evenly spaced arraynp_eye- Create identity matrixnp_diag- Create diagonal array
Array Manipulation
np_reshape- Reshape arraynp_transpose- Transpose arraynp_concatenate- Concatenate arraysnp_split- Split arraynp_tile- Tile arraynp_repeat- Repeat elementsnp_squeeze- Remove single-dimensional entriesnp_flatten- Flatten array
Mathematical Operations
np_sum,np_mean,np_std,np_var- Summary statisticsnp_min,np_max,np_argmin,np_argmax- Min/max operationsnp_dot,np_matmul,np_cross- Matrix operationsnp_trace,np_cumsum,np_cumprod,np_diff- Array operations
Linear Algebra
np_inv- Matrix inversenp_det- Matrix determinantnp_eig- Eigenvalues and eigenvectorsnp_svd- Singular value decompositionnp_solve- Solve linear systemnp_linalg_norm- Matrix/vector norm
Random
np_rand- Random floatsnp_randn- Random normalnp_randint- Random integersnp_random_choice- Random choicenp_shuffle- Shuffle array
Statistics
np_percentile,np_quantile- Percentiles/quantilesnp_histogram- Histogramnp_correlate,np_corrcoef- Correlation
Element-wise Math
np_add,np_subtract,np_multiply,np_divide- Arithmeticnp_power,np_mod- Power and modulonp_sqrt,np_abs- Basic mathnp_exp,np_log,np_log10- Logarithmsnp_sin,np_cos,np_tan- Trigonometrynp_arcsin,np_arccos,np_arctan- Inverse trignp_sinh,np_cosh,np_tanh- Hyperbolic
Array Properties
np_shape,np_ndim,np_size,np_dtype- Propertiesnpastype- 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 toolsnp_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
Scored across 72 tools
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.
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.
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+).
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
Related MCP Connectors
This MCP server enables users to perform scientific computations regarding linear algebra and vect…
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
Educational MCP server with 17 math/stats tools, visualizations, and persistent workspace
MCP server for OpenAI API (chat completions, image generation, embeddings) via AceDataCloud
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceA 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-
- AlicenseAqualityDmaintenanceA 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.815 npm1MIT
- FlicenseNot gradedqualityCmaintenanceA custom MCP server providing tools for date/time, calculations, mock weather, and note management, enabling AI agents to perform these tasks via natural language.-
- AlicenseAqualityDmaintenanceA 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.19MIT