Skip to main content
Glama
README.md
# gsa-mcp

Python MCP server for [Oasys GSA COM API](https://docs.oasys-software.com/structural/gsa/references/comautomation/), designed for Windows machines with GSA installed.

## Requirements

- Windows (GSA COM automation is Windows-only)
- Oasys GSA installed locally
- Python 3.11+
- [uv](https://docs.astral.sh/uv/)

## Setup (uv)

```bash
uv sync
```

Run lint, type-check, and tests:

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

## Run MCP server

Stdio (recommended for local Cursor integration):

```bash
uv run gsa-mcp
```

or:

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

## Cursor MCP configuration

Add an MCP server entry in your Cursor MCP config:

```json
{
  "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:

```json
{
  "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:

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

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 issues