Authentication Methods
User Tokens
Recommended for productionFull API access with high rate limits (10,000-50,000 requests/day)
Client Credentials
Quick setup fallbackLimited API access with lower rate limits (1,000 requests/day)
Quick Comparison
| Feature | User Tokens | Client Credentials |
|---|---|---|
| Rate Limit | 10,000-50,000/day | 1,000/day |
| Setup Complexity | OAuth 2.0 flow required | Simple - just ID and Secret |
| API Access | Full access to all 230+ tools | Limited to public/app-level operations |
| User-specific Data | ✅ Yes | ❌ No |
| Automatic Refresh | ✅ Yes | N/A (always valid) |
| Best For | Production, seller operations | Testing, development |
How Authentication Works
User Tokens (OAuth 2.0)
User tokens use the OAuth 2.0 authorization flow to grant your MCP server access to a seller’s eBay account.1
User Authorization
The seller authorizes your application through eBay’s OAuth interface.
2
Token Exchange
Your application exchanges the authorization code for access and refresh tokens.
3
API Access
The MCP server uses the access token to make API calls on behalf of the user.
4
Automatic Refresh
When the access token expires (typically after 2 hours), the server automatically uses the refresh token to obtain a new access token.
The eBay MCP Server handles token refresh automatically - you don’t need to manage token expiration manually.
Client Credentials
Client credentials use a simpler application-level authentication that doesn’t require user authorization.1
Configuration
You provide your eBay Client ID and Client Secret.
2
Automatic Authentication
The MCP server automatically obtains an application access token from eBay.
3
Limited API Access
The server can only access public and app-level endpoints.
Rate Limits Explained
Understanding rate limits is crucial for choosing the right authentication method.User Token Limits
The daily rate limit for user tokens depends on your eBay seller account type:Basic Seller - 10,000 requests/day
Basic Seller - 10,000 requests/day
Who qualifies:
- New eBay sellers
- Individual sellers
- Low-volume accounts
- Manage up to ~50 active listings
- Process daily orders
- Run basic marketing campaigns
- View analytics regularly
Business Seller - 25,000 requests/day
Business Seller - 25,000 requests/day
Who qualifies:
- Registered business accounts
- Medium-volume sellers
- eBay Store subscribers
- Manage hundreds of active listings
- Handle high order volumes
- Run multiple marketing campaigns
- Frequent analytics queries
Enterprise Seller - 50,000 requests/day
Enterprise Seller - 50,000 requests/day
Who qualifies:
- Large-volume sellers
- eBay partner accounts
- High-tier eBay Store subscribers
- Manage thousands of listings
- Process hundreds of orders daily
- Complex automation workflows
- Real-time analytics and monitoring
Client Credentials Limits
Fixed at 1,000 requests/day regardless of account type.
- Testing and development
- Occasional API exploration
- Low-frequency automation
- Learning the eBay APIs
- Production seller operations
- High-frequency automation
- Managing active inventory
- Processing orders
Choosing the Right Method
Use this decision tree to select the appropriate authentication method:- I'm Just Getting Started
- I'm Building for Production
- I'm Not Sure
Recommended: Client Credentials ✅Why:
- Faster setup (no OAuth flow)
- Perfect for learning and testing
- Can upgrade to user tokens later
- Get your eBay Client ID and Secret
- Configure with environment variables
- Start exploring the APIs
Client Credentials Guide
Follow our step-by-step setup guide
Security Considerations
Both authentication methods require careful handling of credentials:Protecting Your Credentials
Never Commit Credentials
Never Commit Credentials
Always use environment variables for credentials:
Use Separate Credentials per Environment
Use Separate Credentials per Environment
Best practice:
- Separate Sandbox credentials for testing
- Separate Production credentials for live operations
- Never mix Sandbox and Production
Rotate Credentials Regularly
Rotate Credentials Regularly
For production environments:
- Rotate credentials every 90 days
- Immediately rotate if compromised
- Keep audit logs of rotation
- Generate new credentials in eBay Developer Portal
- Update
.envfile - If using user tokens, run
npm run setupto regenerate tokens - Delete old credentials from eBay portal
Monitor for Unauthorized Access
Monitor for Unauthorized Access
Environment Variables
Both authentication methods use environment variables for configuration.Required for Both Methods
Additional for User Tokens
User token variables are automatically populated when you run
npm run setup or npm run auto-setup.Authentication Flow in the MCP Server
Understanding how the MCP server handles authentication internally:Startup Sequence
-
Load Environment Variables
- Read
.envfile - Validate required variables
- Read
-
Check for User Tokens
- If user tokens present and valid → use user token authentication
- If user tokens missing or expired → fall back to client credentials
-
Initialize Authentication
- Obtain initial access token
- Set up automatic refresh for user tokens
- Register all available tools based on authentication type
-
Validate Connection
- Test API connectivity
- Confirm authentication is working
- Log authentication status
You can see the authentication status in the server logs when it starts.
During Operation
The MCP server handles authentication transparently:- Before each API call: Checks if access token is still valid
- If token expired: Automatically refreshes using refresh token
- If refresh fails: Falls back to client credentials if available
- If all auth fails: Returns clear error message
You never need to manually manage tokens - the server does it all automatically!
Troubleshooting Authentication
Common Issues
Invalid Client Credentials
Invalid Client Credentials
Symptoms:
- “Authentication failed” errors
- Server won’t start
- 401 Unauthorized responses
- Verify credentials in eBay Developer Portal
- Check for typos in
.envfile - Ensure you’re using credentials from the correct environment (Sandbox vs Production)
- Remove any extra spaces or quotes around values
User Tokens Not Working
User Tokens Not Working
Symptoms:
- Server falls back to client credentials
- User-specific endpoints return errors
- Token refresh fails
- Re-run
npm run setupto regenerate tokens - Verify redirect URI matches in eBay Developer Portal
- Check token expiry is in correct ISO 8601 format
- Ensure system clock is accurate
Rate Limit Exceeded
Rate Limit Exceeded
Symptoms:
- HTTP 429 responses
- “Rate limit exceeded” errors
- API calls failing after many requests
- With client credentials: Upgrade to user tokens
- With user tokens: Wait for daily reset (UTC midnight)
- Long-term: Optimize your API usage patterns
- Consider: Upgrading your eBay seller account tier
Sandbox vs Production Mismatch
Sandbox vs Production Mismatch
Symptoms:
- “Application not found” errors
- Credentials work in portal but not in server
- Inconsistent behavior
- Check
EBAY_ENVIRONMENTin.envmatches your credentials - Sandbox credentials only work with
EBAY_ENVIRONMENT=sandbox - Production credentials only work with
EBAY_ENVIRONMENT=production - Never mix Sandbox and Production credentials
More Help
See the comprehensive troubleshooting guide
Next Steps
Ready to set up authentication? Follow the guide for your chosen method:OAuth 2.0 Setup
Set up user tokens for full API access
Client Credentials
Quick setup with client credentials
Token Management
Learn about token refresh and lifecycle
Quickstart Guide
Complete setup guide with authentication