Run Python Script
run_python_scriptExecute a PyAEDT script file with CPython asynchronously without opening a terminal, using the connected AEDT session and writing output and errors to a log file.
Instructions
Launch a PyAEDT script file with CPython without opening a terminal.
The script runs asynchronously using the MCP server's Python interpreter and inherits the connected AEDT session through the same environment variables used by the PyAEDT script launcher. Scripts must use PyAEDT; native globals such as oDesktop, oProject, and oDesign are not injected. Standard output and errors are written to the returned log file.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"script_path": "<script_path>"
},
"name": "run_python_script"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| script_path | Yes | Path to the Python script file to execute. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |