feat(mcp): add resources/templates/list handler#2833
Conversation
…arun preload CWD resolution (tinyhumansai#2822) sharun resolves its --preload argument and library search paths relative to the process CWD rather than the AppDir. When a user launches OpenHuman_0.56.0_amd64.AppImage from any directory other than the AppDir (e.g. double-click from ~/Downloads), ld.so cannot find anylinux.so or libcef.so even though SHARUN_DIR is set correctly. Fix: add a new `patch_apprun_sharun_cwd` function to scripts/release/strip-appimage-graphics-libs.sh that injects `cd "$APPDIR" && ` before the `exec "$@"` line in the AppRun shell script during the post-build repackaging step. This guarantees that CWD == AppDir by the time sharun runs, so relative preload/library paths resolve correctly regardless of where the user launches from. The patch: - Only applies when the AppImage uses a sharun launcher (detected by the existing `uses_sharun_launcher` guard). - Skips ELF-binary AppRun entries (cannot be sed-patched). - Is idempotent (skips if `cd "$APPDIR"` is already present). - Emits a clear warning if the exec line pattern is not found rather than silently missing the fix. - Triggers a repack of the AppImage (same path as the loader/lib.path fixes) and is re-signed alongside other mutations. Verified workaround from the bug report: sed -i 's|^ exec "\$@"| cd "$APPDIR" \&\& exec "$@"|' squashfs-root/AppRun This commit generalises that one-liner into the release pipeline so future releases ship with the fix pre-applied.
Implements the missing `resources/templates/list` MCP method as specified in tinyhumansai#2826. Compliant MCP clients (Claude Desktop, Cursor, Zed) probe this method after seeing the `resources` capability in `initialize` and expect either a response or an error. The OpenHuman MCP server currently advertises resources capability but omits this method, causing clients to log -32601 (Method not found) errors. Since resource templates are not currently exposed, this implementation correctly returns an empty `resourceTemplates` array. Changes: - Add `list_resource_templates_result()` helper in resources.rs - Wire `resources/templates/list` handler in protocol.rs - Add unit test for helper function - Add two integration tests: bare call and with cursor parameter Closes tinyhumansai#2826
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Closing as superseded by #2828 for issue #2826. Both PRs implement the missing MCP
This PR is the larger diff (+130 vs +87) but doesn't carry docs or matrix updates, and a non-trivial fraction of the size is the test scaffold that #2828 reaches with less code via its Thanks for the contribution! If you spot anything #2828 misses (extra wire-test coverage, edge case in the request-param parsing), happy to surface it as a review comment on that PR. |
Implements #2826: missing MCP resources/templates/list endpoint.
Changes:
Closes #2826