Skip to main content
Glama
mathmethods-mcp

mathmethods-mcp

Mathematical/Numerical Methods - MCP Server

MCP Server License CI npm version PyPI M8ven Live Monitored Mathmethods Mcp on AI Agents Listing

A Model Context Protocol server that exposes a numerical-methods core as tools an LLM agent can call directly from a chat (VS Code, Zed, Claude, opencode, etc.). It is built on top of the numerical-methods engine of the academic project modeladoYsimulacion-web (UADE); the math core is vendored into this repository so the server is fully self-contained.

Installation and Usage

Runs on-demand without any global installation:

Claude Code (One-liner CLI)

claude mcp add mathmethods npx -y @agmonetti/mathmethods-mcp

Claude Desktop & Cursor (JSON Configuration)

Add to your claude_desktop_config.json or .cursor/mcp.json:

{
  "mcpServers": {
    "mathmethods": {
      "command": "npx",
      "args": ["-y", "@agmonetti/mathmethods-mcp"]
    }
  }
}

2. Install Globally from NPM

Ideal for instant startup without network latency on every invocation:

npm install -g @agmonetti/mathmethods-mcp
{
  "mcpServers": {
    "mathmethods": {
      "command": "mathmethods-mcp"
    }
  }
}

3. Run with UVX (Direct Python)

Any MCP client can also run the Python package directly with Astral's uvx:

claude mcp add mathmethods-mcp -- uvx mathmethods-mcp
{
  "mcpServers": {
    "mathmethods": {
      "command": "uvx",
      "args": ["mathmethods-mcp"]
    }
  }
}
git clone https://github.com/agmonetti/mathmethods-mcp.git
cd mathmethods-mcp
uv sync --extra dev
uv run server.py

Every client config above also works with uv run --frozen --project <checkout> python <checkout>/server.py in place of npx -y @agmonetti/mathmethods-mcp or uvx mathmethods-mcp.

Related MCP server: Math MCP Server

Tools

Root finding

Tool

What it does

root_bisection

Bisection on [a, b] (sign change or endpoint root)

root_newton_raphson

Newton–Raphson with numeric derivative

root_punto_fijo

Fixed-point iteration x = g(x)

root_aitken

Aitken Δ² acceleration of fixed point

root_comparar

All four methods compared on the same problem

Numerical integration

Tool

What it does

integral_rectangulo

Composite midpoint rule

integral_trapecio

Composite trapezoidal rule

integral_simpson13

Composite Simpson 1/3 (n even)

integral_simpson38

Composite Simpson 3/8 (n multiple of 3)

integral_comparar

All four rules compared (n multiple of 6)

Differentiation

Tool

What it does

finite_differences

Forward/backward/central 1st & 2nd derivatives

ODE and interpolation

Tool

What it does

ode_rk4

Runge–Kutta 4 (4th order)

ode_heun

Heun predictor–corrector (2nd order)

ode_euler

Explicit Euler (1st order)

interpolation_lagrange

Lagrange interpolating polynomial

Monte Carlo

Tool

What it does

mc_hit_or_miss_1d

Hit-or-miss estimator (correct for sign-changing f)

mc_valor_promedio_1d

Mean-value estimate of ∫ₐᵇ f(x) dx

mc_valor_promedio_2d

Mean-value estimate of a double integral

mc_valor_promedio_3d

Mean-value estimate of a triple integral

mc_estadistico_1d

M×N replicated experiment with statistical analysis

mc_convergencia_1d

Running average showing the estimate converging

Dynamic systems

Tool

What it does

dynamic_1d_solve

Equilibria, stability, phase portrait and time series

dynamic_1d_equilibria

Find and classify the equilibria of x' = f(x)

dynamic_1d_bifurcation

Equilibria vs parameter (bifurcation diagram)

dynamic_2d_linear_solve

Linear X' = A·X + B: classification, eigenvalues, analytic solution

dynamic_2d_nonlinear_solve

Nonlinear x' = f(x,y): equilibria, Jacobian, nullclines

