Ansys CFX-MCP
OfficialThe Ansys CFX-MCP server provides an MCP interface for AI assistants to manage Ansys CFX sessions, automate workflows, execute Python code, inspect model context, and generate code from natural language. Key capabilities include:
Session Management: Connect to, disconnect from, and check status of CFX (CFX-Pre, Solver, CFD-Post) backends.
Workflow Automation: Execute lifecycle actions (start pre, import mesh, write definition, run solver, retrieve results, open post) via a unified tool.
Model Context: Query compact summaries, list/find named objects, view state snippets, browse API help, and get allowed values.
Code Execution & Validation: Run Python in the PyCFX session with CFX helpers (
pre,solver,post); dry-run validation for syntax and semantics.AI-Assisted Code Generation: Generate CFX Python code from prompts, with clarification support for refinement.
Flexible Connectivity: Supports STDIO and Streamable HTTP transports.
Enables AI assistants to interact with Ansys CFX, supporting CFX-Pre, CFX Solver, and CFD-Post workflows for setup, execution, and postprocessing.
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., "@Ansys CFX-MCP Set up a CFX-Pre simulation for flow over a NACA 0012 airfoil"
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.
Ansys CFX-MCP
Ansys CFX-MCP (ansys-cfx-mcp) is a Model Context Protocol (MCP)
server that enables AI assistants to interact with Ansys CFX through
PyCFX. It enables
natural-language-assisted CFX-Pre, CFX Solver, and CFD-Post workflows for
setup, execution, and postprocessing.
It is built on PyAnsys Common MCP (ansys-common-mcp), the shared PyAnsys MCP foundation.
This package is self-contained and works as a standalone server for any MCP host. It exposes a compact CFX-oriented tool surface so you can connect to CFX sessions, inspect bounded model context, validate and run reviewed PyCFX snippets, and coordinate common solver and CFD-Post actions.
For quick-start, configuration, architecture, examples, and per-tool reference material, see the PyCFX-MCP documentation.
Overview
Ansys CFX-MCP is a stateless MCP leaf. MCP clients such as Visual Studio Code Copilot, Claude Desktop, Cursor, or a custom automation host call a focused set of tools to drive live CFX-Pre, CFD-Post, and CFX Solver sessions. Custom Python runs through a validated, Python-level restricted execution path. This is not an operating-system or container sandbox.
Key features:
CFX session management: Start or attach to CFX-Pre, CFX Solver, and CFD-Post workflows.
Workflow routing: Use one compact
cfx_workflowtool for common CFX lifecycle actions.Bounded model context: Inspect summaries, named objects, API help, allowed values, and selected state snippets without dumping entire models into an MCP client.
Validated execution: Run custom snippets in a persistent PyCFX execution context with strict AST validation, guarded imports, and limited built-in functions.
Flexible MCP transport: Run over STDIO for local clients or Streamable HTTP for trusted local integrations.
Related MCP server: Mechanical MCP Server
Tool surface
The default MCP surface includes seven tools:
Group | Tools |
Connection and session |
|
CFX workflow routing |
|
Bounded model context |
|
Code execution |
|
The server also exposes a toolsets://definition MCP resource for clients or
conductors that group related tools. The default CFX toolsets cover connection
management, CFX workflow routing, CFX model context, and code execution.
Requirements
Requirement | When needed | Notes |
Python 3.12 or later | Always | 3.12, 3.13 and 3.14 are supported |
Core runtime dependencies | Always (installed automatically) |
|
A licensed local Ansys CFX installation | To launch or attach CFX tools | Required for workflows that use CFX-Pre, CFX Solver, or CFD-Post |
PyCFX and Ansys CFX are required for live-session tools. Any tool that touches a CFX app (
connect,run_code,cfx_workflow,cfx_model_context, andsession_status) requiresansys-cfx-coreand a licensed CFX installation on your machine.
Installation
Install the latest release for users:
pip install ansys-cfx-mcpInstall the latest release for developers:
git clone https://github.com/ansys/pycfx-mcp.git
cd pycfx-mcp
pip install -e ".[dev,doc]"Usage
Run PyCFX-MCP over STDIO, the default transport for desktop MCP clients:
ansys-cfx-mcp --transport stdioOr, run PyCFX-MCP over Streamable HTTP:
ansys-cfx-mcp --transport http --host 127.0.0.1 --port 8000Use STDIO for desktop MCP clients that launch the server process. Use Streamable HTTP only on trusted networks or behind infrastructure that provides authentication and TLS.
Starting PyCFX-MCP only makes the tools available. You still need an MCP-compatible client, such as Visual Studio Code Copilot, Claude Desktop, Cursor, or another assistant host, to connect to PyCFX-MCP. For more information, see IDE and client configuration in the PyCFX-MCP documentation.
Configuration
The standalone server does not call a language model. Configure only the server
transport, logging, and backend options needed for your MCP client. Custom code
authoring belongs in the MCP host or a higher-level agent layer; PyCFX-MCP
validates and runs reviewed Python through validate_code and run_code.
For transport settings, see Configuration in the PyCFX-MCP documentation.
License
This project is licensed under the Apache License, Version 2.0. See the LICENSE file for details.
Resources
For general PyAnsys questions, email pyansys.core@ansys.com.
Available Tools
7 toolscfx_model_contextA
Return a targeted, compact CFX model context slice. Actions: summary, list_named_objects, find_named_object, select_named_objects, state, api_help, find_api, allowed_values, targeted_context. Use max_items to keep responses small.
Inputs: action, params, max_items. Returns: object
cfx_workflowA
Run one focused CFX lifecycle or artifact action. Actions: start_pre, import_mesh, write_def, start_solver, wait_solver, get_results_file, open_post, status. Use the external agent layer for custom PyCFX code generation.
Inputs: action (required), params. Returns: object
connectA
Connect the cfx leaf to a backend. Available backend kinds: ['pycfx']. Pass backend_kind to choose, or omit it to auto-select. Backend-specific options (url/token/ip/port/...) go in connect_kwargs as a dict and are forwarded to the backend.
Inputs: backend_kind, connect_kwargs. Returns: Result returned by the connection tool.
disconnectA
Disconnect the cfx leaf's active backend.
Inputs: no named parameters. Returns: object
run_codeA
Execute Python code against the active PyCFX session namespace. The code runs with pre, solver, post, session, cfxpre, cfxsolver, and cfxpost helpers refreshed from the current CFX sessions. Returns stdout, stderr, and any __return__ value. Prefer cfx_workflow or cfx_model_context for routed actions and read-only queries.
Inputs: code (required).
session_statusA
Report whether the cfx leaf has an active backend. Safe to call before connect. Returns the connected endpoint, backend kind, and the list of tools available in the current state.
Inputs: no named parameters. Returns: Result of `session_status` - safe to call before `connect`.
validate_codeA
Dry-run / validate CFX Python without applying side effects. Returns parse / type / semantic feedback.
Inputs: code (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Most tools have clearly distinct roles: connection lifecycle (connect/disconnect/session_status), code execution/validation (run_code/validate_code), workflow actions, and model context queries. The main potential confusion is between run_code and cfx_workflow, since cfx_workflow actions could also be performed via custom Python, but the descriptions provide enough routing guidance to separate them.
Tool names mostly follow a clean snake_case pattern with imperative verbs (connect, disconnect, run_code, validate_code). session_status and cfx_workflow/cfx_model_context are more noun-like, but overall the naming is consistent enough and predictable across the set.
Seven tools is a well-scoped size for this server's purpose. Each tool covers a distinct functional layer: backend connection, live code execution, validation, high-level workflow control, and model introspection, without redundancy or bloat.
The tool surface covers the main CFX interaction lifecycle: connect, run custom code, validate, drive workflows, and inspect model context. run_code provides an escape hatch for arbitrary PyCFX operations, though a few high-level conveniences like explicit solver output retrieval or session list/close operations are absent, which is a minor gap.
Maintenance
Related MCP Connectors
MCP server unifying ERPs, CRMs, APIs and knowledge base for Claude, ChatGPT and Gemini.
MCP server for building and testing AI agents with multi-model experimentation and insights.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
One MCP server for the services your AI needs: memory, files, Microsoft 365, kanban and more.
Related MCP Servers
- AlicenseBqualityDmaintenanceMCP Server for COMSOL Multiphysics simulation automation via AI agents.782MIT
- AlicenseBqualityCmaintenanceEnables natural language interaction with ANSYS Mechanical simulation software via gRPC, allowing users to manage geometry, mesh, boundary conditions, solve analyses, and generate reports through MCP-compatible AI clients.3720Apache 2.0
- AlicenseNot gradedqualityAmaintenanceAutomates OpenFOAM CFD simulations via MCP, enabling AI agents to mesh, run, and post-process cases from natural language prompts without any API keys.MIT
- FlicenseNot gradedqualityDmaintenanceMCP server for automating ANSYS HFSS simulations, enabling persistent connections, modeling, simulation setup, and S-parameter extraction through AI assistants.1-