Repository navigation
Let eBay sellers sign in instead of pasting a refresh token - #1430
Merged
Merged
Conversation
The ebay-sell connector asked for a user refresh token, which eBay's developer portal does not show (its User Tokens page gives 2-hour access tokens only), so sellers could not connect it. - authConfig.providerRedirectUri: the redirect_uri sent to the provider on the authorization request and the code exchange, in place of the callback URL. eBay wants the app's RuName there; the RuName's accepted URL brings the browser back to the unchanged callback route. Rows without it take the catalog's value, like pkce. Other adapters are unaffected. - ebay-sell: browser sign-in (auth.ebay.com, Basic auth, no PKCE, sell scopes), EBAY_RUNAME, the refresh token filled by the sign-in, a three-step setup guide, verify hint and updated instructions. Tokens pasted earlier keep working.
helpcodeai
enabled auto-merge (squash)
November 2, 2026 07:51
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
The eBay Sell connector could not be connected by a normal seller. It asked for a user refresh token, but eBay's developer portal does not show one: its User Tokens page only gives access tokens that expire after two hours, so the connector failed as soon as the token expired, and the refresh token itself needs an authorization-code exchange that a seller cannot run by hand. A paying Cloud customer hit exactly this on 2 November.
This PR lets the seller sign in to eBay from AnythingMCP ("Authorize with Provider" / the setup page), like Etsy. eBay's OAuth flow has one quirk: its
redirect_uriis not a URL but the app's RuName, both in the consent request and in the code exchange; the RuName's "Auth Accepted URL", set in eBay's developer portal, is what sends the browser back to us. A newauthConfig.providerRedirectUrioption covers that, generically.Changes
authConfig.providerRedirectUri(REST/GraphQL OAuth2): theredirect_urisent on the authorization request and on the code exchange in place of<SERVER_URL>/api/mcp-oauth/callback. Usually a variable ({{EBAY_RUNAME}}); while it has no value, "Authorize" asks for the variable instead of starting. A row without the key takes the catalog adapter's (same rule aspkce), so connectors installed from the old adapter can be signed in after addingEBAY_RUNAME. The callback route, state check and token storage are unchanged. Adapters without the key send exactly what they sent before.redirectUrinow holds what was sent;callbackUrlis added only when they differ, so theinvalid_grantmessage says to check the RuName's accepted URL instead of naming the RuName as a redirect URI.ebay-selladapter:authorizationUrlhttps://auth.ebay.com/oauth2/authorize, token URL with Basic client auth (as before),pkce: false(eBay documents no PKCE),grant: refresh_token, scopessell.inventory sell.fulfillment sell.account sell.payment.dispute(as full scope URLs, what the 10 tools need), new requiredEBAY_RUNAME,EBAY_REFRESH_TOKENnow optional/advanced ("leave empty"),appRegistrationUrl,prerequisites, anauth_failedverify hint, rewritten instructions, and a three-stepsetupGuide(Production keyset → RuName with Auth Accepted/Declined URL ={{redirectUri}}→ keys, RuName, marketplace, then sign in). Field patterns only reject Sandbox values (-SBX-,SBX-) and a URL pasted as RuName.docs/tool-definition.md: documentsproviderRedirectUriandpkce: false.eBay sources (developer.ebay.com blocks scripted access; read through archived copies of the current pages): "Getting user consent" (
api-docs/static/oauth-consent-request.html), "Exchanging the authorization code for a User access token" (oauth-auth-code-grant-request.html), "Getting your redirect_uri value" (oauth-redirect-uri.html), "Using a refresh token to update a User access token" (oauth-refresh-token-request.html), "Create the eBay API keysets" and "Marketplace account deletion".Cloud and self-hosted: same code path. On Cloud the accepted URL is
https://cloud.anythingmcp.com/api/mcp-oauth/callback(the guide fills it in from this instance). Self-hosted instances set their own<SERVER_URL>/api/mcp-oauth/callback; eBay requires https there, so an instance on plain http cannot use the sign-in (a pasted refresh token still works).Type
Testing
New:
connector-authorization.spec.ts(default path still sends the callback URL on both requests;providerRedirectUrisent on authorize and exchange, Basic auth, no PKCE; missing RuName blocks the start; an old eBay row adopts the catalog's endpoints/redirect and persists the placeholder). Extended:oauth-authorize-settings.spec.ts,ebay-sell.live.spec.ts(static assertions).Commands, all from the worktree of this branch:
node scripts/validate-adapters.mjs --warn(repo root):Validated 705 adapters: 705 passed, 0 failed, 1442 total warnings, none for ebay-sell (existing warnings only).node scripts/regenerate-catalog.mjs: regenerated, no diff incatalog.ts.node scripts/adapter-count.mjs --check:OK: every quoted count equals 691 adapters (34 keyless, 12254 tools).packages/backend:npx prisma generate, thennpx tsc --noEmit -p tsconfig.json: exit 0.packages/backend:npm run lint: exit 0, 0 errors, 11 existing warnings in files this PR does not touch;--fixchanged nothing.packages/backend:npx jest src/connectors/connector-authorization.spec.ts src/connectors/oauth-authorize-settings.spec.ts src/connectors/mcp-oauth.service.spec.ts src/connectors/mcp-oauth-callback.controller.spec.ts src/connectors/connectors.controller.spec.ts src/connectors/connect-page.controller.spec.ts --maxWorkers=1: 6 suites, 241 tests passed.packages/backend:npx jest src/adapters/intl/ebay-sell.live.spec.ts src/adapters/setup-guide.spec.ts src/adapters/env-var-meta.spec.ts src/connectors/connector-setup-status.util.spec.ts --maxWorkers=1: 4 suites, 41 passed, 1 skipped (the live test, gated byRUN_EBAY_SELL_LIVE=1).packages/backend:npx jest src/adapters/adapters.service.spec.ts src/connectors/catalog-resync.service.spec.ts src/adapters/mcp-adapter.spec.ts --maxWorkers=1: 3 suites, 127 passed.The full backend suite was not run here (it runs in CI).
Not verified: the live sign-in against eBay. There is no eBay seller or developer account available to this work, so the consent page, the RuName form labels as they look today, and whether every keyset includes
sell.payment.disputeby default come from eBay's documentation, not from a real run. The first real customer sign-in is the end-to-end proof.Checklist
npm test) — targeted suites only, see aboveRelated Issues
None. Reported by a Cloud customer through support chat (eBay connection refused, 2 November 2026).