dynamic_2d_conservative_solve

Divergence-free check, Hamiltonian/energy, closed orbits

dynamic_2d_lanchester_solve

Lanchester combat model with analytic time-to-annihilation

dynamic_2d_nonhomogeneous_solve

Non-homogeneous X' = A·X + B(t) with time-varying forcing

Math expressions use Python/SymPy syntax: x**2, sin(x), exp(x), sqrt(x), log(x). Common shorthand is accepted too: e^x, sen(x), ln(x) and the caret ^ for powers. The Greek combat parameters of Lanchester use the Unicode symbols α β γ ε μ δ.

Plots (optional)

Every tool accepts a plot=False | True flag. With plot=True the response contains the usual JSON plus a rendered PNG (an MCP image content block): phase portraits, solution curves, bifurcation diagrams, Monte Carlo convergence, and so on.

"Solve y' = y, y(0)=1 on [0,1] with RK4 and show me the plot."

Plotting needs the optional viz extra (Matplotlib), which is not part of the default install so the stdio server startup stays light:

pip install "mathmethods-mcp[viz]"    # pip
uvx --from "mathmethods-mcp[viz]" mathmethods-mcp   # uv
uv sync --extra viz                   # from a checkout

If plot=True is used without the extra, the tool returns a clear error telling you how to install it. Clients that do not render images still receive the JSON result alongside the image, so nothing is lost.

Project layout

mathmethods-mcp/
├── server.py                 # FastMCP app + all tools
├── mathmethods/
│   ├── compiler.py           # hardened expression validation (whitelist, caps)
│   ├── plots.py              # optional PNG rendering (plot=True), lazy matplotlib
│   ├── server.py             # FastMCP app and tool definitions
│   └── core/                 # vendored math core (from modeladoYsimulacion-web)
│       ├── root_finding.py   ├── integration.py
│       ├── ode.py            ├── interpolation.py
│       ├── differentiation.py├── monte_carlo.py
│       ├── dynamic_1d.py     ├── dynamic_2d_linear.py
│       ├── dynamic_2d_non_homogeneous.py ├── dynamic_2d_nonlinear.py
│       ├── dynamic_2d_conservative.py ├── dynamic_2d_lanchester.py
│       └── utils.py
├── tests/                    # test_tools.py + test_dynamic_tools.py + test_plots.py
├── mcp.example.json          # server registration template (copy to .vscode/mcp.json)
├── requirements.txt
└── pyproject.toml

Install

cd mathmethods-mcp
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt

After creating the venv, verify it is isolated (venv/bin/python -c "import sys; print(sys.prefix)" should print the venv path, not /usr). If your system Python produces a broken venv, try python3 -m venv --copies venv.

Run

Local (STDIO) — default transport, used by VS Code / Claude Desktop:

uv run python server.py

Remote (Streamable HTTP) — the server prints a URL such as http://127.0.0.1:8000/mcp:

MCP_TRANSPORT=streamable-http uv run python server.py

The transport can also be chosen with the MCP_TRANSPORT environment variable (stdio | streamable-http | sse), and the HTTP host/port with MCP_HTTP_HOST / MCP_HTTP_PORT (defaults 127.0.0.1:8000).

Connect from a client

Every client registers the same command, uvx mathmethods-mcp (no paths, no venv). If the server is not published yet or you work from a checkout, use uv run --frozen --project <PROJ> python <PROJ>/server.py instead.

Remote (Streamable HTTP) — optional; start it once in a terminal, then point the client at http://127.0.0.1:8000/mcp:

MCP_TRANSPORT=streamable-http uvx mathmethods-mcp

Create .vscode/mcp.json (git-ignored) — or copy mcp.example.json:

{
  "servers": {
    "mathmethods-stdio": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@agmonetti/mathmethods-mcp"]
    },
    "mathmethods-http": {
      "type": "http",
      "url": "http://127.0.0.1:8000/mcp"
    }
  }
}

Open the file and press Start next to the server you want; reload the window if it doesn't appear (Developer: Reload Window).

