Repository navigation
feat(mcp): add whoami, an OpenAI profile tool for the connected identity - #258
Merged
Merged
Conversation
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.
Adds
whoami, which returns the Cloudflare user or account the connection is authenticated as. It's marked as an OpenAI profile tool, so ChatGPT can tell connected accounts apart and recognise the same one after a reconnect. Replaces #254.whoami, notget_profile. The API already hasGET /accounts/{id}/profile,/user/billing/profileand/organizations/{id}/profile. Endpoint tools are named<method>_<path>, soget_profilereads like one of them.whoamican never clash with an endpoint tool. OpenAI allows any name; ChatGPT finds the tool through_meta['openai/profile'].user:oraccount:prefix. OpenAI says to use an existing immutable, opaque provider ID when there is one. Cloudflare user and account IDs are exactly that. The prefix keeps users and accounts apart. Every user credential (OAuth,cfut_,cfoat_, legacy) maps to the same profile. The format is a permanent contract, and AGENTS.md now says so.tools/callreads the credential. The tool is registered in both modes,_meta.securitySchemeslists the identity scopes every grant holds, and arguments are rejected.Cache-Controlchange. Caches don't store POST responses without explicit freshness headers, and a blanketno-storewould undo feat(mcp): let clients cache tools/list for an hour and share it across users #245.