Metadata-Version: 2.4
Name: ansys-common-mcp
Version: 0.3.0
Summary: Common Model Context Protocol (MCP) server for PyAnsys libraries
Keywords: ansys,mcp,model-context-protocol,ai,assistant
Author-email: "ANSYS, Inc." <pyansys.core@ansys.com>
Maintainer-email: "ANSYS, Inc." <pyansys.core@ansys.com>
Requires-Python: >=3.10,<4
Description-Content-Type: text/markdown
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Software Development :: Libraries :: Python Modules
License-File: LICENSE
Requires-Dist: mcp>=0.1.0
Requires-Dist: fastmcp>=0.1.0
Requires-Dist: Sphinx==8.2.3 ; extra == "doc"
Requires-Dist: ansys-sphinx-theme[autoapi, changelog]==1.7.2 ; extra == "doc"
Requires-Dist: build>= 0.10.0 ; extra == "doc"
Requires-Dist: flit>=3.8.0 ; extra == "doc"
Requires-Dist: inflect==7.5.0 ; extra == "doc"
Requires-Dist: jupyter_sphinx==0.5.3 ; extra == "doc"
Requires-Dist: numpy==2.2.6 ; extra == "doc"
Requires-Dist: numpydoc==1.10.0 ; extra == "doc"
Requires-Dist: pandas==2.3.3 ; extra == "doc"
Requires-Dist: parse==1.21.1 ; extra == "doc"
Requires-Dist: pypandoc==1.17 ; extra == "doc"
Requires-Dist: pytest-sphinx==0.7.1 ; extra == "doc"
Requires-Dist: regex==2026.4.4 ; extra == "doc"
Requires-Dist: sphinx-autobuild==2024.10.3 ; extra == "doc"
Requires-Dist: sphinx-autodoc-typehints==3.2.0 ; extra == "doc"
Requires-Dist: sphinx-copybutton==0.5.2 ; extra == "doc"
Requires-Dist: sphinx-notfound-page==1.1.0 ; extra == "doc"
Requires-Dist: sphinx-gallery==0.20.0 ; extra == "doc"
Requires-Dist: sphinxcontrib-mermaid>=0.9.2 ; extra == "doc"
Requires-Dist: pytest==9.0.3 ; extra == "tests"
Requires-Dist: pytest-asyncio==1.3.0 ; extra == "tests"
Requires-Dist: pytest-cov==7.1.0 ; extra == "tests"
Requires-Dist: pytest-mock==3.15.1 ; extra == "tests"
Requires-Dist: mcp==1.27.0 ; extra == "tests"
Requires-Dist: fastmcp==3.2.4 ; extra == "tests"
Project-URL: Documentation, https://github.com/ansys/pyansys-common-mcp#readme
Project-URL: Homepage, https://github.com/ansys/pyansys-common-mcp
Project-URL: Issues, https://github.com/ansys/pyansys-common-mcp/issues
Project-URL: Repository, https://github.com/ansys/pyansys-common-mcp
Provides-Extra: doc
Provides-Extra: tests

# PyAnsys Common MCP

[![PyAnsys](https://img.shields.io/badge/Py-Ansys-ffc107.svg?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAABDklEQVQ4jWNgoDfg5+OQgMJ/0AqCqXGQMEBAwBEKQj5gGDjQsA80UeCDscxrD4YhGsgABEELnC5zAwAu6ADCKQDAQzNBFwAAVdgFEAnfDiQAATyIBaAFgCbkAI5DQwAVGAYkAMA4gHgg2AC+AAgQIABggagAqyAD4AF0MaB8gCbgoEAL0MEYRz4WxpMdWFzQBYKhK8DjEYH9KDgAw9ACAAgwFCgC2AMJvgAAJv+LQQJwJ8AAKQEoAAxr7W4AG/wGqAB4AACkR7cEdcEBQOPjIvAEtRDoAbYLANQAZGsBEAFeBwCsAY0HgGCAAEQTaDj7xQAABItJ+S3DsQAAAABJRU5ErkJggg==)](https://docs.pyansys.com/)
[![Python](https://img.shields.io/badge/Python-3.10%2B-blue)](https://www.python.org/)
[![Apache](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)

PyAnsys Common MCP provides the infrastructure for building [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) 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.10 through
Python 3.14 on Windows, Mac OS, and Linux.

Install the latest package for use with this command:

```bash
pip install ansys-common-mcp
```

Alternatively, install the latest
[PyAnsys Common MCP GitHub](https://github.com/ansys/pyansys-common-mcp) package
with this command:

```bash
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:

```bash
# 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:

1. **Define your custom context**: Extend the `PyAnsysBaseAppContext` dataclass to store the product-specific state.
2. **Implement your MCP server**: Extend the `PyAnsysBaseMCP` base class with startup and cleanup logic.
3. **Create MCP tools**: Define tools that interact with your product.

## Real-world example

For a complete, production-ready implementation, see the [PyMAPDL-MCP](https://github.com/ansys/pymapdl-mcp) repository.

## Resources

- [PyAnsys Common MCP documentation](https://common-mcp.docs.pyansys.com)
- [Repository's Issues page](https://github.com/ansys/pyansys-common-mcp/issues)
- [Repository's Discussion page](https://github.com/ansys/pyansys-common-mcp/discussions)

For general PyAnsys questions, email pyansys.core@ansys.com.

