MCP: anonymous-access tools (allow_public get/set) + read exposure - #125
Open
kennethphough wants to merge 2 commits into
Open
MCP: anonymous-access tools (allow_public get/set) + read exposure#125kennethphough wants to merge 2 commits into
kennethphough wants to merge 2 commits into
Conversation
- read_application/appToArray now expose auth_mode and allow_public (anonymous-access level) so the MCP client can see an app's access config. - New set_app_anonymous_access tool (provision scope): sets allow_public 0/1/2 (none / read-only / controller-governed). Level 2 is what public signup needs. Validates the level and re-scopes application_id to the token's account (a token cannot open another account's app). - Tests: McpAppToolsTest (default level, set levels, invalid-level + foreign-app rejection, read exposure); registered in phpunit.xml.dist. Motivated by QA: membership apps need anonymous public signup, but MCP had no way to read or set allow_public — the AI was blind and punted to Shipyard. Auth error strings intentionally left unchanged (fingerprinting concern). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ignup
- set_app_auth_mode(app, hmac|jwt): sets Application.auth_mode AND regenerates
the injected `k` bootstrap (kyte_connect) to match — JWT nulls the HMAC keys
and passes {authMode:'jwt'}. Grounded in kyte-api-js: the anonymous/public
path + bearer sessions exist ONLY in JWT mode, so flipping just the field
would leave published pages booting the old mode. Republish caveat surfaced.
- get_auth_guide: consolidated end-to-end membership recipe (auth_mode=jwt +
allow_public=2 + password-flagged column + configure_app_login + a
requireAuth=false signup controller + client signup/login/logout). Cross-linked
from get_kytejs_guide, get_controller_guide, configure_app_login, and
set_app_anonymous_access so the AI is pointed to it from wherever it lands.
- get_kytejs_guide: add signup (anonymous k.post, JWT-only) + checkSession.
- Refactor kyte_connect building into buildKyteConnect (hmac/jwt).
- Tests: set_app_auth_mode (jwt regen + back-to-hmac + invalid + foreign-app).
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 MCP control over an app's anonymous (unauthenticated) access — the
Application.allow_publicgate that public-signup / membership apps depend on.read_application(andget_app_infoviaappToArray) now returnallow_publicandauth_mode, so the MCP client can see an app's access config instead of guessing.set_app_anonymous_access(application_id, level)(provisionscope): setsallow_publicto0none /1read-only (GET) /2controller-governed (anonymous writes where a controller setsrequireAuth=false). Level 2 is what public signup requires. Validates the level and re-scopesapplication_idto the token's account.Why
QA surfaced it: a membership app can't do public signup without anonymous write access, but MCP had no way to read or set
allow_public— the model (Claude) was blind to the very setting blocking it and had to punt to "the anonymous-access Shipyard setting." These two additions close that gap.Notes
Unauthorized API request.) intentionally left unchanged — making them specific would help attackers fingerprint access holes.Applicationstruct's ownallow_publictri-state comment exactly.Tools/); no registry change.Tests
tests/McpAppToolsTest.php(registered inphpunit.xml.dist): default level, set/read round-trips for 0/1/2, invalid-level rejection, foreign-app rejection, and read-exposure ofallow_public/auth_mode. Lints clean under PHP 8.2.🤖 Generated with Claude Code