Setting Up MCP
This guide walks you through connecting AI assistants to PayRequest using the Model Context Protocol (MCP) with OAuth authentication.Supported AI Assistants
Claude Desktop
Anthropic’s desktop application with full MCP support
ChatGPT
OpenAI’s ChatGPT with MCP connector support
Prerequisites
Before you begin, ensure you have:- A PayRequest account with active billing data
- Claude Desktop app or ChatGPT Plus subscription
- Your PayRequest dashboard accessible
Claude Desktop Setup
Enter Server Details
Configure the MCP server with these settings:
| Setting | Value |
|---|---|
| Server URL | https://payrequest.app/mcp/billing |
| Name | PayRequest Billing |
Authenticate with PayRequest
Claude Desktop will open a browser window to authenticate with PayRequest. Log in with your PayRequest account and authorize the connection.
Grant Permissions
Review the requested permissions and click Authorize to allow Claude Desktop to access your billing data.
Claude Desktop Configuration File
For advanced users, you can also configure Claude Desktop via the config file:- macOS
- Windows
Edit
~/Library/Application Support/Claude/claude_desktop_config.json:ChatGPT Setup
Open ChatGPT
Go to chat.openai.com and ensure you have a ChatGPT Plus subscription.
Access MCP Connectors
In ChatGPT, go to Settings → Connected Apps or look for the MCP connector option.
Add PayRequest Server
Add a new MCP server with:
| Setting | Value |
|---|---|
| Server URL | https://payrequest.app/mcp/billing |
| Name | PayRequest Billing |
Finding Your Setup Instructions
The easiest way to set up MCP is from your PayRequest dashboard:- Go to Settings → API in PayRequest
- Select the Claude Desktop or ChatGPT tab
- Follow the on-screen instructions with pre-configured values
Test the Connection
After setup, verify everything works by asking your AI assistant:“What are my invoice statistics?”You should receive a response like:
Available Commands
Once connected, you can ask questions like:- “What are my invoice statistics?”
- “Show me all overdue invoices”
- “List my recent invoices”
- “Send a payment reminder for invoice #INV-2025-042”
OAuth Endpoints (Technical Reference)
For developers building custom MCP clients:| Endpoint | URL |
|---|---|
| MCP Server | https://payrequest.app/mcp/billing |
| OAuth Discovery | https://payrequest.app/.well-known/oauth-authorization-server |
| Authorization | https://payrequest.app/oauth/authorize |
| Token Endpoint | https://payrequest.app/oauth/token |
OAuth Flow
PayRequest MCP uses OAuth 2.0 with PKCE for secure authentication:- Client initiates authorization request with
code_challenge - User authenticates with PayRequest
- Authorization code returned to client
- Client exchanges code for access token using
code_verifier - Access token used for MCP requests
Troubleshooting
”Permission denied” or “Authentication failed”
- Ensure you’re logged into the correct PayRequest account
- Try disconnecting and reconnecting the MCP server
- Clear your browser cookies and try again
”Invalid client” error
- Make sure you’re using the correct server URL:
https://payrequest.app/mcp/billing - Contact support if the issue persists
Connection timeout
- Verify you can access
https://payrequest.appin your browser - Check your firewall or VPN settings
- Try from a different network
No data returned
- Ensure you have invoices in your PayRequest account
- Verify you authorized the correct PayRequest account
Security
OAuth 2.0 with PKCE
OAuth 2.0 with PKCE
PayRequest uses industry-standard OAuth 2.0 with PKCE (Proof Key for Code Exchange) for secure authentication without exposing secrets.
Scoped Access
Scoped Access
MCP connections only have access to billing data (invoices, statistics). They cannot access payment provider credentials or modify account settings.
Revoke Access
Revoke Access
You can disconnect MCP clients at any time from Settings → API in your PayRequest dashboard.
Activity Logging
Activity Logging
All MCP actions are logged in your Activity Log for audit purposes.