WIP: feat(mcp): drive owned test sessions over stdio #56
No reviewers
Labels
No labels
accessibility
autorelease: pending
autorelease: tagged
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
needs measurements
question
testing wanted
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!56
Loading…
Reference in a new issue
No description provided.
Delete branch "mooki/Longshot:feat/mcp-server"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
Draft, stacked on pull request 47 of this forge: review only the commits after
23cc17be6a. It becomes reviewable on its own once 47 is merged. This opens against main because the forge cannot select a fork branch as its base.This optional stdio adapter lets tools drive owned command-line test sessions without adding another game protocol. It continues Nicholas Gower's https://github.com/NotRexed/Hookshot/issues/1025; no handover agreement is recorded in the retained discussion, and the offer to stop and help his original work after acknowledging his later push stands.
The one dependency question: may this adapter and its SDK-specific tests use the narrowly scoped FastMCP 4.1.3 exception proposed here? Longshot's current CONTRIBUTING guide requires standard-library tests and isolated Python; its existing exceptions cover the build pipeline and the separately scoped button-prompt tools, not MCP. The proposal is not accepted policy. If declined, the MCP adapter should remain outside this repository while the standard-library session client stays here.
What changed
This generic adapter has no dependency on the separate workbench project, and nothing here implies maintainer endorsement of that project.
tests/pr_description/data directory; the newtests/test_docs_scope.pyproves ordinary and similarly named test guides remain checked, as do missing real links and commands. The stack guide now names the refreshed session prerequisite. These are separate commits, not edits to Nicholas's import.Flags and settings
HOS_CONTROLHOS_HEADLESSHOS_AUDIOHOS_ENV_FILE--runlaunch --runlaunch --rootlaunch --profilelaunch --readylaunch --timeoutlaunch --exelaunch --imagelaunch --romfslaunch --userlaunch --cwdlaunch --wrapperlaunch --savelaunch --slotlaunch --datalaunch --env--exclusive--no-exclusivesequence --hosstop --timeoutstop --terminatelog --lineslog --sincelog --byteslog --expectlog --regexlog --timeout--jsonlaunch --headless--sockserver --rootserver --game-dirserver --exeserver --imageserver --romfsserver --cwdserver --wrapperserver --envMeasurements
Branch state: on main
d725b3631982ed0035ea3ac9cbe1677e9fad260c; head0ce651b604ef72a514e6f5d42c11c971594f6d97; whole game-free suite on this head:513 passed, 2 failed, 20 skipped(maind725b3631982ed0035ea3ac9cbe1677e9fad260c:510 passed, 1 failed, 20 skipped); the commits are unchanged by rebases apart from the results table.main:
d4a69456c9(2026-11-12)this PR: feat/mcp-server @
5502fe20a5Measurement provenance: main @
d4a69456c9; session prerequisite in forge pull request 47 @9f5f6dd292.5502fe20a5.Hardware: Core i9-13900K, 96 GB RAM, Arch Linux 7.2.15. No GPU used for the new server checks.
Scene: real SDK catalogue and stdio/in-memory protocol tests against an authored fake game; no new Longshot MCP gameplay run.
Method: whole-suite warm-up, then the same catalogue probe before/after/before/after, fresh HOME each time. Counts and test output, not timing claims. The adapter is a separate process; native game code and ordinary launches are unchanged when it is not used.
How to reproduce: In the optional FastMCP 4.1.3 environment, run
python -I -B tests/test_mcp_server.pyand the documented catalogue list calls; compare the pinned main source where the adapter is absent, twice in interleaved order. Runtests/run_all.py test_mcp_ test_docs test_longshot_ctlwithout the SDK to check its isolated absence. Do not treat these fake-game checks as a new Longshot run.The rebase onto main
d725b3631adds only scripts, docs and tests, with no game-code change; the measuredd4a69456comparisons and pinned game evidence remain valid and were not repeated. Original results below retain their measured commits; the new exact-head suite is recorded separately.Baseline: main @
d4a69456d4a694565502fe20The before probe explicitly tests feature absence, not a failure of main's existing client. The SDK fixture exercises real initialization, tool/resource calls, stdio, error/EOF handling, cancellation, path boundaries, output limits and fake-session lifecycle. The no-SDK check verifies the one-line install refusal, no protocol output and SDK-free ordinary imports.
The complete suite used
tests/run_all.py --jobs 6 --strict, default compiler, the existing pinned Python with an owned copy of the optional SDK environment. No package was installed. The main suite is the shared baseline run once for this day's moved pull requests atd4a69456. The only final branch failure is main's localtests/test_updater_asset_digest.py: SDK 10.0.113 cannot resolveMicrosoft.AspNetCore.App.Ref (= 10.0.13),NU1100. Main additionally failedtests/test_appimage_package_retry.pyunder heavy load; the requested isolated rerun passed all 9 tests. It fails only under heavy load on this PC; timing-dependent. This branch passed it. The complete suites are not called green.Retained earlier result: 510 passed / 2 failed / 20 skipped. Its additional
test_docs.pyfailure identified the lowercase README link in the parent. Pull request 47 fixed it; the full suite above was run again after restacking on that parent.Historical game evidence, Hookshot, 2026-11-12, not a fresh Longshot run: adapter cf2dcf89, game
ba005ca4; RTX 4090 / NVIDIA 615.78.08, 1280×720, windowless Kokiri Forest. One 36.3 s ordinary shared run returned 29 matched replies including 26 tool calls, completed sequence frames 1455–1511, produced file/inline images at presents 1572/1575, restored an option and stopped with exit 0. Input save copy unchanged; fatal/device/kernel fault counts 0. No frame-rate or save-draining claim.Separate historical stack-parent check
Baseline: session-parent @
596c0a33This secondary comparison records the prerequisite separately because it is not main. Parent source was carried unchanged apart from its separately checked README link.
596c0a335502fe20Current validation and retained failures
The exact-head whole-suite result is in branch-state. The local NU1100 reference-pack failure also occurs on main. The other failure was
nx2/test_texture_phi_dominance.py: clang++ compilingemit_spirv.cppwas killed with SIGKILL 9, not a failed shader assertion. This is the compiler-killed category reported in other suites today; the signal alone does not establish OOM or another cause.That compiler fixture passed when run alone. The four SDK-free documentation/scope/optional-package/control-client checks also passed. These successes do not erase the failed full-suite attempt or make it green. The earlier documentation-fixture failure is also preserved in the evidence; the new scope regression and corrected documentation check now pass.
Actual SDK-free test output:
Testing
Tested: Arch Linux 7.2.15, Core i9-13900K, 96 GB: the complete game-free suite with FastMCP 4.1.3 on the exact committed head in branch-state, including the real SDK protocol tests and the new documentation-scope regression. The four SDK-free documentation/scope/optional-package/control-client programs and the isolated compiler fixture also passed, five programs in total. No fresh Longshot game run through this adapter is claimed.
Tested but not measured: the retained historical Hookshot MCP gameplay and current correctness checks; no execution-speed, frame-time or save-drain measurement. The newer main has since added DLSS-settle code and another description-template revision. This branch does not alter that DLSS code; its result-table merge conflict and any later base refresh are left to the maintainer under the frozen-base policy.
Not tested: fresh Longshot execution through this MCP adapter, fresh native Windows execution and other real MCP-host deployments remain outstanding; the local evidence uses Linux and authored fake-game processes. The optional dependency decision remains open. No new GPU code is added, so no separate vendor-specific performance claim or request is proposed; the unchanged renderer's unsupported WebGPU capture, run-long input exclusion and save-draining behavior are not made safe by this adapter.
Needs other testers:
Screenshots
Nothing on screen changes in this tool; retained historical pictures, if any, are not main/PR rendering comparisons.
No new on-screen change or Longshot MCP picture.
Risk and rollback
The MCP process runs with the operator's authority. A misconfigured game path, wrapper or trusted environment can launch code or expose files; configured roots constrain model-selected paths, not the operator. Stop owned sessions explicitly before stopping the stdio host. Omit the optional server/SDK and use the standard-library client, or revert the child commits; the game has no new native dependency.
Reviewer notes
Review Config, path validation, per-run locks and bounded screenshot/log results in scripts/longshot_mcp.py, then the real-SDK protocol tests. The optional dependency exception remains a maintainer decision and this stays WIP. Original published stack boundary was
9f5f6dd29; the refreshed boundary is23cc17be6a. Review child commits only after that parent; imported Nicholas files/messages and squash credit remain.Issues
Original pull request: https://github.com/NotRexed/Hookshot/issues/2921.
Original author/work: https://github.com/NotRexed/Hookshot/issues/1025.
Prerequisite on this forge: #47.
No corresponding forge issue exists in the public issue inventory checked for this move. No old GitHub number is used as a forge closing reference.
Checklist
For everyone
type(scope): description).main. The frozen base is in branch-state; the maintainer handles the later refresh.python -I -B tests/run_all.pyrun and passing (any failure that also fails onmainis named above). The retained compiler-killed case passed isolated, but the full suite is not called green.third_party/untouched (a new folder with aPROVENANCE.mdinstead).If applicable
Assisted-by:/Co-Authored-By:trailers.docs/tested-configurations.mdfor each measured run.mainand passing here.tests/that reads changed source updated in this PR, not weakened.Moved from NotRexed/Hookshot#2921.
Assisted-by: GPT-6 Astra
Co-Authored-By: GPT-6 Astra [email protected]
Co-authored-by: Nicholas Gower [email protected]
The description now follows the latest template, with the complete Testing section and checklist, one branch-state block, and the original measurement labels and uploaded picture preserved. Two follow-up commits name the refreshed session prerequisite and exclude only fictional PR-description fixtures from the documentation check, with regressions protecting real guides. The exact-head whole suite retains the local .NET prerequisite failure and a compiler-killed texture-phi case; that compiler fixture and all four SDK-free checks passed when selected separately, without erasing the failed whole-suite attempt. This remains WIP pending the optional-dependency decision, fresh Longshot use through the adapter, and the listed test requests.
5502fe20a5to0ce651b604View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.