Payday MCP Server
A Model Context Protocol (MCP) server that provides secure, read-only access to the Payday API through Claude Desktop. Built with TypeScript and designed for local development with multi-tenant profile support.
Features
- 🔐 OAuth2 authentication with automatic token refresh
- 👥 Multi-profile support for test/production environments
- 📊 8 GET-only tools for customers, invoices, expenses, and payments
- 🚦 Rate limit tracking with headers exposed via dedicated tool
- ⚡ Auto-retry on 401 with token refresh (once per call)
- 🛡️ Privacy-focused - no logging of secrets or PII
- ✅ Production-ready with comprehensive error handling and tests
Requirements
- Node.js 18+
- npm or yarn
- Claude Desktop
Installation
- Clone the repository:
- Install dependencies:
- Build the project:
Configuration
Environment Variables
Copy .env.example
to .env
and add your credentials:
Profile Configuration
Copy profiles.example.json
to profiles.json
for multi-tenant support:
Claude Desktop Integration
Add to your Claude Desktop configuration:
Windows
%APPDATA%\Claude\claude_desktop_config.json
- Example path:
C:\Users\DaníelHjörvar\AppData\Roaming\Claude\claude_desktop_config.json
macOS
~/Library/Application Support/Claude/claude_desktop_config.json
Replace C:\\path\\to\\payday-mcp
with your actual installation path.
Available Tools
1. payday.show_profile
Shows current profile configuration.
- Output: profile name, base URL, company ID, read-only flag
2. payday.healthcheck
Verifies API connectivity and authentication.
- Output: status, authentication state, response time
3. payday.rate_limit_status
Returns rate limit info from the last API call.
- Output: limit, remaining, reset timestamp
4. payday.get_customers
Fetches customers with pagination and search.
- Input:
query?
,page?=1
,perpage?=50
- Output: customer list with pagination meta
5. payday.get_customer
Gets a specific customer by ID.
- Input:
customer_id
(required) - Output: customer details
6. payday.get_invoices
Retrieves invoices with flexible filtering.
- Input:
customer_id?
,status?
,from?
,to?
,page?=1
,perpage?=50
,include?
- Route:
/customers/:id/invoices
if customer_id provided, else/invoices
7. payday.get_expenses
Fetches expenses with date and query filtering.
- Input:
from?
,to?
,query?
,page?=1
,perpage?=100
,include?
- Output: expense list with pagination
8. payday.get_payments
Gets payments within date range.
- Input:
from?
,to?
,page?=1
,perpage?=100
- Output: payment list with pagination
Usage Examples
After configuring Claude Desktop, use natural language prompts:
- "Use payday.get_invoices for Aug–Sep 2025, unpaid only, include lines, perpage=100; summarize totals by customer."
- "Search customers query='Dúfan', perpage=50; show ids and emails only."
- "Expenses from 2025-07-01 to 2025-08-31, query='payday', include lines; return first 2 pages."
- "Show me the current rate limit status"
- "Check if the API is healthy"
Tool Response Format
All tools return a consistent JSON structure:
Error responses:
Development
Scripts
Project Structure
Error Handling
The server maps HTTP errors to standardized labels:
- AUTH_FAILED (401/403) - Authentication or permission issues
- VALIDATION_ERROR (400/422) - Invalid request parameters
- NOT_FOUND (404) - Resource not found
- RATE_LIMITED (429) - Too many requests
- SERVER_ERROR (500+) - Server-side errors
Security
- Credentials stored in
.env
(never committed) - No logging of secrets, tokens, or PII
- Read-only mode enforced via profile configuration
- Token caching with automatic expiry handling
Date Formats
All date parameters use ISO format: YYYY-MM-DD
Example: from: "2025-01-01", to: "2025-01-31"
Pagination Limits
- Default
perpage
: 50 for most endpoints, 100 for expenses/payments - Maximum
perpage
: 500 (enforced) - Page numbering starts at 1
Testing
License
MIT - see LICENSE file
API Documentation
For detailed Payday API documentation, see: https://apidoc.payday.is/
This includes endpoint specifications, parameter details, and response formats.
Support
For issues:
- Check your
.env
configuration - Verify
profiles.json
is valid JSON - Ensure Claude Desktop has the correct path
- Check API connectivity with
payday.healthcheck
- Refer to the official Payday API docs: https://apidoc.payday.is/
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Enables secure, read-only access to the Payday API through Claude Desktop with OAuth2 authentication. Supports querying customers, invoices, expenses, and payments with multi-profile support for different environments.