Add the entry under context_servers (note: not mcp_servers) in ~/.config/zed/settings.json or the project-level .zed/settings.json:

{
  "context_servers": {
    "mathmethods": {
      "command": "npx",
      "args": ["-y", "@agmonetti/mathmethods-mcp"]
    }
  }
}

You can also manage them via Settings → AI → MCP Servers.

Both opencode and the OpenChamber desktop app share the same configuration format. Add the entry under mcp in opencode.json (project root) or in the global ~/.config/opencode/opencode.jsonc:

{
  "mcp": {
    "mathmethods": {
      "type": "local",
      "command": ["npx", "-y", "@agmonetti/mathmethods-mcp"],
      "enabled": true
    }
  }
}

Or register it with the CLI (equivalent):

opencode mcp add mathmethods -- npx -y @agmonetti/mathmethods-mcp

For a remote server running on http://127.0.0.1:8000/mcp:

{
  "mcp": {
    "mathmethods": {
      "type": "remote",
      "url": "http://127.0.0.1:8000/mcp",
      "enabled": true
    }
  }
}

Verify with opencode mcp list.

Add the entry under mcpServers in the Antigravity config file, typically ~/.gemini/antigravity/mcp_config.json:

{
  "mcpServers": {
    "mathmethods": {
      "command": "npx",
      "args": ["-y", "@agmonetti/mathmethods-mcp"]
    }
  }
}

If the file path differs on your install, use the in-IDE Settings → Integrations → MCP Servers panel instead, which writes the same format.

The GitHub Copilot CLI (copilot) lets you add a server interactively:

copilot

then inside the session:

/mcp add
  Server name:  mathmethods
  Server type:  1 (Local/STDIO)
  Command:      npx -y @agmonetti/mathmethods-mcp

Press Ctrl+S to save. The settings are stored in ~/.copilot/mcp-config.json (top-level mcpServers); check the connection with /mcp show.

Both use the mcpServers format. In Claude Desktop, edit claude_desktop_config.json; in Claude Code:

claude mcp add mathmethods npx -y @agmonetti/mathmethods-mcp
{
  "mcpServers": {
    "mathmethods": {
      "command": "npx",
      "args": ["-y", "@agmonetti/mathmethods-mcp"]
    }
  }
}

Verify with the MCP Inspector

npx @modelcontextprotocol/inspector node server.py   # or
npx @modelcontextprotocol/inspector --transport http http://127.0.0.1:8000/mcp

Example usage

Ask your agent things like:

  • "Find the root of x^3 - 3x + 1 in [0, 1]."

  • "Integrate sin(x)/x from 0 to 1 using Simpson with n=10."

  • "Solve y' = y with y(0)=1 from x=0 to x=1 with step 0.1 (RK4)."

  • "Build the Lagrange polynomial through (0,1), (1,3), (2,7) and evaluate at 1.5."

  • "Estimate the integral of sin(x) over [0, 2pi] with Monte Carlo hit-or-miss."

  • "Find the equilibria of the logistic model x' = mu*x*(1 - x/K) with K=2, mu=1."

  • "Classify the 2D system x' = 2x - y, y' = x + 2y and sketch its trajectories."

  • "Simulate a Lanchester battle x'=-αy, y'=-βx with α=1, β=2, 100 vs 80 soldiers."

Security

The server is read-only: the tools only compute numbers, they never touch the filesystem, the network or any destructive operation. Still, the inputs are driven by an LLM, so defense in depth is applied:

  • Expression hardening (mathmethods/compiler.py + mathmethods/core/utils.py): length cap, symbol whitelist, function whitelist, and a lexical gate that rejects attribute access (./__) and unknown tokens BEFORE SymPy parses. SymPy's sympify/parse_expr can execute arbitrary Python (verified RCE), so every parse site — in this project and in the upstream backend — routes through the gate.

  • Input caps: iteration/subinterval/step/point counts are bounded to avoid pathological CPU/RAM usage.

  • Exact tool descriptions: the LLM picks tools by their metadata, so descriptions stay accurate (guards against tool-poisoning attacks).

  • Prompt injection: even if the model is tricked, the worst it can do is ask for another computation. There are no privileged side channels.

