GeoGebra MCP Server
A Model Context Protocol (MCP) server that provides access to GeoGebra's computation and drawing capabilities through a standardized interface.
Features
Computation Tools
eval_command: Execute GeoGebra commands
eval_command_cas: Computer Algebra System calculations
math_calculation: Mathematical expression evaluation
geometry_construction: Geometric constructions and property calculations
Drawing & Export Tools
export_png: Export constructions as PNG images
export_pdf: Export constructions as PDF documents
set_xml: Load constructions from XML
get_xml: Get current construction as XML
refresh_views: Refresh all views
Installation
Install dependencies:
Make the server executable:
Configuration
Add to your MCP client configuration (e.g., for Claude Code):
Usage Examples
Basic Math Calculation
CAS Calculation
Geometry Construction
Export Image
API Reference
eval_command
Execute a GeoGebra command.
Parameters:
command(string): GeoGebra command to execute
Example: "f(x)=x^2; Integral(f,0,1)"
eval_command_cas
Execute CAS command with precision control.
Parameters:
command(string): CAS commandrounding(string): Rounding precision (default: "2")
Example: "Solve(x^3 - 2x + 1 = 0, x)"
export_png
Export construction as PNG image.
Parameters:
exportScale(number): Scale factor (default: 1.0)transparent(boolean): Transparent background (default: false)dpi(number): Resolution (default: 300)greyscale(boolean): Greyscale output (default: false)
export_pdf
Export construction as PDF document.
Parameters:
scale(number): Scale factor (default: 1.0)filename(string): Output filenamedpi(number): Resolution (default: 72)
math_calculation
Evaluate mathematical expressions.
Parameters:
expression(string): Math expressionvariables(object): Variable values
Example:
geometry_construction
Create geometric constructions and get properties.
Parameters:
construction(string): Construction commandsproperties(array): Properties to calculate
Supported properties: area, perimeter, coordinates
Environment Variables
GEOGEBRA_BASE_URL: Base URL of GeoGebra server (default: http://localhost:3000)
Development
Project Structure
Adding New Tools
Define tool in
src/tools.jsAdd handler method in
src/index.jsImplement client method in
src/geogebra-client.js
Testing
Run the server directly:
License
MIT License