MCP-Server-for-CFD
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., "@MCP-Server-for-CFDrun CFD analysis on NACA 0012 at 5° angle of attack"
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.
CFD FastAPI Server
將 2D 翼型空氣動力分析包裝成一般 FastAPI HTTP API,讓前端、腳本或其他服務可以直接呼叫完整的「幾何 → 網格 → 求解 → 後處理 → 視覺化」流程。
Client ──▶ FastAPI Server ──▶ aerosandbox / NeuralFoil / SU2
└─▶ Cp 分布 / 極曲線 / dashboard / artifact downloads功能
API | 功能 |
| 從 NACA 4/5 位數代碼生成翼型座標 ( |
| 生成 2D 網格,支援 placeholder 與 SU2/Gmsh |
| 執行 NeuralFoil,或提交非同步 SU2 求解 |
| 查詢 job 狀態;完成後回傳 CL / CD / CM / Cpmin / 轉捩點 |
| 一次完成 geometry -> mesh -> solver;SU2 只提交背景求解 |
| 生成視覺化 artifact metadata |
| 在瀏覽器 inline 預覽視覺化圖檔 |
| 下載視覺化圖檔 |
| Streamable HTTP MCP endpoint,提供同一套 CFD workflow tools |
視覺化模式
| 內容 |
| 翼型形狀 + 結果數字 |
| 沿翼型表面真 Cp 分布 |
| CL/CD vs alpha 雙軸極曲線 |
| CL vs CD 拖力極曲線 |
| 網格預覽圖 |
| 綜合 dashboard 與網格預覽 |
| 馬赫數分佈圖 (SU2) |
| 壓力分佈圖 (SU2) |
POST /api/visualizations 會回傳:
{
"status": "success",
"summary": "...",
"artifact": {
"artifact_id": "vis_abc123",
"filename": "dashboard_vis_abc123.jpg",
"mimeType": "image/jpeg",
"size_bytes": 170868
}
}圖檔不直接塞進 JSON body,而是落地成 artifact。用回傳的 artifact_id 組 GET /artifacts/{artifact_id} 在瀏覽器預覽,或組 GET /artifacts/{artifact_id}/download 下載。
HTTP API 只回傳資源 id,不回傳伺服器端檔案路徑。手動流程請依序傳遞 geometry_id、mesh_id、job_id、artifact_id。
SU2 求解是非同步工作。POST /api/solver/run 或 POST /api/workflow/airfoil 使用 solver_backend="su2" 時會回傳 status: "submitted" 與 job_id;之後用 GET /api/solver/results/{job_id} 輪詢,直到狀態變成 converged 或 failed。NeuralFoil surrogate 仍同步回傳結果。
Related MCP server: OpenVSP MCP Server
快速開始
環境需求
Python 3.11+
uv
本機啟動
uv sync
uv run python -m cfd_server啟動後可用:
Swagger UI:
http://localhost:8765/docsOpenAPI:
http://localhost:8765/openapi.jsonHealth check:
http://localhost:8765/healthzMCP endpoint:
http://localhost:8765/mcp/
執行測試
uv run --group dev pytestDocker
docker build -t cfd-server:su2-local .
docker run --rm -p 8765:8765 -v "$PWD/jobs:/app/jobs" cfd-server:su2-local檢查 SU2 與 Gmsh:
docker run --rm cfd-server:su2-local SU2_CFD --help
docker run --rm cfd-server:su2-local gmsh --versionDocker Compose
docker compose up --build cfd-serverAPI 範例
建立翼型
curl -X POST http://localhost:8765/api/geometry/airfoil \
-H "content-type: application/json" \
-d '{
"naca_code": "0012",
"chord_length": 1.0,
"n_points_per_side": 180,
"normalize_geometry": true
}'一鍵工作流
curl -X POST http://localhost:8765/api/workflow/airfoil \
-H "content-type: application/json" \
-d '{
"naca_code": "0012",
"velocity": 30.0,
"angle_of_attack": 5.0,
"solver_backend": "neuralfoil"
}'SU2 一鍵工作流會先產生 SU2/Gmsh mesh,然後提交背景求解:
curl -X POST http://localhost:8765/api/workflow/airfoil \
-H "content-type: application/json" \
-d '{
"naca_code": "0012",
"velocity": 30.0,
"angle_of_attack": 5.0,
"mesh_format": "su2",
"solver_backend": "su2",
"max_iterations": 500
}'查詢背景求解:
curl http://localhost:8765/api/solver/results/06936164e5a7視覺化
curl -X POST http://localhost:8765/api/visualizations \
-H "content-type: application/json" \
-d '{
"job_id": "06936164e5a7",
"plot_kind": "dashboard",
"image_format": "jpeg"
}'MCP
這個服務現在同時提供 Streamable HTTP MCP,直接重用現有 service layer,不需要另外維護第二套 CFD 邏輯。
MCP tools:
generate_airfoil_geometrygenerate_2d_meshrun_cfd_solvercheck_solver_resultsrun_airfoil_workflowvisualize_cfd_resultsget_visualization_artifact
本機啟動 HTTP + MCP:
uv run python -m cfd_server用 MCP Inspector 連線:
npx -y @modelcontextprotocol/inspector連到:
http://localhost:8765/mcp/如果你要用 stdio 模式直接跑 MCP server:
uv run python -m cfd_server.app.interfaces.mcp.server測試
tests/conftest.py: 共用 FastAPITestClient與 workflow fixturetests/test_http_workflow.py: 幾何、網格、求解、結果查詢、路由註冊tests/test_async_su2_solver.py: SU2 非同步提交與狀態轉換tests/test_visualization_artifacts.py: artifact metadata 與落地檔案tests/test_artifact_download.py: artifact HTTP download endpointtests/test_su2_config.py: SU2 config 單元測試
專案結構
cfd-server/
├── cfd_server/
│ ├── __main__.py
│ ├── app/
│ │ ├── interfaces/
│ │ │ └── http/ # FastAPI app, routers, request schemas
│ │ └── services/ # workflow / visualization service layer
│ ├── server.py # 相容 wrapper
│ ├── core/
│ ├── mesh/
│ ├── solvers/
│ ├── visualization/
│ └── models/
├── tests/
├── pyproject.toml
├── Dockerfile
└── README.mdThis server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
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/DaveFan-NCHC/MCP-Server-for-CFD'
If you have feedback or need assistance with the MCP directory API, please join our Discord server