Known limitations

  • The vendored core is inherited from the upstream project and kept as-is (Spanish identifiers, etc.).

  • dynamic_2d_nonhomogeneous_solve with time-varying forcing on a non-diagonal matrix A shows the homogeneous solution only (the particular term is computed for diagonal systems); the numeric RK4 trajectory is always correct.

  • The 1D bifurcation table is downsampled to 300 rows for readability.

Available Tools

29 tools
dynamic_1d_bifurcationA

Bifurcation analysis of x' = f(x; bif_param): equilibria vs parameter sweep.

Args: func_str: f(x) used when model is 'custom'. model: 'custom' | 'malthus' | 'verhulst' | 'newton'. params: values of the other model parameters, e.g. {'K': 2.0}. bif_param: name of the bifurcation parameter swept between bif_min and bif_max. bif_min, bif_max, bif_steps: parameter sweep range/resolution. x_min, x_max, n_phase: state window for finding equilibria. phase_params: optional explicit parameter values for phase slices. control_enabled: add a constant control term -h (verhulst/custom only). plot: When True, also return a PNG of the bifurcation diagram.

Returns: Dict with the equilibria-vs-parameter table, exact symbolic analysis and phase slices. With plot=True a list [dict, Image] is returned.

Inputs: plot, model, x_max, x_min, +9 more.

dynamic_1d_equilibriaB

Find the equilibria of x' = f(x) and classify their stability.

With plot=True a PNG of f(x) with the equilibria and the time series is returned as [dict, Image] alongside the numeric result.

Inputs: plot, model, x_max, x_min, +4 more.

dynamic_1d_solveA

Analyze the 1D autonomous system x' = f(x): equilibria, stability, phase portrait and time series.

Args: func_str: f(x) used when model is 'custom'. model: 'custom' | 'malthus' (rx) | 'verhulst' (mux*(1-x/K)) | 'newton' (-k*(x-Ta)). params: parameter values, e.g. {'r': 1.5} or {'mu': 1.0, 'K': 2.0}. x_min, x_max: state window. t_max: final time of the time series. n_phase: resolution of the phase analysis. n_time: number of time steps. initial_conditions: starting states, e.g. [0.1, 1.0]. control_enabled: add a constant control term -h (verhulst/custom only). plot: When True, also return a PNG of f(x) and the time series.

Returns: Dict with equilibria, their stability, the phase portrait data and time solutions. With plot=True a list [dict, Image] is returned.

Inputs: plot, model, t_max, x_max, +7 more.

dynamic_2d_conservative_solveB

Analyze a 2D system checking conservativeness (divergence-free), Hamiltonian/energy and closed orbits.

Args: eq_x, eq_y: Math expressions for x' and y'. mu: parameter value. x0..y_max, cantidad_trayectorias: integration and portrait settings. plot: When True, also return a PNG phase portrait.

Returns: Dict with the divergence check, the Hamiltonian reconstruction, the equilibrium classification and the trajectories. With plot=True a list [dict, Image] is returned instead.

Inputs: h, mu, t0, x0, +10 more.

dynamic_2d_lanchester_solveB

Simulate a Lanchester combat model x' = f(x,y), y' = g(x,y) with analytic time-to-annihilation.

Args: eq_x, eq_y: Math expressions (classic default is x'=-αy, y'=-βx). alpha, beta, gamma, epsilon, mu, delta: Greek parameter values. x0, y0: initial force sizes. t0, t_fin, h: simulation grid. plot: When True, also return a PNG phase portrait of the battle.

Returns: Dict with the analytic winner/survivors, state equation and the numerical trajectories. With plot=True a list [dict, Image] is returned instead.

Inputs: h, mu, t0, x0, +10 more.

dynamic_2d_linear_solveA

Solve and classify the linear 2D system X' = A·X + B with constant matrix A.

