Skip to content

Fix generated MCP endpoint path - #486

Merged
tninja merged 1 commit into
tninja:mainfrom
Superbil:agent/fix-mcp-session-path
Aug 19, 2026
Merged

Fix generated MCP endpoint path#486
tninja merged 1 commit into
tninja:mainfrom
Superbil:agent/fix-mcp-session-path

Conversation

@Superbil

Copy link
Copy Markdown
Contributor

Summary

  • restore generated MCP URLs to the shared /mcp endpoint accepted by the HTTP server
  • keep agent-session routing bearer-token based
  • cover the generated Codex, GitHub Copilot CLI, and Open Interpreter configurations with exact endpoint assertions

Root cause

#467 hardened the HTTP server around a bearer-authenticated, exact /mcp endpoint. #465 later preserved launch argument boundaries, but also began passing the AI Code session ID to the URL builder. That generated /mcp/<session-id>, which the server rejects with HTTP 404 before authentication or MCP protocol dispatch.

This change preserves the argument-boundary fix from #465 while restoring the endpoint contract established by #467. The bearer token still selects the registered agent session.

Codex version scope

This is not a regression introduced by Codex 0.147.0 or another recent Codex release. Codex's initial native Streamable HTTP support in 0.42.0 already consumed the configured URL verbatim, and current Codex does the same. The failing window begins in ai-code-interface.el with #465 (commit 8f60b76), which changed the generated URL from /mcp to /mcp/<session-id>.

Reference: Codex initial Streamable HTTP implementation

Relationship to existing work

Verification

  • regression test fails against upstream main and passes with this patch
  • 126 Codex, GitHub Copilot CLI, Open Interpreter, and MCP ERT tests pass in an isolated Emacs process
  • check-parens and checkdoc pass for all modified files
  • byte compilation passes for all modified files
  • git diff --check passes

@tninja

tninja commented Aug 18, 2026

Copy link
Copy Markdown
Owner

Thanks for the change! I’ll look into code later today.

@tninja

tninja commented Aug 19, 2026

Copy link
Copy Markdown
Owner

@Superbil LGTM! I'm ready to merge this. Let me know if there is anything else you plan to add, or we can put it to "Ready for review" and then I'll merge it.

@Superbil
Superbil marked this pull request as ready for review August 19, 2026 06:36
@tninja
tninja merged commit 6c515b3 into tninja:main Aug 19, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants