Skip to content

How to add extra headers in sse client requests. #434

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
pritam-dey3 opened this issue Apr 30, 2025 · 1 comment
Open

How to add extra headers in sse client requests. #434

pritam-dey3 opened this issue Apr 30, 2025 · 1 comment

Comments

@pritam-dey3
Copy link

I am testing a mcp server and routing the requests to local mcp server through a ngrok tunnel. Now the requests through ngrok has to have this header:

{
    "ngrok-skip-browser-warning": "69420",
}

the value can be anything actually.

Normally I am doing all the fetch requests like this:

const response = await fetch(url, {
    method: 'GET', headers: new Headers({
      "ngrok-skip-browser-warning": "69420",
    }),
  });

How do I add it to my sse transport? This following method is not actually adding the header to the requests.

this.transport = new SSEClientTransport(new URL(url), {
      requestInit: {
        headers: {
          "ngrok-skip-browser-warning": "69420",
        }
      }
    });
@jigarchhadwa
Copy link

I see an issue in the current implementation.. It is not considering the requestInit headers..
#436

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

No branches or pull requests

2 participants