Args: a, b, c, d: entries of A = [[a, b], [c, d]]. e, f: constant forcing vector B = [e, f]. x0, y0, t0, t_fin, h: initial condition and integration grid. x_min..y_max: window for the phase portrait. cantidad_trayectorias: number of sample trajectories. plot: When True, also return a PNG phase portrait.

Returns: Dict with the classification, eigenvalues, nullclines, analytic solution and trajectories. With plot=True a list [dict, Image] is returned.

Inputs: a, b, c, d, +13 more.

dynamic_2d_nonhomogeneous_solveA

Solve the non-homogeneous 2D system X' = A·X + B(t) with constant or time-varying forcing.

Args: a, b, c, d: entries of A = [[a, b], [c, d]]. e, f: forcing components B(t); a number or an expression in t (e.g. "sin(2*t)"). x0, y0, t0, t_fin, h: integration settings. x_min..y_max, cantidad_trayectorias: portrait settings. plot: When True, also return a PNG phase portrait.

Returns: Dict with the classification, equilibrium/particular solution, analytic solution and trajectories. With plot=True a list [dict, Image] is returned instead.

Inputs: a, b, c, d, +13 more.

dynamic_2d_nonlinear_solveB

Solve and analyze the nonlinear 2D system x' = f(x,y), y' = g(x,y).

Args: eq_x, eq_y: Math expressions for f and g (variables x, y, mu and extra params). params: extra parameter values (e.g. {'alpha': 0.5}). mu: bifurcation parameter value. x0..y_max, cantidad_trayectorias: integration and portrait settings. plot: When True, also return a PNG phase portrait.

Returns: Dict with equilibria, Jacobian-based classification, nullclines and trajectories. With plot=True a list [dict, Image] is returned.

Inputs: h, mu, t0, x0, +11 more.

finite_differencesA

Approximate the first and second derivatives of f(x) at x with finite differences.

Computes forward, backward and central differences for the first derivative, plus the central second derivative, and compares each against the exact derivative from SymPy.

Args: func_str: Math expression in x. x_val: Point where the derivative is evaluated. h: Step size (small, positive). precision: Rounding digits. plot: When True, also return a PNG of f(x) and its exact tangent.

Returns: Dict with the exact and numerical derivatives and their errors. With plot=True a list [dict, Image] is returned instead.

Inputs: x_val (required), func_str (required), h, plot, +1 more.

integral_compararA

Compare rectangle, trapezoid, Simpson 1/3 and Simpson 3/8 on the same integral.

Args: func_str: Math expression in x. a, b: Integration limits (b > a). n: Number of subintervals. Must be a multiple of 6 (2 for Simpson 1/3 and 3 for Simpson 3/8), so all four rules can run on the same grid. epsilon, precision: Error-bound and rounding settings. plot: When True, also return a PNG bar chart comparing the four rules.

Returns: Dict with per-method results and success flags. With plot=True a list [dict, Image] is returned instead.

Inputs: a (required), b (required), n (required), func_str (required), +3 more.

integral_rectanguloA

Approximate ∫ₐᵇ f(x) dx with the composite midpoint (rectangle) rule.

Args: func_str: Math expression in x. a, b: Integration limits (b > a). n: Number of subintervals. epsilon: Optional point in [a, b] for the truncation error bound. precision: Rounding digits. plot: When True, also return a PNG plot of f(x) over [a, b].

Returns: Dict with the integral, error estimates and table. With plot=True a list [dict, Image] is returned instead.

Inputs: a (required), b (required), n (required), func_str (required), +3 more.

integral_simpson13A

Approximate the definite integral of f(x) on [a, b] with composite Simpson 1/3.

Args: func_str: Math expression in x, e.g. "sin(x)/x". a: Lower integration limit. b: Upper integration limit (must be > a). n: Number of subintervals (must be even). Error is O(h^4). epsilon: Point in [a, b] used to report the truncation error bound. precision: Rounding digits. plot: When True, also return a PNG plot of f(x) over [a, b].

Returns: Dict with the approximated integral, error estimates and table. With plot=True a list [dict, Image] is returned instead.

Inputs: a (required), b (required), n (required), func_str (required), +3 more.

integral_simpson38A

Approximate ∫ₐᵇ f(x) dx with the composite Simpson 3/8 rule.

Args: func_str: Math expression in x. a, b: Integration limits (b > a). n: Number of subintervals (must be a multiple of 3). epsilon: Optional point in [a, b] for the truncation error bound. precision: Rounding digits. plot: When True, also return a PNG plot of f(x) over [a, b].

Returns: Dict with the integral, error estimates and table. With plot=True a list [dict, Image] is returned instead.

Inputs: a (required), b (required), n (required), func_str (required), +3 more.

integral_trapecioA

Approximate ∫ₐᵇ f(x) dx with the composite trapezoidal rule.

Args: func_str: Math expression in x. a, b: Integration limits (b > a). n: Number of subintervals. epsilon: Optional point in [a, b] for the truncation error bound. precision: Rounding digits. plot: When True, also return a PNG plot of f(x) over [a, b].

Returns: Dict with the integral, error estimates and table. With plot=True a list [dict, Image] is returned instead.

Inputs: a (required), b (required), n (required), func_str (required), +3 more.

interpolation_lagrangeA

Build the Lagrange interpolating polynomial through a set of points.

Provide either the point values puntos_y or the generating function func_str evaluated at puntos_x.

Args: puntos_x: Distinct abscissas of the interpolation points. x_eval: Optional x where the polynomial is evaluated. func_str: Optional generating function f(x) for the y values. puntos_y: Optional y values matching puntos_x one-to-one. precision: Rounding digits. plot: When True, also return a PNG plot of the polynomial and points.

Returns: Dict with the polynomial, its degree, the points table and error bounds when func_str is provided. With plot=True a list [dict, Image] is returned instead.

Inputs: puntos_x (required), plot, x_eval, func_str, +2 more.

mc_convergencia_1dB

Show how the mean-value Monte Carlo estimate converges as samples accumulate.

Args: func_str: Math expression in x. a, b: Integration limits (b > a). N: Total number of samples. seed: Optional RNG seed. precision: Rounding digits. plot: When True, also return a PNG of the running average.

Returns: Dict with the cumulative running average over the samples. With plot=True a list [dict, Image] is returned instead.

Inputs: a (required), b (required), func_str (required), N, +3 more.

mc_estadistico_1dA

Replicated Monte Carlo experiment (M repetitions of N samples) with statistical analysis.

Args: func_str: Math expression in x. a, b: Integration limits (b > a). N: Samples per replication. M: Number of replications. nivel_confianza: Confidence level in (0, 1). seed: Optional RNG seed. precision: Rounding digits. plot: When True, also return a PNG histogram of the estimates.

Returns: Dict with the distribution of estimates and confidence intervals. With plot=True a list [dict, Image] is returned instead.

Inputs: a (required), b (required), func_str (required), M, +5 more.

mc_hit_or_miss_1dA

Estimate ∫ₐᵇ f(x) dx with the hit-or-miss Monte Carlo method.

Handles sign-changing integrands correctly (returns the signed integral).

Args: func_str: Math expression in x. a, b: Integration limits (b > a). N: Number of samples. seed: Optional RNG seed for reproducibility. precision: Rounding digits. nivel_confianza: Confidence level in (0, 1) for the interval. plot: When True, also return a PNG plot of the samples and f(x).

Returns: Dict with the estimate, interval, sample statistics and history. With plot=True a list [dict, Image] is returned instead.

Inputs: a (required), b (required), func_str (required), N, +4 more.

mc_valor_promedio_1dA

Estimate ∫ₐᵇ f(x) dx with the mean-value Monte Carlo method.

Args: func_str: Math expression in x. a, b: Integration limits (b > a). N: Number of samples. seed: Optional RNG seed for reproducibility. precision: Rounding digits. nivel_confianza: Confidence level in (0, 1). plot: When True, also return a PNG scatter plot of the samples.

Returns: Dict with the estimate, confidence interval and sample statistics. With plot=True a list [dict, Image] is returned instead.

Inputs: a (required), b (required), func_str (required), N, +4 more.

mc_valor_promedio_2dC

Estimate the double integral of f(x, y) over [x_a,x_b]×[y_a,y_b] by mean value.

With plot=True a PNG scatter of the sampled points coloured by f(x, y) is returned as [dict, Image] alongside the numeric result.

Inputs: x_a (required), x_b (required), y_a (required), y_b (required), +6 more.

mc_valor_promedio_3dB

Estimate the triple integral of f(x,y,z) over the box [x_a,x_b]×[y_a,y_b]×[z_a,z_b].

With plot=True a PNG histogram of the sampled f values is returned as [dict, Image] alongside the numeric result.

Inputs: x_a (required), x_b (required), y_a (required), y_b (required), +8 more.

ode_eulerA

Solve y'(x) = f(x, y), y(x0) = y0 with the explicit Euler method (1st order).

Args: ecuacion_str: Right-hand side f(x, y). x0, y0: Initial condition. xf: Final x (must be > x0). h: Step size (must be positive). tol: Optional tolerance flag for the final error. precision: Rounding digits. plot: When True, also return a PNG plot of the solution.

Returns: Dict with the numerical solution, exact solution (when available) and errors. With plot=True a list [dict, Image] is returned instead.

Inputs: h (required), x0 (required), xf (required), y0 (required), +4 more.

ode_heunA

Solve y'(x) = f(x, y), y(x0) = y0 with Heun's predictor-corrector method (2nd order).

Args: ecuacion_str: Right-hand side f(x, y). x0, y0: Initial condition. xf: Final x (must be > x0). h: Step size (must be positive). tol: Optional tolerance flag for the final error. precision: Rounding digits. plot: When True, also return a PNG plot of the solution.

Returns: Dict with the numerical solution, exact solution (when available) and errors. With plot=True a list [dict, Image] is returned instead.

Inputs: h (required), x0 (required), xf (required), y0 (required), +4 more.

ode_rk4A

Solve an initial value problem y'(x) = f(x, y) with the Runge-Kutta 4 method.

Args: ecuacion_str: Right-hand side f(x, y), e.g. "y" or "-2xy". x0: Initial x. y0: Initial y(x0). xf: Final x (must be > x0). h: Step size (must be positive). The endpoint xf is always reached. tol: Optional tolerance to flag whether the final error meets it. precision: Rounding digits. plot: When True, also return a PNG plot of the solution.

Returns: Dict with the numerical solution table, exact solution (when SymPy can solve it) and per-step errors. With plot=True a list [dict, Image] is returned instead.

Inputs: h (required), x0 (required), xf (required), y0 (required), +4 more.

root_aitkenB

Accelerate fixed-point iteration with Aitken's delta-squared method.

Args: g_str: Math expression for the iteration function g(x). x0: Initial guess. tol: Convergence tolerance. max_iter: Maximum iterations. precision: Rounding digits. plot: When True, also return a PNG plot of g(x) and y = x.

Returns: Dict with the accelerated root, iteration table and convergence flag. With plot=True a list [dict, Image] is returned instead.

Inputs: x0 (required), g_str (required), tol, plot, +2 more.

root_bisectionA

Find a root of f(x) = 0 in [a, b] using the bisection method.

