Desmos MCP Server
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 "Install 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 Serverplot 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.
Desmos-MCP Server
English | 中文
This is a standard Model Context Protocol (MCP) server designed to provide powerful mathematical formula visualization and analysis capabilities for Large Language Models (LLMs). It utilizes sympy for local rendering and computation, and can optionally integrate with the Desmos API.
✨ Features
Interactive Formula Validation: Use the
validate_formulatool to check the syntax of mathematical formulas. If a formula is invalid, it uses the LLM sampling feature to provide an easy-to-understand explanation of the error.Single Function Plotting: Use the
plot_math_functiontool to generate a 2D plot from a formula. It supports using the Desmos API (configurable viaconfig.json) or falling back to localmatplotlibrendering, and provides progress reports during execution.Multiple Function Plotting: Use the
plot_multiple_functionstool to plot multiple functions on the same graph.Symbolic Analysis: Use the
analyze_formulatool to calculate mathematical properties of a formula, such as its domain, range, and critical points.Save Plot to File: Automatically saves the generated plot as a PNG file to a
Desmos-MCPfolder on your desktop.
Related MCP server: GeoGebra MCP Server
⚙️ Tech Stack
Python 3.10+
FastMCP
Sympy
Matplotlib
HTTPX
🚀 Installation & Setup
Clone the project (if you haven't already)
Install
uvIf you don't haveuvinstalled, run the following command in your terminal:powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"Create a virtual environment In the project root directory, run:
uv venvInstall dependencies
uv syncThis command will install all the necessary dependencies based on the
pyproject.tomlfile.
🔧 Configuration
The server's behavior is controlled by the config.json file in the project root.
{
"desmos": {
"use_api": true,
"api_key_env_var": "DESMOS_API_KEY",
"fallback_to_local": true
},
"rendering": {
"default_width": 600,
"default_height": 400
}
}desmos.use_api: Iftrue, the server will first attempt to use the Desmos API for plotting.desmos.api_key_env_var: Specifies the name of the environment variable used to get the Desmos API key.desmos.fallback_to_local: Ifuse_apiistruebut the API call fails, this determines if the server should automatically fall back to local rendering.
Set Desmos API Key (Optional)
To use the Desmos API feature, you need to set an environment variable. For example, in PowerShell:
$env:DESMOS_API_KEY="your_actual_api_key_here"▶️ Running the Server
To run the server independently for testing, execute the following command in the project root:
uv run src/main.pyThe server will start via standard input/output (stdio) and will be ready to be connected by an MCP client (like the Gemini CLI).
📝 To-Do
Add 3D plotting support.
Implement real-time formula analysis and interactive plotting, similar to Desmos.
📄 License
This project is licensed under the Apache 2.0 License. See the LICENSE file for details.
Available Tools
5 toolsanalyze_formulaB
Analyzes mathematical properties of a formula (domain, range, critical points).
| Name | Required | Description | Default |
|---|---|---|---|
| formula | Yes | ||
| analysis_type | No | basic |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. It states what the tool does but doesn't describe how it behaves: no information on computational complexity, error handling for invalid formulas, output format details (though an output schema exists), or whether this is a read-only operation. For a tool with no annotations, this leaves significant behavioral gaps.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence that front-loads the core purpose. Every word earns its place: 'analyzes' (verb), 'mathematical properties' (scope), 'formula' (resource), and specific examples in parentheses. There's zero waste or redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's moderate complexity (2 parameters, one with enum), no annotations, and the presence of an output schema, the description is minimally adequate. The output schema reduces the need to explain return values, but the description lacks details on behavioral traits and parameter usage. It's complete enough for basic understanding but has clear gaps in guidance and transparency.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the schema provides no parameter descriptions. The description mentions 'analysis_type' implicitly through the examples (domain, range, critical points), which correspond to the enum values, but doesn't explain the 'formula' parameter's format or constraints. It adds some meaning beyond the bare schema but doesn't fully compensate for the coverage gap, especially for the required 'formula' parameter.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb 'analyzes' and the resource 'mathematical properties of a formula', with specific examples (domain, range, critical points). It distinguishes from siblings like 'plot_math_function' or 'validate_formula' by focusing on analysis rather than visualization or validation. However, it doesn't explicitly differentiate from all siblings (e.g., 'hello' is unrelated).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives. It doesn't mention when to choose 'analyze_formula' over 'validate_formula' for formula checking, or when analysis is preferred over plotting with 'plot_math_function'. There are no explicit when/when-not statements or named alternatives.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
helloB
A simple tool that returns a greeting.
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | World |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden. It states the tool returns a greeting but doesn't disclose any behavioral traits like whether it's idempotent, has side effects, or what the output format is. The description is minimal and lacks context beyond the basic action.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence with no wasted words. It's appropriately sized for such a simple tool and front-loads the core purpose clearly.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's low complexity (1 optional parameter) and the presence of an output schema, the description is complete enough for basic understanding. However, it could benefit from slightly more context about the greeting format or usage scenarios to be fully comprehensive.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 1 parameter with 0% description coverage, but the description doesn't mention parameters at all. Since there's only one parameter and the tool is very simple, the baseline is high. However, the description doesn't add meaning beyond the schema, so it doesn't fully compensate for the lack of schema descriptions.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states the tool 'returns a greeting', which is a clear purpose but vague about what kind of greeting or how it's generated. It doesn't differentiate from sibling tools (like analyze_formula or plot_math_function), but the purpose is understandable albeit basic.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus alternatives. The description doesn't mention any context, prerequisites, or exclusions, leaving the agent to infer usage based on the simple purpose alone.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
plot_math_functionB
Generates a 2D plot. Tries Desmos API if available, otherwise falls back to local rendering.
| Name | Required | Description | Default |
|---|---|---|---|
| formula | Yes | ||
| x_range | No | ||
| y_range | No | ||
| use_api | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden. It discloses the fallback behavior between Desmos API and local rendering, which is useful context. However, it doesn't mention other behavioral traits like performance implications, error handling, authentication needs, rate limits, or output format details, leaving gaps for a tool with 4 parameters.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is highly concise with two sentences that efficiently convey the core functionality and fallback mechanism. It's front-loaded with the main purpose and wastes no words, making it easy to parse.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given 4 parameters with 0% schema coverage and no annotations, the description is incomplete as it lacks parameter explanations and behavioral details. However, the presence of an output schema reduces the need to describe return values, and the purpose is clear, making it minimally adequate but with significant gaps.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must compensate, but it adds no information about parameters beyond the general context of plotting. It doesn't explain what 'formula', 'x_range', 'y_range', or 'use_api' mean or how they affect the plot, leaving all 4 parameters semantically unclear.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: 'Generates a 2D plot' with a specific mathematical context. It distinguishes from siblings like 'analyze_formula' and 'validate_formula' by focusing on visualization rather than analysis or validation, though it doesn't explicitly contrast with 'plot_multiple_functions'.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage for plotting mathematical functions, with a fallback mechanism mentioned ('Tries Desmos API if available, otherwise falls back to local rendering'). However, it lacks explicit guidance on when to use this tool versus alternatives like 'plot_multiple_functions' or other siblings, and doesn't specify prerequisites or exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
plot_multiple_functionsC
Plots multiple functions on the same graph.
| Name | Required | Description | Default |
|---|---|---|---|
| formulas | Yes | ||
| x_range | No | ||
| y_range | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure but only states the basic action without details on output format, error handling, or performance traits. It doesn't mention whether the plot is interactive, saved, or displayed, nor does it cover rate limits or authentication needs, which are critical for a plotting tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise with a single sentence that directly states the tool's function without any fluff or redundancy. It is front-loaded and wastes no words, making it efficient for quick comprehension, though this brevity contributes to gaps in other dimensions.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's moderate complexity (3 parameters, no annotations, but with an output schema), the description is incomplete. It lacks details on parameter usage, behavioral traits, and differentiation from siblings, though the presence of an output schema mitigates the need to explain return values. This results in a minimally adequate but insufficiently informative description.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 0% description coverage, so the description must compensate but adds no parameter semantics beyond implying 'formulas' are plotted. It doesn't explain what 'formulas' entail (e.g., mathematical expressions), the format of 'x_range' and 'y_range' (e.g., arrays of two numbers), or default behaviors, leaving significant gaps in understanding.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose with a specific verb ('plots') and resource ('multiple functions on the same graph'), making it immediately understandable. However, it doesn't explicitly distinguish itself from sibling tools like 'plot_math_function', which might handle single functions, leaving some ambiguity about when to choose one over the other.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives, such as 'plot_math_function' for single functions or 'analyze_formula' for non-graphical analysis. It lacks explicit instructions on prerequisites, context, or exclusions, leaving the agent to infer usage based on the tool name alone.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
validate_formulaB
Validates the syntax of a mathematical formula, offering intelligent help on failure.
| Name | Required | Description | Default |
|---|---|---|---|
| formula | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden. It discloses that the tool validates syntax and provides 'intelligent help on failure', which adds behavioral context about error responses. However, it doesn't mention other traits like performance characteristics, rate limits, or authentication needs. The description adds some value but leaves gaps for a tool with mutation-like validation behavior.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, well-constructed sentence that efficiently communicates the core functionality and error-handling behavior. Every word earns its place, with no redundancy or unnecessary elaboration. It's appropriately sized for a simple validation tool.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool has an output schema (which should document return values), the description doesn't need to explain outputs. However, with no annotations and incomplete parameter documentation, the description provides adequate but minimal context for a validation tool. It covers the 'what' and error behavior but lacks details on formula requirements or validation rules.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 0% description coverage, with only one parameter 'formula' of type string. The description doesn't add any parameter-specific semantics beyond the tool's overall purpose. It doesn't explain what constitutes a valid formula, expected format, or examples. With low schema coverage, the description fails to compensate adequately.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: 'Validates the syntax of a mathematical formula' with the specific verb 'validates' and resource 'mathematical formula'. It distinguishes from siblings like 'analyze_formula' (which might check semantics) and 'plot_math_function' (which visualizes), but doesn't explicitly name these alternatives. The addition of 'offering intelligent help on failure' adds useful context about error handling.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage context through 'validates the syntax' and 'on failure', suggesting it should be used to check formula correctness before further processing. However, it doesn't explicitly state when to use this vs. alternatives like 'analyze_formula' or provide clear exclusions. The guidance is present but not comprehensive.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
5 tool updates
- First observed
analyze_formula - First observed
hello - First observed
plot_math_function - First observed
plot_multiple_functions - First observed
validate_formula
TDQS
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
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
AI-callable calculators and engineering models with real formulas. No hallucinated math.
Precision math engine for AI agents. 203 exact methods. Zero hallucination.
Integrates Wolfram Language and Wolfram|Alpha accessing curated data and sophisticated algorithms.
Evaluate, simplify, and differentiate mathematical expressions.
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
- FlicenseNot 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.11-
- AlicenseNot gradedqualityDmaintenanceEnables mathematical computation via Wolfram Language/Mathematica integration, supporting calculations, equation solving, calculus, matrix operations, and symbolic mathematics.13MIT
- AlicenseNot gradedqualityDmaintenanceProvides 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.4MIT
Appeared in Searches
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/TheGrSun/Desmos-MCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server