
gmesh mcp
通过自然语言与Gmsh交互生成计算网格的系统,支持多种LLM和导出格式。
Repository Info
About This Server
通过自然语言与Gmsh交互生成计算网格的系统,支持多种LLM和导出格式。
Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.
Documentation
Gmsh Model Context Protocol (MCP)
A system that enables Large Language Models (LLMs) to interact directly with Gmsh for computational mesh generation through natural language prompts.
Overview
This project implements a Model Context Protocol (MCP) system for Gmsh, a finite element mesh generator. It allows users to describe mesh requirements in natural language, which are then interpreted by an LLM to generate appropriate Gmsh commands. The system supports both API-based LLMs (like OpenAI's GPT and Anthropic's Claude) and local LLMs via Ollama.
Features
- Natural language interface for mesh generation
- Support for both API-based LLMs and local LLMs via Ollama
- Real-time feedback and visualization of generated meshes
- Interactive refinement of meshes based on user feedback
- Support for various mesh types and configurations
- Export capabilities for common simulation formats
Installation
-
Clone this repository:
git clone https://github.com/rishabh10gpt/gmesh-mcp.git cd gmesh-mcp -
Install dependencies:
pip install -r requirements.txt -
Set up environment variables:
cp .env.example .envThen edit
.envto add your API keys if using cloud-based LLMs.
Usage
Starting the server
python -m src.server.main
Using the CLI
python -m src.cli.main "Create a tetrahedral mesh for a sphere with radius 1 and maximum element size 0.1"
Using the API
from gmesh_mcp import MeshGenerator
generator = MeshGenerator(llm_provider="openai") # or "anthropic", "ollama"
mesh = generator.generate("Create a tetrahedral mesh for a sphere with radius 1")
mesh.visualize()
mesh.export("sphere.msh")
Architecture
The system consists of several components:
- LLM Interface: Handles communication with different LLM providers
- Gmsh Controller: Manages Gmsh operations through its Python API
- Server: Provides a web interface and API endpoints
- Feedback System: Processes mesh statistics and visualization for iterative refinement
Examples
See the examples/ directory for sample use cases and demonstrations.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgements
- Built on the powerful Gmsh open-source mesh generator
- Leverages advancements in LLMs for natural language understanding
Quick Start
Clone the repository
git clone https://github.com/rishabh10gpt/gmesh-mcpInstall dependencies
cd gmesh-mcp
npm installFollow the documentation
Check the repository's README.md file for specific installation and usage instructions.
Repository Details
Recommended MCP Servers
Discord MCP
Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.
Knit MCP
Connect AI agents to 200+ SaaS applications and automate workflows.
Apify MCP Server
Deploy and interact with Apify actors for web scraping and data extraction.
BrowserStack MCP
BrowserStack MCP Server for automated testing across multiple browsers.
Zapier MCP
A Zapier server that provides automation capabilities for various apps.