- Explore MCP Servers
- gmesh-mcp
Gmesh Mcp
What is Gmesh Mcp
gmesh-mcp is a system that enables Large Language Models (LLMs) to interact directly with Gmsh for computational mesh generation using natural language prompts.
Use cases
Use cases include generating tetrahedral meshes for geometrical shapes, refining meshes based on simulation results, and exporting meshes for use in various simulation software.
How to use
To use gmesh-mcp, clone the repository, install the dependencies, set up environment variables, and start the server. You can interact with the system through the command line interface (CLI) or API to generate meshes based on natural language descriptions.
Key features
Key features include a natural language interface for mesh generation, support for both API-based and local LLMs, real-time feedback and visualization of generated meshes, interactive refinement based on user feedback, support for various mesh types, and export capabilities for common simulation formats.
Where to use
gmesh-mcp can be used in fields such as computational physics, engineering simulations, and any area requiring finite element analysis and mesh generation.
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
Overview
What is Gmesh Mcp
gmesh-mcp is a system that enables Large Language Models (LLMs) to interact directly with Gmsh for computational mesh generation using natural language prompts.
Use cases
Use cases include generating tetrahedral meshes for geometrical shapes, refining meshes based on simulation results, and exporting meshes for use in various simulation software.
How to use
To use gmesh-mcp, clone the repository, install the dependencies, set up environment variables, and start the server. You can interact with the system through the command line interface (CLI) or API to generate meshes based on natural language descriptions.
Key features
Key features include a natural language interface for mesh generation, support for both API-based and local LLMs, real-time feedback and visualization of generated meshes, interactive refinement based on user feedback, support for various mesh types, and export capabilities for common simulation formats.
Where to use
gmesh-mcp can be used in fields such as computational physics, engineering simulations, and any area requiring finite element analysis and mesh generation.
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
Content
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
Dev Tools Supporting MCP
The following are the main code editors that support the Model Context Protocol. Click the link to visit the official website for more information.










