Complete guide to connect your Plaid MCP server to ChatGPT using OAuth 2.1.
- ✅ ChatGPT Plus or Pro subscription
- ✅ Plaid MCP server built and configured
- ✅ ngrok or public HTTPS URL
- ✅ OAuth credentials generated in
.env.local
# Build the server
npm run build
# Start the SSE server
npm run start:sseYou should see:
🔒 OAuth 2.1 authentication enabled (with PKCE and Dynamic Client Registration)
Plaid MCP SSE Server running on http://localhost:3001
In a new terminal:
ngrok http 3001You'll get an HTTPS URL like: https://abc123.ngrok-free.dev
cat .env.local | grep MCP_OAUTHExample output:
MCP_OAUTH_CLIENT_ID=f14a6478125f6698
MCP_OAUTH_CLIENT_SECRET=647ff36aead390189890fe13f93a7caf
- Open ChatGPT → Settings → Connectors
- Click "Add Connector"
- Fill in the details:
| Field | Value | Example |
|---|---|---|
| Name | Plaid Banking | (any name) |
| MCP Server URL | https://YOUR-NGROK-URL.ngrok-free.dev |
|
| Authentication | OAuth | (select from dropdown) |
| OAuth Client ID | From .env.local |
f14a6478125f6698 |
| OAuth Client Secret | From .env.local |
647ff36aead390189890fe13f93a7caf |
- Click "Create"
- A browser window will open automatically
- You'll see an authorization consent screen
- Review the permissions:
- Access your Plaid banking data
- Execute MCP tools on your behalf
- Manage your connected accounts
- Click "Authorize"
✅ ChatGPT will complete the connection and show the connector as "Connected"!
Once connected, try asking ChatGPT:
- "List my connected Plaid items"
- "Show me my account balances"
- "Get my transactions from last month"
- "Create a link token to connect my bank"
See README.md for the complete tool list.
The OAuth 2.1 flow with PKCE:
- Discovery - ChatGPT finds your OAuth endpoints
- Registration - ChatGPT registers using provided credentials
- Authorization - You approve access in browser
- Token Exchange - ChatGPT exchanges code for access token
- Authenticated Requests - All MCP requests include the token
Problem: ChatGPT can't find OAuth endpoints
Solution:
# Test that discovery endpoints work
curl https://YOUR-NGROK-URL/.well-known/oauth-authorization-server
# Should return JSON with authorization_endpoint, token_endpoint, etc.
# NOT a 404 or 401 errorProblem: OAuth credentials don't match
Solution:
- Check credentials in
.env.localmatch ChatGPT exactly - Restart server after changing
.env.local:pkill -f sse-server npm run start:sse
Problem: Redirect back to ChatGPT fails
Solution:
- Check server logs for errors
- Verify ngrok is still running
- Try deleting and re-adding the connector in ChatGPT
Problem: Connection stopped after restarting ngrok
Solution:
- Get new URL: check ngrok terminal
- In ChatGPT: Delete old connector
- Add new connector with new URL
- Use same OAuth credentials (no need to regenerate)
Problem: ChatGPT shows "Connected" but no tools
Solution:
- Check server logs for SSE connection
- Try asking ChatGPT: "What MCP tools do you have access to?"
- Refresh ChatGPT page
Verify your setup works:
# 1. Test OAuth discovery (public - no auth needed)
curl https://YOUR-NGROK-URL/.well-known/oauth-authorization-server | jq .
# Should show: authorization_endpoint, token_endpoint, registration_endpoint
# 2. Test server health
curl https://YOUR-NGROK-URL/health | jq .
# Should show: status: "ok", authentication: "oauth2.1"
# 3. Test with automated client (local only)
npm run testNote: npm run test starts a temporary test server with authentication bypassed. It only works for local testing and will temporarily stop your production server on port 3001.
Monitor your server in real-time:
# Follow server logs
tail -f /tmp/sse-server.log
# Look for these successful events:
# 🔐 OAuth authorization request from client: ...
# ✅ Authorization code issued
# 🎫 OAuth token request
# ✅ Access token issued
# ✅ Authenticated OAuth request- 🔒 Uses OAuth 2.1 with PKCE (Proof Key for Code Exchange)
- 🔒 Access tokens expire after 1 hour
- 🔒 Authorization codes are single-use and expire in 10 minutes
- 🔒 All tokens stored in memory (cleared on restart)
- 🔒 HTTPS required (ngrok provides this automatically)
- 🔒 Never commit
.env.localto git
For production use:
- Deploy to a server with a stable HTTPS URL (not ngrok)
- Generate new OAuth credentials for production
- Set up proper token storage (Redis/database instead of memory)
- Add rate limiting and request logging
- Monitor OAuth flows for security issues
See DEPLOYMENT.md for detailed production setup.
Once connected successfully:
- Connect a bank: "Create a link token to connect my bank account"
- View data: "Show me my account balances"
- Analyze spending: "Get my transactions from last month and categorize them"
- Find subscriptions: "Find all my recurring transactions"
Enjoy using your Plaid banking data with ChatGPT! 🎉