Sign In

mathgraphs-mcp

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mathgraphs-mcp

An agentic MCP for math and statistics graphing, computation, visualization, and validation

Source
npmnpm
Version
1.3.0
Version published
Maintainers
1
Created
Source

mathgraphs-mcp

An agentic MCP for math and statistics graphing, computation, visualization, and validation.

MathTalking computes and renders interactive math visualizations. Plot functions, geometry, histograms, regression curves, and more. Results are graph-verified — roots, extrema, and intersections are computed from actual plotted curves, not generated by AI.

Saves ~410 tokens per render vs LLM-generated canvas code. Zero LLM inference needed — the engine computes, not generates.

Endpoint

https://mathtalking.com/api/mcp

Tools

plot_graph — Math Visualization

Plot functions, points, segments, labels, and shapes on an interactive graph. Auto-computes roots, extrema, and intersections for plotted functions.

Input: Array of elements, each with a type and type-specific fields:

TypeFieldsExample
functionexpression (required), color{"type":"function", "expression":"x^2-4", "color":"#4A90D9"}
pointspoints [{x,y}] (required), color, label{"type":"points", "points":[{"x":2,"y":0}], "label":"root"}
segmentx1,y1,x2,y2 (required), color, label, arrow, dashed{"type":"segment", "x1":0, "y1":0, "x2":3, "y2":4, "label":"hypotenuse"}
labeltext (required), x,y (required), color, fontSize{"type":"label", "text":"vertex", "x":0, "y":-4}
trianglex1,y1,x2,y2,x3,y3 (required), color, opacity, border{"type":"triangle", "x1":0, "y1":0, "x2":3, "y2":0, "x3":3, "y3":4}
boxx1,y1,x2,y2 (required), height (required), color, opacity{"type":"box", "x1":0, "y1":0, "x2":1, "y2":0, "height":5}

Supports: Explicit y=f(x), implicit x²+y²=1, parametric (cos(t),sin(t)), piecewise, domain restrictions.

Optional params:

  • viewport{xmin, xmax, ymin, ymax} to set coordinate range
  • title — graph title
  • summary — frosted glass overlay text on the graph
  • gridStyle"polar" (concentric circles + radial lines), "axes" (axes only, no grid), "none" (clean canvas). Default: rectangular grid.
  • output"url" (default, interactive page), "embed" (iframe URL), or "svg" (vector image as text)
  • animations — array of {tool, name, from, to, loop} for animated parameters. tool: "animate_parameter" with loop: true creates a continuous bounce animation.
  • theme"default", "terminal", "wallstreet", "science", or "finance". Visual theme applied to the graph.

Returns: Interactive URL with zoom, pan, and sliders. Or SVG/embed URL depending on output param.

create_show — Slideshow

Bundle multiple plot_graph results into a slideshow. First create each slide with plot_graph, then pass the render IDs here.

Input: title (string), slide_ids (array of render IDs from plot_graph results).

Returns: Interactive show URL with prev/next navigation, keyboard controls, and auto-play.

compute_stats — Descriptive Statistics

Compute mean, median, standard deviation, min, max, range, quartiles from raw data.

add_histogram — Histogram

Create auto-binned histogram from raw numerical data.

add_regression — Regression

Fit linear, quadratic, exponential, or power regression to data points. Returns slope, intercept, R².

fit_distribution — Distribution Fitting

Fit normal, uniform, or exponential distribution to data. Returns best-fit parameters.

test_hypothesis — Hypothesis Testing

Run t-test, paired t-test, or one-sample t-test. Returns test statistic, p-value, and significance.

When to Use

  • User asks to graph, plot, or visualize any math
  • You need to verify a mathematical result visually (roots, intersections, extrema)
  • You computed an answer and want to show it, not just describe it
  • You need a multi-step explanation — create slides with plot_graph, bundle with create_show
  • Data needs statistical visualization (histogram, regression, distribution fit)
  • Geometry needs precise rendering (triangles, circles, constructions)

Why Use This

  • Computed, not hallucinated — roots from actual zero-crossings, regression from least squares
  • Interactive — user can zoom, pan, adjust sliders, explore
  • Shareable — each graph gets a permanent URL
  • 9 languages — en, zh, zh-TW, ja, ko, es, fr, de, pt-BR

Quick Test

curl -X POST https://mathtalking.com/api/mcp \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"plot_graph","arguments":{"elements":[{"type":"function","expression":"sin(x)","color":"#4A90D9"}]}}}'
  • Website: mathtalking.com
  • Interactive demo: mathtalking.com/math/quadratic-en
  • API endpoint: POST https://mathtalking.com/api/render (REST) or POST https://mathtalking.com/api/mcp (MCP)

Keywords

mcp

FAQs

Package last updated on 04 Apr 2026

Related posts