Time to complete: 2-3 minutesPrerequisites:
- eBay Developer account
- Client ID and Client Secret from eBay Developer Portal
What Are Client Credentials?
Client credentials (also called “application-level authentication”) use only your eBay App ID and Cert ID to authenticate API requests.Quick Setup
No OAuth flow needed - just add credentials to
.envAutomatic Authentication
Server obtains access tokens automatically
Lower Rate Limits
1,000 requests/day (vs 10,000-50,000 for user tokens)
Limited Access
Public/app-level operations only
When to Use Client Credentials
- ✅ Good For
- ❌ Not Recommended For
- 🔄 Upgrade Path
Client credentials are ideal for:
- Getting started - Quickest way to try the MCP server
- Development - Test and learn the APIs
- Testing - Validate your workflows
- Low-volume usage - Occasional API exploration
- Public data - Accessing non-user-specific information
- Setup in minutes
- No browser authorization needed
- Simple configuration
- Perfect for learning
Quick Setup Guide
Step 1: Get Your Credentials
1
Sign in to eBay Developer Portal
Visit eBay Developer Portal and sign in with your eBay account.
2
Navigate to Application Keys
- Click My Account in the top right
- Select Application Keys from the dropdown
3
Create or Select Application
Option A: Create new application
- Click Create an Application Key
- Choose Sandbox environment (for testing)
- Fill in application details
- Click Create
- Select your existing application
- Choose Sandbox or Production tab
4
Copy Your Credentials
Note these values:Sandbox:
- App ID (Client ID):
YourAppName-YourApp-SBX-1234abcd-567890ab - Cert ID (Client Secret):
SBX-1234abcd-5678-90ab-cdef-1234
- App ID (Client ID):
YourAppName-YourApp-PRD-1234abcd-567890ab - Cert ID (Client Secret):
PRD-1234abcd-5678-90ab-cdef-1234
Step 2: Configure the MCP Server
- Using Environment Variables
- Using MCP Client Config
- Using Docker
Recommended approach:Create or edit Add your credentials:
.env file in the project root:That’s it! The server will automatically use client credentials mode since no user tokens are provided.
Step 3: Verify Setup
1
Validate Configuration
2
Start the Server
Your server is now running with client credentials!
3
Test API Access
Try a simple API call through your MCP client:
“What eBay marketplaces are available?”This calls a public endpoint that works with client credentials.
Some tools will return errors with client credentials - this is expected for user-specific operations.
How Client Credentials Work
Understanding the authentication flow:1
Server Startup
When the MCP server starts:
- Loads
EBAY_CLIENT_IDandEBAY_CLIENT_SECRETfrom environment - Checks for user tokens (none found for client credentials mode)
- Enters client credentials mode
2
Obtain Application Token
Server requests an application access token from eBay:
3
Receive Token
eBay responds with an application access token:
4
Use Token for API Calls
Server includes token in all API requests:
5
Automatic Renewal
When the token expires (~2 hours):
- Server automatically requests a new token
- Uses refreshed token for subsequent calls
- No manual intervention needed
Unlike user tokens, application tokens don’t have refresh tokens - the server just requests a new one when needed.
Available Operations
What Works with Client Credentials
Public Endpoints
Public Endpoints
Available operations:
- Get marketplace information
- View eBay policies (generic)
- Access public metadata
- Query eBay programs
- Get location details
getEbayMarketplacesgetReturnPolicyTypesgetPaymentPolicyCategories
These are informational endpoints that don’t require user authorization.
What Doesn’t Work
User-Specific Data
User-Specific Data
Not available:Solution: Upgrade to user tokens via OAuth 2.0.
- User’s inventory items
- Seller’s orders
- Personal analytics
- Account-specific settings
Seller Operations
Seller Operations
Not available:Solution: Use user tokens for seller operations.
- Create/update listings
- Manage offers
- Process orders
- Handle returns
- Update inventory
Marketing & Promotions
Marketing & Promotions
Not available:Solution: Set up OAuth user tokens.
- Create campaigns
- Manage promotions
- View campaign analytics
- Optimize promoted listings
Rate Limits
Daily Limit
Fixed at 1,000 requests per day for all client credentials, regardless of account type. What this means:- ~42 requests per hour
- ~0.7 requests per minute
- Resets daily at UTC midnight
Managing Rate Limits
- Monitor Usage
- Optimize Usage
- Upgrade When Needed
Track your API usage:
-
In eBay Developer Portal:
- View Application Keys → Analytics
- See real-time request counts
- Monitor daily/monthly trends
-
In Server Logs:
Logs show each API call:
-
Via Rate Limit Headers:
eBay includes rate limit info in responses:
Troubleshooting
Authentication Fails on Startup
Authentication Fails on Startup
Error:Possible causes:
- Incorrect Client ID or Secret
- Wrong environment (Sandbox vs Production mismatch)
- Typos or extra spaces in
.env
- Verify credentials in eBay Developer Portal
- Check
EBAY_ENVIRONMENTmatches credential type - Remove quotes and extra spaces from
.envvalues:
API Calls Return 401 Unauthorized
API Calls Return 401 Unauthorized
Rate Limit Exceeded
Rate Limit Exceeded
Error:Cause: You’ve made more than 1,000 requests today.Immediate solutions:
- Wait until UTC midnight for reset
- Upgrade to user tokens for higher limits:
- Implement request caching
- Optimize API call patterns
- Use batch operations
- Consider user tokens for production
Some Tools Don't Work
Some Tools Don't Work
Issue: Certain MCP tools return errors or “not available”Cause: Client credentials can’t access user-specific operationsAffected tool categories:This enables all 230+ tools with full functionality.
- Inventory management
- Order fulfillment
- Marketing/promotions
- Seller analytics
Upgrading to User Tokens
Ready for full API access? Here’s how to upgrade:1
Keep Existing Client Credentials
Your Client ID and Secret stay the same:
2
Run OAuth Setup
.env:3
Server Automatically Switches
On next startup, the server detects user tokens and switches to OAuth mode:
You’re now using user tokens with full API access!
4
Fallback to Client Credentials
If user tokens fail or expire, server automatically falls back:This ensures the server keeps working even if OAuth tokens have issues.
Security Best Practices
Protect Your Credentials
Protect Your Credentials
Client ID and Secret are sensitive:✅ Do:
- Store in
.envfile - Add
.envto.gitignore - Use environment variables in production
- Set file permissions:
chmod 600 .env
- Commit to version control
- Share publicly or in screenshots
- Hardcode in source files
- Send via email or chat
Separate Sandbox and Production
Separate Sandbox and Production
Use different credentials per environment:Benefits:
- Isolate testing from production
- Easier credential rotation
- Better security boundaries
Monitor Usage
Monitor Usage
Regularly check for anomalies:
-
In eBay Developer Portal:
- Review API usage analytics
- Check request patterns
- Monitor for unexpected spikes
-
Set up alerts:
- Email when approaching rate limits
- Notify on authentication failures
- Alert on unusual activity patterns
-
Log analysis:
Review logs for suspicious patterns.
Rotate Credentials
Rotate Credentials
Periodic credential rotation:For production:
- Generate new credentials in portal
- Update
.envwith new values - Test new credentials work
- Delete old credentials from portal
- Every 90 days minimum
- Immediately if compromised
- Before/after team member changes
Keep audit logs of all credential rotations.
Next Steps
Upgrade to OAuth
Get user tokens for full API access
Understand Rate Limits
Learn about API rate limits and optimization
Explore Available Tools
See what’s possible with the MCP server
Best Practices
Optimize your MCP server usage
Comparison: Client Credentials vs User Tokens
- Setup Complexity
- API Access
- Rate Limits
- Use Cases
Client Credentials:
- ✅ 2-3 minutes setup
- ✅ No browser authorization
- ✅ Just add ID and Secret
- ✅ Works immediately
- ⚠️ 10-15 minutes setup
- ⚠️ OAuth flow required
- ⚠️ Browser authorization needed
- ⚠️ Additional configuration