GGB Web MCP
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., "@GGB Web MCPplot y = sin(x) from 0 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.
GGB Web MCP
GeoGebra MCP 服务器 - 通过 Model Context Protocol 让 AI 与 GeoGebra 数学可视化软件交互。
功能特性
MCP 协议支持 - 完整的 Model Context Protocol 实现,支持 stdio 和 HTTP/SSE 两种传输方式
实时 Web 可视化 - 内置 Web 服务器,通过浏览器实时查看数学构造
丰富的数学工具 - 25+ GeoGebra 工具,涵盖几何、函数、代数运算
教育模板 - 预置教育场景模板,快速创建课堂演示
多实例协调 - 智能锁文件机制,多个 MCP 实例共享同一 Web 服务器
Related MCP server: Mathematical-Visualization
快速开始
1. 安装依赖
git clone git@github.com:kms9/ggb-web-mcp.git
cd ggb-web-mcp
npm install2. 构建项目
npm run build3. 启动服务
npm start服务启动后:
MCP 服务器: 通过 stdin/stdout 与 AI 客户端通信
Web 可视化: 访问 http://localhost:3000 查看实时数学构造
配置 AI 客户端
Claude Desktop
编辑 ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"geogebra": {
"command": "node",
"args": ["/path/to/ggb-web-mcp/dist/cli.js"]
}
}
}Cursor IDE
在 Cursor 设置中添加 MCP 服务器配置:
{
"mcp": {
"servers": {
"geogebra": {
"command": "node",
"args": ["/path/to/ggb-web-mcp/dist/cli.js"]
}
}
}
}CLI 命令
# 启动 MCP 服务器
npm start
# 开发模式(热重载)
npm run dev
# 查看帮助
node dist/cli.js --help
# 设置日志级别
node dist/cli.js --log-level debug
# 指定端口
node dist/cli.js --port 3001命令行参数
参数 | 说明 | 默认值 |
| 显示帮助信息 | - |
| 显示版本号 | - |
| 日志级别 (error, warn, info, debug) | info |
| Web 服务器端口 | 3000 |
HTTP API 端点
Web 服务器提供以下 HTTP API:
MCP 端点
端点 | 方法 | 说明 |
| GET | SSE 连接,接收服务器推送消息 |
| POST | 发送 JSON-RPC 请求 |
| GET | 获取可用工具列表 |
| POST | 执行指定工具 |
| GET | 获取服务器信息 |
GeoGebra API
端点 | 方法 | 说明 |
| GET | 获取当前构造状态 |
| POST | 清空当前构造 |
| POST | 执行 GeoGebra 命令 |
示例请求
# 获取工具列表
curl http://localhost:3000/mcp/tools
# 创建一个点
curl -X POST http://localhost:3000/mcp/tools/geogebra_create_point \
-H "Content-Type: application/json" \
-d '{"name": "A", "x": 1, "y": 2}'
# 执行 GeoGebra 命令
curl -X POST http://localhost:3000/api/geogebra/command \
-H "Content-Type: application/json" \
-d '{"command": "Circle(A, 3)"}'可用工具
基础工具
工具名 | 说明 |
| 执行任意 GeoGebra 命令 |
| 获取所有对象信息 |
| 清空当前构造 |
| 导出 PNG 图片 |
| 导出 SVG 图片 |
几何工具
工具名 | 说明 |
| 创建点 |
| 创建直线(两点) |
| 创建直线(方程) |
| 创建圆 |
| 创建多边形 |
函数工具
工具名 | 说明 |
| 绘制函数图像 |
| 绘制参数方程 |
| 绘制隐函数 |
| 绘制不等式区域 |
代数工具
工具名 | 说明 |
| 求解方程 |
| 求解方程组 |
| 化简表达式 |
| 展开表达式 |
| 因式分解 |
| 求导数 |
| 求积分 |
动画工具
工具名 | 说明 |
| 创建滑块 |
| 启动/停止动画 |
| 设置动画速度 |
教育工具
工具名 | 说明 |
| 列出教育模板 |
| 从模板创建构造 |
环境配置
创建 .env 文件(可选):
# 服务器配置
PORT=3000
LOG_LEVEL=info
NODE_ENV=development
# GeoGebra 配置
GEOGEBRA_APP_NAME=classic
GEOGEBRA_WIDTH=800
GEOGEBRA_HEIGHT=600
GEOGEBRA_HEADLESS=true
# 性能配置
INSTANCE_POOL_SIZE=2
RESPONSE_TIMEOUT=30000配置说明
变量 | 说明 | 默认值 |
| Web 服务器端口 | 3000 |
| 日志级别 | info |
| 无头模式(不显示浏览器窗口) | true |
| GeoGebra 实例池大小 | 2 |
开发指南
项目结构
ggb-web-mcp/
├── src/
│ ├── cli.ts # CLI 入口
│ ├── index.ts # 主入口
│ ├── server.ts # MCP 服务器
│ ├── tools/ # 工具定义
│ │ ├── geogebra-tools.ts
│ │ ├── educational-templates.ts
│ │ └── performance-tools.ts
│ ├── types/ # 类型定义
│ ├── utils/ # 工具函数
│ └── web/ # Web 服务器
│ └── server.ts
├── tests/ # 测试文件
├── examples/ # 使用示例
└── docs/ # 文档常用脚本
# 开发模式
npm run dev
# 构建
npm run build
# 运行测试
npm test
# 测试覆盖率
npm run test:coverage
# 代码检查
npm run lint
# 清理构建产物
npm run clean添加新工具
在
src/tools/geogebra-tools.ts中定义工具:
{
tool: {
name: 'geogebra_my_tool',
description: '工具描述',
inputSchema: {
type: 'object',
properties: {
param1: { type: 'string', description: '参数说明' }
},
required: ['param1']
}
},
handler: async (params) => {
// 实现逻辑
return {
content: [{ type: 'text', text: JSON.stringify(result) }]
};
}
}工具会自动注册到工具注册表中
系统要求
Node.js >= 18.0.0
npm 或 yarn
许可证
MIT License
相关链接
This server cannot be deployed
Maintenance
Related MCP Connectors
Educational MCP server with 17 math/stats tools, visualizations, and persistent workspace
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
This MCP server enables users to perform scientific computations regarding linear algebra and vect…
A Model Context Protocol server for Wix AI tools
Related MCP Servers
- AlicenseBqualityDmaintenanceAn MCP server that enables AI models to generate precise geometric images by providing Asymptote code, supporting both SVG and PNG output formats.118 npm6ISC
- AlicenseNot gradedqualityDmaintenanceThe MCP protocol server based on JSXGraph provides 13 mathematical visualization tools suitable for educational mathematics, engineering, and scientific applications.3Apache 2.0
- 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 gradedqualityDmaintenanceMCP server for scientific computing with multiple backends (Mathematica, Octave, Python, R, SageMath, etc.) enabling mathematical computation and visualization through AI coding assistants.5-