-
Notifications
You must be signed in to change notification settings - Fork 88
chore: Support for proxies for Atlas tools. MCP-87 #407
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
Conversation
Right now the code is broken because there is some issue with the promise returned by the agent. I'm still investigating it.
This adds support for a custom fetch that can use proxies configured with environment variables.
Uses a variant devtools-shared/devtools-proxy-support http proxy server for testing.
node-fetch requires an internal symbol to identify if a request is an object or a string. Because openapi-fetch does not provide this symbol, node-fetch misunderstands the request.
Pull Request Test Coverage Report for Build 16626320664Details
💛 - Coveralls |
@@ -22,9 +23,10 @@ | |||
"mongodb-log-writer": "^2.4.1", | |||
"mongodb-redact": "^1.1.8", | |||
"mongodb-schema": "^12.6.2", | |||
"node-fetch": "^3.3.2", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need node-fetch
here? my understanding is that we should be using native fetch from v8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
devtools-proxy-support uses node-fetch right now, so sadly we will need to use node-fetch for now. I'm already in conversations with Anna to see when we can drop support for node-fetch in favour of the native fetch from Node.js.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will stay with node-fetch for a while, because the native fetch doesn't support agents (necessary for proxying) and it doesn't support natively proxies either (support for HTTP and HTTPs proxies is still experimental and doesn't support socks5).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM :)
Proposed changes
To add proxy support I had to do a few more changes than expected.
Also, some relevant info:
Checklist