Desmos MCP Server
Summary: A local (stdio) MCP server that validates, plots, and symbolically analyzes math formulas in x, returning native PNG images and text metadata into the chat.
validate_formula— checks/normalizes a formula and gives actionable syntax guidance on failure (offline).plot_math_function— renders a 2D curve from one formula, with optionalx_range/y_range; tries the Desmos API first and falls back to local rendering.plot_multiple_functions— overlays several formulas on the same axes (up to 12 per the README) with shared ranges.analyze_formula— symbolic analysis:basicdomain,detailedrange/derivative, orcritical_points(stationary and possible nondifferentiable candidates, unclassified).Images in-chat — plots return as native MCP PNG content plus text metadata (formula, warnings, saved file path);
save_files=falsestill returns the image.hello— a trivial greeting tool (schema artifact, not a math feature).Not included in this schema — the README's 3D/surface, points, parametric, vector-field, physics, and
explore_functionstools are not exposed here.
Provides mathematical formula validation, symbolic analysis, and local rendering capabilities for visualizing mathematical functions and calculating properties like domain, range, and critical points
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., "@Desmos MCP Server plot y = sin(x) + cos(2x) from -2π to 2π"
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.
Locus
中文 · Client setup · Examples
A locus is the set of points a formula picks out. In the chat, tell the model to draw something harder than a single sine wave: several curves on one pair of axes, or several surfaces in one x, y, z view. Locus draws that picture and hands it back in the reply.
Install with uv run locus. The repository is Locus.
Python 3.10+ · FastMCP 2.x · Apache-2.0.
What works
Tool | Result | Requirements |
| Normalized formula or actionable syntax guidance | Offline |
| PNG image and optional saved file | Offline |
| 1–12 curves on shared axes | Offline |
| Those curves plus each formula's analysis, in one result | Offline |
| 1–6 sampled surfaces | Offline |
| Scatter data in 2D or 3D, with an optional formula | Offline |
| Curve | Offline |
| Arrows for a 2D field | Offline |
| Projectile, oscillator, or x(t), y(t), with the measured trajectory | Offline |
| Domain; optionally range, derivative, stationary points and corner candidates | Offline |
Offline curve tools accept y = x^2, 2*x + 1, sin(x), sqrt(x), abs(x), pi and e.
plot_3d_surface accepts one surface, or formulas with up to six, on one view. The chat image does not rotate. Orbit and zoom are in the local page below.
explore_functions plots several y=f(x) curves and returns each analysis with that picture.
Related MCP server: GeoGebra MCP Server
What the plots look like
These pictures are the offline PNG results. The local page opens with the same two overlays already filled in.
Several 2D curves | Several 3D surfaces |
|
|
|
|
Curves | Surface |
|
|
|
|
Points | Parametric curve |
|
|
Points on |
|
Vector field | Projectile |
|
|
| Launch at 20 and 45 degrees |
What the assistant returns
An offline plotting call returns native MCP PNG image content plus text metadata containing the formula, warnings, and a saved file path when saving is enabled. Image-capable clients can show the plot directly in chat.
Offline 3D is a sampled surface image. Symbolic analysis stays two-dimensional.
Verification status
The 0.2 release passed 42 Python tests and 3 isolated JavaScript controller tests locally on macOS/Python 3.10. The CLI, native PNG output, and bundled HTML template were also checked from a separately installed wheel.
Later local checks on Linux with Python 3.11: ruff check passed, 47 pytest tests passed, and 5 Node controller tests passed.
CI is configured for Linux, macOS and Windows with Python 3.10/3.12; this is not a claim that those remote jobs have passed.
The picture tests check the PNG bytes and the metadata returned with them.
Quick start
Install uv if needed, then:
git clone https://github.com/TheGrSun/Locus.git
cd Locus
uv sync --locked
uv run locus --helpConnect your MCP client using the copyable configuration. The server uses stdio:
uv run locusWaiting for input is normal: this command starts an MCP server, not a command-line chat.
The compatibility command uv run src/main.py also works.
Try asking your assistant:
Plot sin(x) and cos(x) from -2pi to 2pi and explain where they cross.
Plot z = sin(x)*cos(y).
The chat returns the picture directly. A 3D result is one view of the x, y, and z axes.
To drag a graph yourself, from this repository:
uv run python page/server.pyThen open http://127.0.0.1:8766. The page listens on this machine only.
The page has two modes, and each one opens with three formulas already drawn. 3D shows sin(x)*cos(y), exp(-(x^2+y^2)/8), and 0.3*sin(2*x)+0.3*cos(2*y) on x, y, and z axes. 2D shows sin(x), exp(-x^2/8)*cos(2*x), and x^2/20 if x < 0 else sin(x)/x. Paste a plain formula or LaTeX such as \sin(x)\cos(y) or x^{2}. The sidebar switches language and mode, and each mode keeps its own formulas. Drag a 3D view to orbit, scroll to zoom, and use the buttons for the default view, a top-down XY view, or zoom. On a 2D curve those buttons change the window, and a checkbox can plot the derivative.
Agent harness
The published route is the server instructions, resources://guide, and the prompts basic_graphing_assistant, advanced_math_analysis, and visualize_3d.
Configuration
Configuration priority: --config PATH → LOCUS_CONFIG → ./config.json → built-in defaults.
Relative output directories resolve against the configuration file, not the caller's current directory.
{
"output_dir": "graphs",
"timeout_seconds": 20,
"rendering": {
"default_width": 900,
"default_height": 600,
"samples": 1600,
"save_files": true
}
}Without a configuration file, artifacts go to the operating system's temporary directory under locus.
Use an explicit directory for lasting files. File names contain UUIDs. save_files=false disables saved PNGs. Images still return as native MCP content.
Generated files are not automatically deleted. Delete unwanted artifacts from the configured output directory.
Offline inputs have length, syntax, and range limits. Symbolic analysis and rendering run in disposable processes with a configurable timeout and at most two active workers. The whitelist parser never evaluates Python from user input. This is a local stdio service, not a hardened public multi-tenant computation service.
Accuracy and limits
Offline analysis supports real-valued functions of
xwith explicit multiplication and radians. Allowed functions:sin,cos,tan,asin,acos,atan,sinh,cosh,tanh,exp,log/ln,sqrt,abs/Abs.basicanalyzes the domain.detailedadds range and derivative analysis.critical_pointsreports stationary points and possible nondifferentiable points separately. Candidates are not classified extrema.Unresolved symbolic results include warnings; a
ConditionSetis not “no solutions.” Some requests can time out.Static PNG curves are sampled approximations; inspect a narrower range near discontinuities or rapid oscillations.
Returned file paths refer to the server machine. Remote clients need a separate file-transfer mechanism.
Tools do not provide symbolic integration, limits, symbolic 3D analysis, or automatic browser-to-MCP state synchronization.
plot_3d_surfaceis a finite sample ofz=f(x,y).
Development
uv sync --locked
uv run pytest
uv run ruff check src tests
node --test tests/bounds.test.cjs tests/i18n.test.cjs
uv buildNode.js 22+ is needed only for the small browser-script tests, not for running the MCP server.
See CONTRIBUTING.md for module boundaries and validation requirements.
CHANGELOG.md documents the 0.2 migration, including removal of the old desmos configuration block.
The Python package includes the HTML template; the CLI works after wheel installation.
Licensed under Apache-2.0.
Available Tools
5 toolsanalyze_formulaB
Analyzes mathematical properties of a formula (domain, range, critical points).
Inputs: formula (required), analysis_type. Returns: result
helloB
A simple tool that returns a greeting.
Inputs: name. Returns: result
plot_math_functionB
Generates a 2D plot. Tries Desmos API if available, otherwise falls back to local rendering.
Inputs: formula (required), x_range, y_range, use_api. Returns: result
plot_multiple_functionsC
Plots multiple functions on the same graph.
Inputs: formulas (required), x_range, y_range. Returns: result
validate_formulaB
Validates the syntax of a mathematical formula, offering intelligent help on failure.
Inputs: formula (required). Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Most tools have distinct purposes: analyze_formula, plot_math_function, plot_multiple_functions, and validate_formula each target different mathematical tasks. However, analyze_formula and validate_formula could be slightly confused as both involve formula inspection, but their descriptions clarify analysis vs. syntax validation. The hello tool is clearly distinct but trivial.
Tools follow a consistent verb_noun pattern (e.g., analyze_formula, plot_math_function) with clear, descriptive names. The only minor deviation is hello, which is a simple noun without a verb, but this does not significantly disrupt the overall consistency.
With 5 tools, the count is reasonable for a mathematical plotting and analysis server. It covers core functionalities like plotting and formula handling without being overwhelming. However, it feels slightly thin for a full mathematical toolkit, as it lacks tools for operations like solving equations or data manipulation.
The server covers basic plotting and formula analysis well, but there are notable gaps. For a Desmos-like domain, missing operations include solving equations, manipulating graphs (e.g., zoom, pan), exporting plots, or handling parametric functions. The hello tool adds no functional value, and the set feels incomplete for advanced mathematical workflows.
Maintenance
Related MCP Connectors
Create interactive 2D and 3D graphs with validated equations, shareable links, and PNG previews.
Exact arithmetic, algebra, calculus, physics, chemistry and finance with a checkable formula.
AI-callable calculators and engineering models with real formulas. No hallucinated math.
Integrates Wolfram Language and Wolfram|Alpha accessing curated data and sophisticated algorithms.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides advanced mathematical calculation capabilities including symbolic algebra, numerical computing, data analysis, and image processing through SymPy, NumPy, SciPy, and pandas integration.3MIT
- AlicenseNot gradedqualityDmaintenanceProvides access to GeoGebra's mathematical computation, geometry construction, and visualization capabilities. Enables mathematical calculations, CAS operations, geometric constructions, and exporting results as PNG or PDF images.14MIT
- AlicenseNot gradedqualityDmaintenanceEnables mathematical computation via Wolfram Language/Mathematica integration, supporting calculations, equation solving, calculus, matrix operations, and symbolic mathematics.13MIT
- AlicenseAqualityCmaintenanceProvides powerful symbolic mathematics and statistical analysis capabilities, enabling users to solve equations, compute derivatives and integrals, perform statistical tests, and analyze data through natural language requests.45MIT







