loading…
Search for a command to run...
loading…
An MCP server that enables AI agents to interact with Nastran FEA models by reading, writing, and analyzing BDF and OP2 files. It provides tools for mesh qualit
An MCP server that enables AI agents to interact with Nastran FEA models by reading, writing, and analyzing BDF and OP2 files. It provides tools for mesh quality assessment, geometric analysis, and automated report generation for structural engineering workflows.
A Model Context Protocol (MCP) Server for pyNastran, built with FastMCP. Enables AI agents to interact with Nastran FEA models.
pip install pynastran-mcp
Or install from source:
git clone https://github.com/Shaoqigit/pynastran-mcp.git
cd pynastran-mcp
pip install -e .
For MCP clients like Cherry Studio, Claude Desktop:
pynastran-mcp
# Default: host=127.0.0.1, port=8080
pynastran-mcp --transport sse
# Custom host and port
pynastran-mcp --transport sse --host 0.0.0.0 --port 8080
# Default: host=127.0.0.1, port=8080
pynastran-mcp --transport streamable-http
# Custom host and port
pynastran-mcp --transport streamable-http --host 0.0.0.0 --port 8080
Add to your MCP client configuration:
{
"mcpServers": {
"pynastran": {
"command": "pynastran-mcp"
}
}
}
See CHERRY_STUDIO_TUTORIAL.md for detailed setup instructions.
| Tool | Description |
|---|---|
read_bdf |
Read BDF file and return model summary |
get_model_info |
Get detailed model information |
write_bdf |
Write model to new BDF file |
get_nodes |
Get node coordinates |
get_elements |
Get element connectivity |
get_materials |
Get material properties |
get_properties |
Get property definitions |
| Tool | Description |
|---|---|
read_op2 |
Read OP2 result file |
get_result_cases |
List available result cases |
get_stress |
Extract stress results |
get_displacement |
Extract displacement results |
| Tool | Description |
|---|---|
check_mesh_quality |
Check mesh quality metrics |
get_model_bounds |
Get model bounding box |
| Tool | Description |
|---|---|
generate_report |
Generate comprehensive analysis report |
Once configured, you can ask your AI assistant:
"Read the BDF file at /path/to/model.bdf and tell me about the mesh"
"Analyze the stress results from /path/to/results.op2"
"Check the mesh quality and suggest improvements"
"Generate a report for my Nastran model"
from pynastran_mcp.tools.bdf_tools import BdfTools
from pynastran_mcp.tools.op2_tools import Op2Tools
async def analyze_model():
# BDF Analysis
bdf_tools = BdfTools()
summary = await bdf_tools.read_bdf("wing.bdf")
print(summary)
# OP2 Results
op2_tools = Op2Tools()
stresses = await op2_tools.get_stress("results.op2", element_type="CQUAD4")
print(stresses)
pynastran-mcp/
├── pynastran_mcp/
│ ├── __init__.py
│ ├── server.py # FastMCP server with all tools
│ └── tools/
│ ├── __init__.py
│ ├── bdf_tools.py # BDF file operations
│ ├── op2_tools.py # OP2 result operations
│ ├── geometry_tools.py # Mesh quality checks
│ └── analysis_tools.py # Report generation
├── pyproject.toml
├── README.md
└── examples/
└── example_usage.py
# Setup
git clone https://github.com/Shaoqigit/pynastran-mcp.git
cd pynastran-mcp
pip install -e ".[dev]"
# Run tests
pytest
# Code formatting
black pynastran_mcp/
MIT License - see LICENSE file
Contributions are welcome! Please feel free to submit a Pull Request.
git checkout -b feature/amazing-feature)git commit -m 'Add some amazing feature')git push origin feature/amazing-feature)Please make sure to update tests as appropriate and follow the existing code style.
Добавь это в claude_desktop_config.json и перезапусти Claude Desktop.
{
"mcpServers": {
"pynastran-mcp-server": {
"command": "npx",
"args": []
}
}
}