Skip to main content
Glama

gsa-mcp

Python MCP server for Oasys GSA COM API, designed for Windows machines with GSA installed.

Requirements

  • Windows (GSA COM automation is Windows-only)

  • Oasys GSA installed locally

  • Python 3.11+

  • uv

Related MCP server: solidworks-mcp

Setup (uv)

uv sync

Run lint, type-check, and tests:

uv run ruff check .
uv run mypy src
uv run pytest

Run MCP server

Stdio (recommended for local Cursor integration):

uv run gsa-mcp

or:

uv run python -m gsa_mcp.server --transport stdio

Cursor MCP configuration

Add an MCP server entry in your Cursor MCP config:

{
  "mcpServers": {
    "gsa-com": {
      "command": "uv",
      "args": ["run", "gsa-mcp"],
      "cwd": "C:\\path\\to\\gsa-mcp"
    }
  }
}

Tool coverage (v1)

The server exposes a broad surface of GSA COM families:

  • Core model lifecycle and analysis (Open, SaveAs, Analyse, Delete, ...)

  • Data/list and case/task helpers

  • Output extraction (Output_Init, Output_Extract, array variants)

  • View operations (print/save views, create/rescale views, template-based setters)

  • Raw GwaCommand and utility helpers (SetLocale, Arg, ExportToCsv, sID helpers)

All tools return a normalized payload:

{
  "ok": true,
  "status": 0,
  "data": {},
  "message": "OK"
}

Important behavior notes

  • COM function names are case-sensitive.

  • GwaCommand is powerful and can modify model data directly; validate commands before use.

  • If GSA is already open interactively, COM automation may be unstable (as documented by Oasys).

Windows smoke test

Run a basic real-COM connectivity test:

uv run python scripts/smoke_windows.py

Project layout

  • src/gsa_mcp/server.py: MCP entrypoint and health tool

  • src/gsa_mcp/com_client.py: COM connection/invocation wrapper

  • src/gsa_mcp/tools/: grouped MCP tool registrations

  • tests/: mocked unit tests (no GSA install required)

  • scripts/smoke_windows.py: Windows-only runtime smoke test

Available Tools

69 tools
gsa_analyseB

Analyse a task, or all tasks when task <= 0.

Inputs: task. Returns: object

gsa_argC

Return argument string at zero-based index.

Inputs: line (required), index (required). Returns: object

gsa_case_existC

Check if case exists.

Inputs: caseop (required), case_id (required). Returns: object

gsa_case_nameD

Get case name.

Inputs: caseop (required), case_id (required). Returns: object

gsa_case_num_permC

Get number of permutations for case.

Inputs: caseop (required), case_id (required). Returns: object

gsa_case_perm_anal_factorC

Get analysis factor for a case permutation.

Inputs: perm (required), caseop (required), analref (required), case_id (required). Returns: object

gsa_case_perm_descC

Get case permutation description.

Inputs: perm (required), caseop (required), case_id (required). Returns: object

gsa_case_perm_stringD

Get case permutation string.

Inputs: perm (required), caseop (required), case_id (required). Returns: object

gsa_case_results_existC

Check if results exist for case/permutation.

Inputs: caseop (required), case_id (required), perm. Returns: object

gsa_case_taskC

Return parent analysis task for analysis case.

Inputs: case_id (required). Returns: object

gsa_closeB

Close current GSA model.

Inputs: no named parameters. Returns: object

gsa_create_elements_from_membersC

Create or recreate elements from members list.

Inputs: member_list. Returns: object

gsa_create_new_viewC

Create a new saved graphic view.

Inputs: name (required). Returns: object

gsa_deleteD

Delete results based on option string.

Inputs: option. Returns: object

gsa_designD

Run design task with design option enum value.

Inputs: task (required), option (required). Returns: object

gsa_design_task_statusD

Return design task status.

Inputs: task_id (required). Returns: object

gsa_display_windowB

Show or hide GSA main window.

Inputs: display (required). Returns: object

gsa_elem_memb_numC

Return member id associated with element.

Inputs: element_id (required). Returns: object

gsa_entities_in_listC

Resolve list expression to entities.

Inputs: lst (required), list_type (required). Returns: object

gsa_export_to_csvC

Export model and results tables as CSV files.

Inputs: pathname (required), delimiter, num_point, combinations, +1 more. Returns: object

gsa_gen_node_atC

Create/find node at coordinate.

Inputs: x (required), y (required), z (required), tol. Returns: object

gsa_get_sid_tag_valueC

Read sid value for module record+tag.

Inputs: key (required), tag (required), record (required). Returns: object

gsa_gwa_commandC

Execute raw GWA command string.

Inputs: command (required). Returns: object

gsa_healthA

Health check: validates COM availability and returns version.

Inputs: no named parameters. Returns: object

gsa_highest_caseC

Return highest case for case type L/A/C.

Inputs: caseop (required). Returns: object

gsa_highest_viewC

Return highest numbered view for option.

Inputs: option (required). Returns: object

gsa_is_item_includedC

Check if item is in list expression.

Inputs: option (required), item_id (required), list_expr (required). Returns: object

gsa_memb_elem_numC

Return element id for member+index.

Inputs: index (required), member_id (required). Returns: object

gsa_memb_num_elemC

Return number of elements for member.

Inputs: member_id (required). Returns: object

gsa_new_fileC

Open a new GSA model.

Inputs: no named parameters. Returns: object

gsa_node_connected_entC

Return connected entity references for a node.

Inputs: node_ref (required), entity_type (required). Returns: object

gsa_node_coorB

