Skip to content

Conversation

etraut-openai
Copy link
Collaborator

This PR adds the following:

  • A getAuthStatus method on the mcp server. This returns the auth method currently in use (chatgpt or apikey) or none if the user is not authenticated. It also returns the "preferred auth method" which reflects the preferred_auth_method value in the config.
  • A logout method on the mcp server. If called, it logs out the user and deletes the auth.json file — the same behavior in the cli's /logout command.
  • An authStatusChange event notification that is sent when the auth status changes due to successful login or logout operations.
  • Logic to pass command-line config overrides to the mcp server at startup time. This allows use cases like codex mcp -c preferred_auth_method=apikey.

Copy link
Contributor

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codex Review: Here are some suggestions.

Reply with @codex fix comments to fix any unresolved comments.

About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you open a pull request that is ready for review, or mark a draft as ready for review. You can also ask for a review by commenting "@codex review".

Codex can also answer questions or update the PR. Try commenting "@codex fix this CI failure" or "@codex address that feedback".

@etraut-openai
Copy link
Collaborator Author

@bolinfest, ready for another round of review. I incorporated feedback from your last round:

  1. Added ServerNotification enum and updated send_notification to accept it.
  2. Reversed the dependency between the protocol and logon crates by moving AuthMode from the latter to the former.
  3. Precompute Config with overrides and pass it to mcp server rather than threading config overrides down the call chain.

@etraut-openai
Copy link
Collaborator Author

@bolinfest, I incorporated your latest round of feedback. The serialization code is now much simpler and cleaner! The key was to use the serde content = "data" directive. This isolates the payload from the "type" discriminator field, which makes serialization much simpler.

I think it's ready for another (hopefully final) round of review.

Copy link
Collaborator

@bolinfest bolinfest left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work, but please address comments before submitting!

@etraut-openai etraut-openai merged commit dacff96 into main Aug 21, 2025
15 checks passed
@etraut-openai etraut-openai deleted the auth_status_logout branch August 21, 2025 03:36
@github-actions github-actions bot locked and limited conversation to collaborators Aug 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants