
PyAnsys 公共 MCP
概览
PyAnsys Common MCP 为构建 PyAnsys 库的模型上下文协议(MCP)服务器提供了基础设施。 该软件包为创建MCP服务器奠定了基础,使AI助手(如Claude、ChatGPT)能够通过PyAnsys库与Ansys产品交互。 - : 维护多个 AI 请求间的有状态代码执行。- : 自动处理启动、清理和错误。- : 使用基于产品的特定实现的基类和模式。- : 使用不干扰 MCP 协议的预配置日志。 ansys.common.mcp 包目前支持 Windows、Mac OS 和 Linux 上的 Python 3.12 至 Python 3.14。
概述(AI 翻译)
PyAnsys Common MCP 为构建 PyAnsys 库的模型上下文协议(MCP)服务器提供了基础设施。
概述
该软件包为创建MCP服务器奠定了基础,使AI助手(如Claude、ChatGPT)能够通过PyAnsys库与Ansys产品交互。
主要功能:
- 持久的Python会话:在多个AI请求中维护有状态的代码执行。
- 生命周期管理:自动处理启动、清理和错误。
- 可扩展架构:使用基类和模式进行产品特定实现。
- 日志基础设施:使用预配置的日志,不干扰MCP协议。
安装
用户
‘ansys.common.mcp’ 包目前支持 Python 3.12 版本
在Windows、Mac OS和Linux上的Python 3.14。
安装最新的软件包,使用以下命令:
或者,安装最新的 PyAnsys Common MCP GitHub 包 使用以下命令:
开发者
如果你正在为 PyAnsys Common MCP 贡献或创建自定义服务器,请以开发者模式安装该软件包:
快速开始
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
PyAnsys Common MCP
PyAnsys Common MCP provides the infrastructure for building Model Context Protocol (MCP) servers for PyAnsys libraries.
Overview
This package provides the foundation for creating MCP servers that enable AI assistants (like Claude, ChatGPT) to interact with Ansys products through PyAnsys libraries.
Key features:
- Persistent Python sessions: Maintains stateful code execution across multiple AI requests.
- Lifecycle management: Handles startup, cleanup, and errors automatically.
- Extensible architecture: Uses base classes and patterns for product-specific implementations.
- Logging infrastructure: Uses pre-configured logging that does not interfere with the MCP protocol.
Installation
For users
The ansys.common.mcp package currently supports Python 3.12 through
Python 3.14 on Windows, Mac OS, and Linux.
Install the latest package for use with this command:
pip install ansys-common-mcp
Alternatively, install the latest PyAnsys Common MCP GitHub package with this command:
pip install git+https://github.com/ansys/pyansys-common-mcp.git
For developers
If you are contributing to PyAnsys Common MCP or creating custom servers, install the package in developer mode:
# Clone the repository
git clone https://github.com/ansys/pyansys-common-mcp.git
cd pyansys-common-mcp
# Install in editable mode with development dependencies
pip install -e .[dev]
# Or install documentation dependencies for building documentation
pip install -e .[doc]
Quick start
To create an MCP server for your PyAnsys library, follow these three main steps:
- Define your custom context: Extend the
PyAnsysBaseAppContextdataclass to store the product-specific state. - Implement your MCP server: Extend the
PyAnsysBaseMCPbase class with startup and cleanup logic. - Create MCP tools: Define tools that interact with your product.
Real-world example
For a complete, production-ready implementation, see the PyMAPDL-MCP repository.
Resources
安装
This server does not publish a one-line install command.
Open the repository installation guide 新手?先看 mcpskill.org 教程 →