Skip to content

Add model port and model port block connection tools - #41

Open
adokodS wants to merge 9 commits into
mainfrom
feature/model-to-model-connections
Open

adokodS wants to merge 9 commits into
mainfrom
feature/model-to-model-connections

Conversation

@adokodS

@adokodS adokodS commented Oct 30, 2026

Copy link
Copy Markdown

Summary

Adds two MCP tools for model communication, so a user can ask the agent to
connect model ports of two models the same way as in the ConfigurationDesk UI:

  • connect_model_port_to_model_port connects one model port to another
    (like drawing a mapping line manually).
  • connect_model_port_block_to_model_port_block connects a whole model port
    block or port group to another one; ConfigurationDesk pairs the ports by
    name (like dragging one connector square onto another).

Both tools report the result as in the UI: created links, warnings in the
Conflicts Viewer wording (e.g. "Mismatching data width"), and refused
mappings. ConfigurationDesk applies all mapping rules; the server implements
none.

list_model_ports additionally returns ports nested in port groups with
their paths, so the agent can address them. The agent now also looks up which
model contains a named block instead of asking the user.

Validation

  • uv run ruff check .
  • uv run ruff format --check .
  • uv run pytest ConfigurationDeskMCP/tests
  • uv run configurationdesk-mcp --list-tools
  • Documentation and tool specifications are updated when applicable.
  • No credentials, local paths, proprietary assets, or generated artifacts were added.

Add an MCP tool that maps one model port to another model port, as a
manual mapping line does. ConfigurationDesk's ConnectObjects applies the
mapping rules; the server implements none.

- compatible: link created, no new conflicts
- warning: link created; warnings use the Conflicts Viewer wording and
  effect from ExportConflictsToXML
- unknown: link created, but the conflict export after connecting failed
- MAPPING_REFUSED: ConfigurationDesk refused the mapping ("Cannot
  connect"); its message is returned unchanged, no link is created. Other
  ConnectObjects exceptions use the normal error handling.

Ports are addressed by model, model port block (name or hierarchy path)
and port path through port groups. Blocks ConfigurationDesk adds to the
signal chain are reported. Conflicts suppressed in the ConfigurationDesk
options (by default "Mismatching data type") are not reported.

list_model_ports keeps ports/count unchanged and adds paginated
leaf_ports with port_path, port_block_path and full_path for ports nested
in port groups.

Update tests, MCP inventory, tool map, tool docs, prompt guidance and
documented tool counts (79 tools).
Add an MCP tool that maps all name-matching ports of two model port blocks
or port groups, like dragging one connector square onto another in the
ConfigurationDesk UI. ConfigurationDesk's ConnectObjectsAutomatically pairs
the ports; the server implements no matching rules.

- Ports are paired by name, also in nested port groups; the order of the
  two sides does not matter.
- Pairs are connected regardless of data type or width; mismatches are
  reported as warnings per link.
- Inports that already have a source are skipped; existing links stay.
  A repeated call creates nothing new.
- Status: compatible, warning, nothing_connected, or unknown (links
  created, conflicts could not be read).
- Result lists created links with warnings, unconnected ports, links
  outside the two sides, and blocks added to the signal chain.
- Blocks with the same name at the same level are told apart by an
  optional direction (inport/outport).

Fix the port_type description of list_model_ports (raw PortType values).
Update tests, MCP inventory, tool map, tool docs, prompt guidance and
documented tool counts (80 tools).
Smaller models asked the user which model contains a named model port
block, although list_models and list_model_port_blocks can find it.
@adokodS
adokodS requested review from IZacharias and imdshr October 30, 2026 10:22
@adokodS adokodS self-assigned this Oct 30, 2026
@adokodS
adokodS requested a review from Akshay-r-rao as a code owner October 30, 2026 10:22
@adokodS adokodS removed their assignment Oct 30, 2026
Comment thread docs/tools/model-topology-mcp-tools.md Resolved
Comment thread docs/tools/model-topology-mcp-tools.md Resolved
Comment thread docs/tools/model-topology-mcp-tools.md Resolved
Comment thread docs/tools/model-topology-mcp-tools.md Resolved
Comment thread docs/tools/model-topology-mcp-tools.md Resolved
Comment thread docs/tools/model-topology-mcp-tools.md Resolved
Comment thread docs/prompts/tool-map.md Resolved
Comment thread docs/tools/model-topology-mcp-tools.md Resolved
@adokodS
adokodS requested a review from IZacharias November 19, 2026 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants