@openpets/mercury
v1.0.3
Published
Connect AI assistants to your Mercury bank accounts. Access accounts, transactions, cards, recipients, treasury, and statements via Mercury's REST API.
Maintainers
Readme
Mercury Banking Plugin
Connect AI assistants to your Mercury bank accounts. Access accounts, transactions, cards, recipients, treasury, and statements via Mercury's REST API.
Quick Start
1. Get Your API Token
- Log in to Mercury
- Go to Settings > API Tokens
- Create a new token:
- Read Only: For safe, read-only access (recommended)
- Read and Write: For full access (requires IP whitelisting)
- Custom: For specific scope access
2. Configure Environment
Add to your .env file:
MERCURY_API_TOKEN=secret-token:mercury_production_xxx3. Test Connection
opencode run "Test Mercury connection"Available Tools
Account Management
| Tool | Description |
|------|-------------|
| mercury-list-accounts | List all Mercury accounts with balances |
| mercury-get-account | Get details for a specific account |
| mercury-get-account-cards | Get cards linked to an account |
| mercury-get-account-statements | Get available statements for an account |
Transactions
| Tool | Description |
|------|-------------|
| mercury-list-transactions | List transactions with filtering options |
| mercury-list-account-transactions | List transactions for a specific account |
| mercury-get-transaction | Get details for a specific transaction |
Recipients
| Tool | Description |
|------|-------------|
| mercury-list-recipients | List all payment recipients |
| mercury-get-recipient | Get details for a specific recipient |
Treasury
| Tool | Description |
|------|-------------|
| mercury-list-treasury | List treasury accounts and balances |
| mercury-get-treasury-transactions | Get transactions for a treasury account |
Organization
| Tool | Description |
|------|-------------|
| mercury-get-organization | Get organization/company details |
| mercury-list-categories | List custom expense categories |
| mercury-list-credit | List credit accounts |
| mercury-list-users | List organization users |
| mercury-get-user | Get details for a specific user |
Example Queries
# Account overview
opencode run "What's my balance in my Mercury account?"
opencode run "List all my Mercury accounts"
# Transaction analysis
opencode run "Show me my recent transactions"
opencode run "Show pending transactions from last week"
opencode run "List transactions from January 2024"
# Cards and recipients
opencode run "What cards are linked to my main account?"
opencode run "List all my payment recipients"
# Treasury
opencode run "How much do I have in treasury?"
opencode run "Show my treasury account transactions"
# Organization
opencode run "Show my organization details"
opencode run "What expense categories do I have?"Token Types
| Type | Use Case | IP Whitelist Required | |------|----------|----------------------| | Read Only | View accounts, transactions, statements | No | | Read and Write | Create transactions, manage recipients | Yes | | Custom | Specific scopes only | Depends on scopes |
For most AI assistant use cases, a Read Only token is recommended for safety.
Security Notes
- Never commit your API token to version control
- Use read-only tokens when possible
- Tokens can be revoked anytime from Mercury dashboard
- Monitor API usage in Mercury settings
API Reference
This plugin uses Mercury's REST API. For full API documentation, see:
Troubleshooting
"not_configured" Error
Make sure MERCURY_API_TOKEN is set in your environment or .env file.
401 Unauthorized
Your token may be invalid or expired. Generate a new token from Mercury settings.
403 Forbidden
The token may not have permissions for the requested action. Check token scopes.
Rate Limiting
Mercury has rate limits on API requests. If you hit limits, wait before retrying.