Requires f(a) and f(b) to have opposite signs (Bolzano's theorem).

Args: func_str: Math expression in x, e.g. "x**2 - 4". a: Left endpoint of the interval. b: Right endpoint of the interval (must be > a). tol: Convergence tolerance on the residual/error. max_iter: Maximum number of iterations. precision: Rounding digits for the reported root. plot: When True, also return a PNG plot of f(x) and the root.

Returns: Dict with the root, convergence flag, iteration table and errors. With plot=True a list [dict, Image] is returned instead.

Inputs: a (required), b (required), func_str (required), tol, +3 more.

root_compararA

Compare bisection, fixed-point, Newton-Raphson and Aitken on the same problem.

Args: func_str: Math expression for f(x) (used by bisection/Newton). g_str: Math expression for g(x) (used by fixed-point/Aitken). a, b: Bracket for bisection (f(a) and f(b) must differ in sign). x0: Initial guess. tol, max_iter, precision: Shared tolerances. plot: When True, also return a PNG bar chart of the iterations used.

Returns: Dict with per-method results. With plot=True a list [dict, Image] is returned instead.

Inputs: a (required), b (required), x0 (required), g_str (required), +5 more.

root_newton_raphsonA

Find a root of f(x) = 0 with the Newton-Raphson method (numeric derivative).

Args: func_str: Math expression in x. x0: Initial guess. tol: Convergence tolerance. max_iter: Maximum iterations. precision: Rounding digits. plot: When True, also return a PNG plot of f(x) and the root.

Returns: Dict with the root, iteration table and convergence flag. With plot=True a list [dict, Image] is returned instead.

Inputs: x0 (required), func_str (required), tol, plot, +2 more.

root_punto_fijoA

Find a fixed point of g(x) = x with the fixed-point iteration method.

Converges when |g'(x)| < 1 near the root (Lipschitz check is reported).

Args: g_str: Math expression for the iteration function g(x). x0: Initial guess. tol: Convergence tolerance. max_iter: Maximum iterations. precision: Rounding digits. plot: When True, also return a PNG plot of g(x) and y = x.

Returns: Dict with the fixed point, the Lipschitz check, iteration table and convergence flag. With plot=True a list [dict, Image] is returned.

Inputs: x0 (required), g_str (required), tol, plot, +2 more.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3.2/5.0

    Scored across 29 tools

    Disambiguation3/5

    Most tools target a distinct numerical method, but several pairs overlap heavily: dynamic_1d_solve already returns equilibria, stability, phase portrait and time series, which is nearly what dynamic_1d_equilibria does, and dynamic_2d_linear_solve (X'=A·X+B with constant B) is a special case of dynamic_2d_nonhomogeneous_solve, making selection guesswork. The Monte Carlo family (valor_promedio, estadistico, convergencia, hit_or_miss) is distinguishable but requires reading descriptions closely, and individual rule tools versus the two *_comparar tools also invite misselection.

    Naming Consistency3/5

    A domain-prefix convention exists (integral_, root_, ode_, mc_, dynamic_1d_, dynamic_2d_) and is mostly snake_case, but it is broken by bare names like finite_differences and interpolation_lagrange. Spanish and English are mixed within the same pattern (integral_comparar vs integral_trapecio vs root_newton_raphson; mc_valor_promedio_1d vs mc_hit_or_miss_1d), and suffixes mix verbs (solve, comparar) with nouns, so the scheme is readable but not predictable.

    Tool Count2/5

    At 29 tools this is well past a comfortable scope for one server. The surface could be consolidated substantially: the four quadrature rules could be a single tool with a 'method' parameter (the comparison tool already does this), as could the three ODE solvers and several of the 2D dynamical-system variants.

    Completeness3/5

    Core numerical analysis areas are well covered — root finding, quadrature, ODE IVPs, Monte Carlo, and dynamical systems each have multiple methods plus comparison tools. However, there are notable gaps: interpolation has only Lagrange (no Newton/divided differences or splines), and there are no direct linear-system solvers (Gauss elimination, LU, iterative methods) or least-squares/curve-fitting tools, which are standard in this domain.

    Maintenance

    ActivitySlowing
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      A demonstration MCP server that exposes basic arithmetic tools (add, subtract, ping) through FastAPI and shows how to integrate them with OpenAI's tool-calling API for LLM orchestration.
      -
    • 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
    • A
      license
      B
      quality
      D
      maintenance
      A Model Context Protocol (MCP) server that provides basic mathematical, statistical and trigonometric functions to Large Language Models (LLMs).
      59
      1
      MIT