fix(app-server): accept MCP elicitation requests instead of rejecting them (#499)#501
Open
dane-krambergar wants to merge 1 commit into
Open
Conversation
… them
handleServerRequest rejected every server->client request with -32601
"Unsupported server request". Connectors surfaced as `codex_apps` (e.g.
ChatGPT connectors) request the operator's consent via an
`mcpServer/elicitation/request`, delivered as a server->client request.
Because this client runs Codex non-interactively, that request was never
answered: the background runner returned "user rejected MCP tool call" and
`codex exec` / `codex mcp-server` hung on it.
Answer the elicitation with { action: "accept" } so connectors the operator
has already enabled can run; unknown server requests still get -32601. Adds
a unit test and exports AppServerClientBase for it.
Fixes openai#499
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.
Fixes #499.
Problem
AppServerClientBase.handleServerRequestrejects every server→client request with JSON-RPC-32601"Unsupported server request". MCP servers surfaced ascodex_apps(e.g. ChatGPT connectors) ask for the operator's consent via anmcpServer/elicitation/request, which app-server delivers as a server→client request. Because this client runs Codex non-interactively, that request is never answered:user rejected MCP tool call;codex execandcodex mcp-serverhang on the unanswered elicitation.So connector tool calls (DainOS, GitHub, Slack, …) can't run through the plugin at all.
Fix
Answer
mcpServer/elicitation/requestwith{ action: "accept", content: null, _meta: null }so connectors the operator has already enabled can run. Unknown server requests still get-32601.The response shape matches the generated app-server protocol (
McpServerElicitationRequestResponse;McpServerElicitationAction = "accept" | "decline" | "cancel").Verification
Ran a read-only connector call (
dainos.describe_schema) through the plugin'staskrunner — non-interactive, no--dangerously-bypass-approvals-and-sandbox:user rejected MCP tool call.codex_apps/dainos.describe_schema completedand the tool result is returned.node --test tests/*.test.mjsstays green (91 → 93; adds a focused unit test and exportsAppServerClientBaseso it can be constructed in isolation).Note
If you'd prefer this gated behind a config/env opt-in rather than always accepting, I'm happy to adjust. Accepting seemed right given the plugin's non-interactive model and that the connector is already operator-enabled, but the choice is yours.
🤖 Authored with Claude Code