Return node coordinates for a node reference.

Inputs: node_id (required). Returns: object

gsa_num_argC

Return number of arguments in a comma-separated line.

Inputs: line (required). Returns: object

gsa_openC

Open GWB/GWA/CSV file.

Inputs: filename (required). Returns: object

gsa_output_1d_elem_posC

Return normalized 1D position for index.

Inputs: pos (required). Returns: object

gsa_output_data_existC

Check if initialized output data exists for id.

Inputs: entity_id (required). Returns: object

gsa_output_data_titleC

Return title for initialized output data reference.

Inputs: flags. Returns: object

gsa_output_extractC

Extract initialized output value for entity and position.

Inputs: entity_id (required), pos. Returns: object

gsa_output_extract_arrC

Extract array output data for entity.

Inputs: entity_id (required). Returns: object

gsa_output_extract_cur_permB

Get envelope permutation of last Output_Extract result.

Inputs: no named parameters. Returns: object

gsa_output_extract_cut_assemblyC

Extract cut assembly forces/displacements.

Inputs: axis (required), case (required), disp (required), assembly_ref (required), +1 more. Returns: object

gsa_output_initD

Initialize output API.

Inputs: axis (required), case (required), flags (required), dataref (required), +1 more. Returns: object

gsa_output_init_arrD

Initialize array output API.

Inputs: axis (required), case (required), flags (required), header (required), +1 more. Returns: object

gsa_output_is_datarefC

Check dataref characteristics from Output_Init.

Inputs: flags (required). Returns: object

gsa_output_num_elem_posC

Return number of element/member result positions.

Inputs: entity_id (required). Returns: object

gsa_output_set_stageD

Set output stage.

Inputs: stage. Returns: object

gsa_output_unit_factorB

Return SI-to-model unit conversion factor.

Inputs: no named parameters. Returns: object

gsa_output_unit_stringA

Return units string from Output_Init context.

Inputs: no named parameters. Returns: object

gsa_print_viewC

Print graphics/output view(s).

Inputs: option (required). Returns: object

gsa_rescale_view_dataC

Rescale contour/diagram data extents for view.

Inputs: view_id (required). Returns: object

gsa_rescale_view_to_fitC

Scale view extents to fit.

Inputs: view_id (required). Returns: object

gsa_saveB

Save current model to default path.

Inputs: no named parameters. Returns: object

gsa_save_asC

Save current model to the supplied path.

Inputs: filename (required). Returns: object

gsa_save_view_to_fileD

Save graphics/output view(s) to file.

Inputs: option (required), filetype (required). Returns: object

gsa_set_localeC

Set locale for GwaCommand parsing.

Inputs: locale (required). Returns: object

gsa_set_view_base_settingsC

Apply base settings from template GWA record.

Inputs: view_id (required), saved_view_gwa (required). Returns: object

gsa_set_view_contourC

Apply contour settings and output dataref to view.

Inputs: dataref (required), view_id (required), saved_view_gwa (required). Returns: object

gsa_set_view_diagramC

Apply diagram settings and output dataref to view.

Inputs: dataref (required), view_id (required), saved_view_gwa (required). Returns: object

gsa_set_view_labelsC

Apply label settings from template GWA record.

Inputs: view_id (required), saved_view_gwa (required). Returns: object

gsa_task_statusC

Return analysis task status.

Inputs: task_id (required). Returns: object

gsa_tool_get_ent_lengthC

Return entity length by id and entity enum type.

Inputs: entity_id (required), entity_type (required). Returns: object

gsa_tool_reset_member_sectionsC

Sync member sections from elements.

Inputs: no named parameters. Returns: object

gsa_tool_update_elem_sectionsC

Sync element sections from members.

Inputs: no named parameters. Returns: object

gsa_update_viewsB

Refresh all visible GSA views.

Inputs: no named parameters. Returns: object

gsa_version_stringB

Return GSA version string.

Inputs: no named parameters. Returns: object

gsa_view_existC

Return whether view exists.

Inputs: ref (required), option (required). Returns: object

gsa_view_nameC

Return view name from option/ref.

Inputs: ref (required), option (required). Returns: object

gsa_view_ref_from_nameC

Return view reference from name.

Inputs: name (required), option (required). Returns: object

gsa_write_sid_tag_valueC

Write sid tag/value for a module record.

Inputs: key (required), tag (required), value (required), record (required). Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    C2.2/5.0

    Scored across 69 tools

    Disambiguation3/5

    Most tools target distinct GSA operations, but several names are easily confused: gsa_memb_num_elem vs gsa_memb_elem_num, gsa_output_init vs gsa_output_init_arr, and the three extract variants. Descriptions help, but the volume of similar-sounding case/permutation/output tools creates overlap risk.

    Naming Consistency4/5

    All tool names use a consistent snake_case with gsa_ prefix, but the pattern is not purely verb_noun: some insert 'tool_' (gsa_tool_update_elem_sections), some start with nouns (gsa_case_exist), and abbreviations (memb, elem, ent) are mixed. Still, no camelCase or arbitrary style breaks.

    Tool Count1/5

    69 tools is far beyond the 3–15 range for a well-scoped MCP server and falls into the 'extreme mismatch' category. While GSA is a complex API, exposing this many low-level wrappers creates an unmanageable surface for an agent.

    Completeness3/5

    The surface covers file open/save, analysis, output extraction, and view control, but is missing high-level model creation/editing (properties, loads, supports, members) beyond a few node/element helpers. The raw gsa_gwa_command provides an escape hatch, but the lack of structured CRUD for core model entities is a notable gap.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers