Skip to content

feat(mcp): add owned-record and read-only asset tools - #20

Open
klitztuch wants to merge 6 commits into
LANCommander:mainfrom
klitztuch:feat/mcp-owned-records
Open

klitztuch wants to merge 6 commits into
LANCommander:mainfrom
klitztuch:feat/mcp-owned-records

Conversation

@klitztuch

Copy link
Copy Markdown

Summary

  • Add list_*/get_*/create_*/update_*/delete_* tools for actions, scripts, save paths and multiplayer modes using the host's IOwnedRecordProvider contracts. Owners are passed explicitly (ownerKind, ownerId); a game's actions, scripts and save paths are scoped to a version (versionId, or the latest version when omitted). Server-side Package scripts are not exposed.
  • Add read-only list_media, get_media, list_archives, get_archive, and get_key_counts (totals only; key values and claim details are never returned).
  • Return the host's documented lookup/validation errors (KeyNotFoundException, ArgumentException) and malformed arguments as tool errors with their message instead of the SDK's generic "An error occurred invoking …". This also applies to existing tools such as update_game. Other exceptions stay generic.
  • Host packages and minimum host version unchanged (2.2.0-beta.4). Changes are listed under ## Unreleased in the MCP changelog; no version was assigned.

Security notes

  • create_script/update_script are annotated destructive: scripts are PowerShell that clients run, possibly elevated (requiresAdmin). The plugin never executes scripts. Actions define executables launchers run.
  • Media and archives are metadata-only (no upload, download or deletion). Keys cannot be listed, added, changed or released.

Validation

  • Test-ReleaseSelection, Test-Repository, Test-ReleaseDestinations, Test-NuGetPublication, Test-GitHubPackages passed.
  • Validate-Plugin.ps1 -Plugin Server.Mcp passed (Node setup tests, .NET unit/HTTP tests, package verification).
  • Manually tested the new tools and the error handling against a LANCommander 2.2.0 server in Docker.

Release behavior

No tags, releases or packages were created by this PR.

Check the owner kind against the kinds a provider accepts, require non-empty ids and reject a versionId for anything but a game owner before calling the host.
Expose list/get/create/update/delete for the host's owned-record providers. Actions, scripts and save paths of a game are scoped to a game version, defaulting to the latest. Script writes are marked destructive because clients run them, and server-side Package scripts are rejected.
List and read media and archive metadata without files. get_key_counts reports total, free and claimed CD keys and never returns key values or claim details.
List the new tools, explain owner kinds and game-version scoping, and update the safety notes for scripts, actions, keys, media and archives.
The SDK replaces every exception other than McpException with a generic
message, so KeyNotFoundException/ArgumentException from host providers
(e.g. an unknown game version in list_actions) and argument binding
errors only reached the server log. A call-tool filter now returns
their messages as tool errors; other exceptions stay generic.
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.

1 participant