Skip to content

Conversation

SamyPesse
Copy link
Member

No description provided.

Copy link

changeset-bot bot commented Sep 12, 2025

⚠️ No Changeset found

Latest commit: c7a304a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

argos-ci bot commented Sep 12, 2025

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
customers-v2 (Inspect) 👍 Changes approved 3 changed Sep 12, 2025, 12:55 PM
v2-cloudflare (Inspect) ✅ No changes detected - Sep 12, 2025, 12:58 PM
v2-vercel (Inspect) ✅ No changes detected - Sep 12, 2025, 12:57 PM

Copy link

@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 for review, mark a draft as ready, or comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍.

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

Comment on lines 82 to 85
const request = new Request(
// Next.js request.url is the original URL and not the rewritten one from the middleware
context.linker.toAbsoluteURL(context.linker.toPathInSite('~gitbook/mcp')),
nextRequest

Choose a reason for hiding this comment

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

[P1] Preserve query parameters when reconstructing MCP request

The new handler rebuilds the request object with new Request(context.linker.toAbsoluteURL(context.linker.toPathInSite('~gitbook/mcp')), nextRequest). This replaces the original URL, but it discards any search string that may have been present because the first argument is just a bare path without nextRequest.nextUrl.search. Middlewares explicitly copy request.nextUrl.search when rewriting, so callers can pass data via query parameters. After this change, any MCP call that relies on query parameters (e.g. authentication or debug flags) will stop receiving them. Consider appending nextRequest.nextUrl.search to the constructed URL before creating the new Request.

Useful? React with 👍 / 👎.

@SamyPesse SamyPesse merged commit ca71c1f into main Sep 12, 2025
16 checks passed
@SamyPesse SamyPesse deleted the fix-mcp branch September 12, 2025 12:59
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.

1 participant