Repository navigation
Show the outbound IP for servers that only accept approved IPs - #1487
Merged
Merged
Conversation
Read the instance's outbound addresses from EGRESS_IPS and show them on the connector setup page and the connector page. Adapters marked requiresIpAllowlist (eMAG, Shopee, Korea Law) show them as a setup step. A call or setup check refused by a firewall (a 403 web page that is not a bot wall, Shopee source_ip_undeclared, eMAG's refusal) now gets a hint naming the address to allow, and says to switch the proxy off when the call went through it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Many servers only accept calls from approved IP addresses: self-hosted ERPs and CRMs behind a firewall, and providers that check every call (eMAG, Shopee, the Korean law API). Their refusal rarely says why. Most send back a 403 web page such as "Access Restricted", so the model reports a broken connector and the user has no idea which address to allow. Until now the address was written by hand in only two adapters' instructions, and Atlassian's instructions said "ask support".
This PR adds one setting for the instance's outbound addresses and shows them wherever a user needs them.
Changes
EGRESS_IPS(optional, comma-separated, invalid entries dropped). It is added to.env.exampleand to the three compose files, and read byconnectors/egress.ts. When it is unset, nothing is shown, and the error advice talks about "the public IP address of the server AnythingMCP runs on".requiresIpAllowlist: true(new adapter field, validated; set on eMAG, Shopee and Korea Law), the note is a step at the top of the page. For other adapters it is a small note at the bottom.GET /api/adapters/:slugnow returnsegressIps.GET /api/connectors/proxy-availabilitynow also returnsegressIps; the change is additive. When the proxy is available, the note says to keep "Proxy" off for allowlisted servers, and the Proxy tooltip says the same.deriveErrorHintgets a new last-resort rule. It fires on a 403 that is a web page, unless the page is a bot wall (Cloudflare, Akamai, DataDome, …). It also fires on Shopeesource_ip_undeclared, on eMAG's refusal, and on explicit "IP not allowed/whitelisted" texts. Vendor-specific rules still take precedence. The hint names the addresses to allow, and says to switch the proxy off when the call went through it.verifyHintof its own for the status.docs/tool-definition.md(the new field) anddocs/connectors/proxy.md(proxied calls use changing addresses).llms-full.txtis regenerated.The adapter version hash does not change:
requiresIpAllowlistis not part of the fingerprint, and no instructions were edited.Cloud and self-hosted
EGRESS_IPSto the backend's fixed address.Type
Testing
connectors/egress.spec.ts: parsing, refusal detection including bot walls, hint text;error-hints.spec.ts: the new rule, vendor rules still winning, a JSON permission error left alone. One existing expectation changed: a bare 403 "Access Denied" page now gets the firewall hint, still not the Odoo one;adapters.service.spec.ts: the setup check names the address on a 403 "Access Restricted" page, anddescribereturnsegressIpsandrequiresIpAllowlist.Commands run, with their results:
packages/backendnpx tsc --noEmit -p tsconfig.jsonpackages/backendnpx jest --maxWorkers=4packages/backendnpx eslinton the changed filespackages/frontendnpx tsc --noEmit -p tsconfig.jsonpackages/frontendnpx eslinton the changed filesreact-hooks/exhaustive-depsatconnectors/[id]/page.tsx:446), none newnode scripts/validate-adapters.mjs --warnnode scripts/adapter-count.mjs --checknode scripts/generate-llms-txt.mjs --checkChecklist