Skip to content

fix(mcp): serve every route under CHATBOTX_MCP_BASE_PATH - #1777

Merged
realcodesiman merged 2 commits into
mainfrom
fix/mcp-profile-public-paths
Nov 25, 2026
Merged

realcodesiman merged 2 commits into
mainfrom
fix/mcp-profile-public-paths

Conversation

@realcodesiman

Copy link
Copy Markdown
Contributor

Summary

  • Replace CHATBOTX_MCP_SSE_PATH and CHATBOTX_MCP_MESSAGES_PATH with a single CHATBOTX_MCP_BASE_PATH prefix applied to every route (/messages, /sse, /openai, /claude).
  • Production forwards /mcp/* to the server unchanged, so the profile routes (/mcp/openai, /mcp/claude) previously did not resolve there; with CHATBOTX_MCP_BASE_PATH=/mcp all routes do.
  • The server refuses to start while either removed variable is still set, with a message pointing to the new one.
  • CHATBOTX_MCP_BASE_PATH is validated: empty or /segment[/segment], no trailing slash, not under /.well-known.
  • WWW-Authenticate metadata URLs include the base path; README and .env.example updated.

Breaking change

Deployments that set CHATBOTX_MCP_SSE_PATH / CHATBOTX_MCP_MESSAGES_PATH must switch to CHATBOTX_MCP_BASE_PATH (production: /mcp).

Test plan

  • pnpm --filter chatbotx-mcp check-types (run by pre-commit hook)
  • Biome on staged files (pre-commit hook)
  • pnpm --filter chatbotx-mcp test (new tests: prefixed routes for Claude, OpenAI and default profiles; unprefixed routes 404; removed variables rejected; invalid base paths rejected)
  • Set CHATBOTX_MCP_BASE_PATH=/mcp in the production deployment before rollout

Replace CHATBOTX_MCP_SSE_PATH and CHATBOTX_MCP_MESSAGES_PATH with a single
CHATBOTX_MCP_BASE_PATH prefix so /mcp/messages, /mcp/sse, /mcp/openai and
/mcp/claude resolve behind a proxy that forwards /mcp/* unchanged. The server
refuses to start while either removed variable is set.
@github-actions github-actions Bot added the bug Something isn't working as expected label Nov 25, 2026
…out public URL

- An empty CHATBOTX_MCP_SSE_PATH / CHATBOTX_MCP_MESSAGES_PATH no longer
  blocks startup; a non-empty value still does.
- Test the prefixed WWW-Authenticate metadata URL derived from the request
  host when CHATBOTX_MCP_PUBLIC_URL is unset.
- Refresh the profileForPath comment and mark CHATBOTX_MCP_BASE_PATH as
  optional in the README.
@realcodesiman
realcodesiman merged commit da4ff55 into main Nov 25, 2026
14 checks passed
@realcodesiman
realcodesiman deleted the fix/mcp-profile-public-paths branch November 25, 2026 07:28
realcodesiman added a commit that referenced this pull request Nov 25, 2026
OpenAI rejected the ChatGPT connector because tool annotations did not match
behavior. Its review rule sets destructiveHint for any tool that overwrites or
clears existing data, even when the change can be undone.

- conversations.assign replaces or clears the current assignee.
- pipelines.moveItem replaces the item's current stage.

Both now declare destructiveHint: true in x-mcp, so the default, Claude and
OpenAI profiles advertise the same hint. hitlPolicy is derived from the
operation id and stays confirm_diff, so the OpenAI input schemas and the
approval flow are unchanged.

Also fix the mcp-server README profile tables: a backticked env name in the
first column was read as a tool name by the README tool-list test, which has
failed on main since #1777.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working as expected

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant