Add structs_comms MCP tool: headless Matrix guild chat (+ multi-hop consent fix) - #1
Open
ibeezhan wants to merge 1 commit into
Open
Add structs_comms MCP tool: headless Matrix guild chat (+ multi-hop consent fix)#1ibeezhan wants to merge 1 commit into
ibeezhan wants to merge 1 commit into
Conversation
Re-exposes the app's existing Matrix client (src-tauri/src/matrix/) over MCP as a new `structs_comms` tool, so an agent can read and post to guild chat rooms as the player it is already signed in as. Sign-in is the in-app wallet signature (via vplayer_bridge, which only ever signs the fixed LOGIN_GUILD login message), so no key or token leaves the app. Actions: status, connect, disconnect, rooms, browse, timeline, backfill, send, join, leave, dm, react, people. guild_id defaults to the active guild. Also fixes the OAuth consent handler in matrix/auth.rs to follow *multiple* consecutive MAS consent/interstitial forms instead of just one: MAS can interpose more than one form in a row (e.g. a consent screen followed by a device/scope confirmation), which previously stopped the chain with "stopped at .../consent/... instead of returning a code". Each form is posted in turn, always only to the issuer the homeserver named. Docs added to README (tool table, file tree, and a Guild Comms section). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a new
structs_commsMCP tool that re-exposes the app's existing Matrix client (src-tauri/src/matrix/) over MCP, so an agent can read and post to guild chat rooms as the player it is already signed in as. Sign-in is the in-app wallet signature (viavplayer_bridge, which only ever signs the fixedLOGIN_GUILDmessage), so no key or token ever leaves the app.Actions:
status,connect,disconnect,rooms,browse,timeline,backfill,send,join,leave,dm,react,people.guild_iddefaults to the active guild.Also fixes
The OAuth
consent()handler inmatrix/auth.rsonly followed one MAS consent form. MAS can interpose more than one interstitial form in a row (e.g. a consent screen followed by a device/scope confirmation), which previously stopped the login chain withstopped at .../consent/... instead of returning a code. The handler now posts each form in turn — always only to the issuer the homeserver named — until it reaches the authorization code.Docs
README updated in the repo's own style: tool table (13→14 tools), file tree entry for
comms.rs, and a new "Guild Comms (Matrix)" section documenting the headless sign-in chain, the action set, and the safety properties.Testing / provenance
Note for maintainers
mainhas advanced since this branch's base (9959b53) toward a frontend-first comms approach (chat.js/chat.html, expandedmatrix/client.rs). This PR is the agent-facing MCP surface and is complementary rather than a continuation — it may want reconciling against the newermatrix/mod.rs/client.rsbefore merge. Happy to rebase onto latestmainon request.