d0nth4x/infakt-mcp-server
If you are the rightful owner of infakt-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
The inFakt MCP Server is a Model Context Protocol server designed for seamless integration with inFakt's REST API, providing comprehensive invoicing and accounting services.
inFakt MCP Server
Languages: English |
Model Context Protocol (MCP) server for the inFakt API - a comprehensive Polish invoicing and accounting service.
Overview
This MCP server provides seamless integration with inFakt's REST API, enabling AI assistants like Claude to interact with your inFakt account for:
- Invoice Management - Create, read, update, and delete VAT invoices, corrective invoices, and other document types
- Client Management - Manage customer database
- Product Management - Maintain product/service catalog
- Cost Tracking - Access expense documents
- Reference Data - Query VAT rates, bank accounts, and other configuration data
Features
- Full CRUD operations for invoices, clients, and products
- Asynchronous invoice creation with status tracking
- PDF generation and email delivery
- Advanced filtering, pagination, and sorting
- Support for both production and sandbox environments
- Comprehensive error handling
Prerequisites
- Node.js 18 or higher
- inFakt account (production or sandbox)
- inFakt API key
Installation
- Clone this repository:
git clone <repository-url>
cd infakt-mcp
- Install dependencies:
npm install
- Build the project:
npm run build
Configuration
Getting Your API Key
Production Environment:
- Log in to inFakt
- Navigate to Settings → Other Options → API
- Generate a new API key with required scopes
Sandbox Environment:
- Register at inFakt Sandbox
- Navigate to Settings → API
- Generate a test API key
Environment Variables
Create a .env file or set the following environment variables:
# Required
INFAKT_API_KEY=your_api_key_here
# Optional
INFAKT_USE_SANDBOX=true # Set to 'true' for sandbox, omit or 'false' for production
INFAKT_BASE_URL=https://api.infakt.pl/api/v3 # Custom base URL (optional)
MCP Client Configuration
For Claude Desktop:
Add to your claude_desktop_config.json:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"infakt": {
"command": "node",
"args": ["/absolute/path/to/infakt-mcp/dist/index.js"],
"env": {
"INFAKT_API_KEY": "your_api_key_here",
"INFAKT_USE_SANDBOX": "false"
}
}
}
}
For Other MCP Clients:
Configure according to your client's documentation, ensuring:
- Command:
node dist/index.js - Environment variables are properly set
- Working directory is set to the project root
Available Tools
Invoice Management
infakt_create_invoice
Create a new VAT invoice asynchronously.
Parameters:
client_company_name(required): Client company namepayment_method(required): cash, transfer, card, etc.services(required): Array of services/productsstatus: draft (default), paid, or printedclient_id: Use existing client- Client details for new clients (first_name, last_name, tax_code, etc.)
- Additional fields: notes, invoice_date, sale_date, payment_date, etc.
Returns: Task reference number for status checking
infakt_check_invoice_status
Check the status of an asynchronously created invoice.
Parameters:
task_reference_number(required): Reference number from create_invoice
infakt_list_invoices
List all invoices with filtering and pagination.
Parameters:
offset: Pagination offsetlimit: Results per page (max 100)order: Sort order (e.g., "invoice_date desc")number: Filter by invoice numberclient_company_name: Filter by client namestatus: Filter by statusinvoice_date_from,invoice_date_to: Date range filtersfields: Comma-separated fields to return
infakt_get_invoice
Get detailed information about a specific invoice.
Parameters:
invoice_uuid(required): Invoice UUIDfields: Optional field selection
infakt_update_invoice
Update an existing invoice (draft only).
Parameters:
invoice_uuid(required): Invoice UUID- Fields to update (client_company_name, payment_method, services, etc.)
infakt_delete_invoice
Delete an invoice (draft only).
Parameters:
invoice_uuid(required): Invoice UUID
infakt_download_invoice_pdf
Download invoice as PDF (base64 encoded).
Parameters:
invoice_uuid(required): Invoice UUIDdocument_type: original, copy, duplicate, etc.locale: pl, en, or pe
infakt_send_invoice_email
Send invoice via email.
Parameters:
invoice_uuid(required): Invoice UUIDrecipient_email: Custom recipient (uses client email by default)email_subject: Custom subjectemail_message: Custom message
infakt_mark_invoice_paid
Mark an invoice as paid.
Parameters:
invoice_uuid(required): Invoice UUIDpaid_date(required): Payment date (YYYY-MM-DD)
Client Management
infakt_list_clients
List all clients with filtering.
infakt_get_client
Get client details by ID.
infakt_create_client
Create a new client.
infakt_update_client
Update an existing client.
infakt_delete_client
Delete a client.
Product Management
infakt_list_products
List all products with filtering.
infakt_get_product
Get product details by ID.
infakt_create_product
Create a new product.
infakt_update_product
Update an existing product.
infakt_delete_product
Delete a product.
Reference Data
infakt_get_vat_rates
Get available VAT rates.
infakt_get_bank_accounts
Get configured bank accounts.
infakt_get_account_info
Get account information and limits.
Cost Management
infakt_list_costs
List cost documents.
infakt_get_cost
Get cost document details.
Usage Examples
Example 1: Create an Invoice
Create a new invoice for client "ACME Corp" with:
- Payment method: bank transfer
- One service: "Website Development" for 5000 PLN net with 23% VAT
- Client tax code: 1234567890
- Client address: ul. Główna 1, 00-001 Warsaw, Poland
The MCP server will:
- Create the invoice asynchronously
- Return a task reference number
- You can then check the status and retrieve the invoice UUID
Example 2: List Recent Invoices
List the last 10 invoices from December 2024, sorted by date descending
Example 3: Send Invoice via Email
Send invoice <uuid> via email to client
Example 4: Generate PDF
Download PDF for invoice <uuid> in Polish language
API Scopes Required
The API key must have appropriate scopes for the operations you want to perform:
api:invoices:read- Read invoices, clients, productsapi:invoices:write- Create/update/delete invoices, clients, productsapi:costs:read- Read cost documentsapi:costs:write- Manage costsapi:accounting:read- Read accounting dataapi:accounting:write- Manage accounting operationsapi:sensitive:bank_accounts:write- Manage bank accounts
Rate Limits
inFakt API has the following rate limits:
- GET requests: 300 requests per 60 seconds per IP
- Other methods: 150 requests per 60 seconds per IP
- Invoice email sends: 3000/day (paid accounts), 20/day (free accounts)
Development
Run in Development Mode
npm run dev
Build
npm run build
Watch Mode
npm run watch
Testing
Using Sandbox Environment
Set INFAKT_USE_SANDBOX=true to use the test environment:
- No real invoices are created
- Safe for testing integrations
- Limit: 2500 invoices per month
Troubleshooting
Authentication Errors (401)
- Verify your API key is correct
- Check that the key has required scopes
- Ensure the key hasn't expired
Payment Required (402)
- Your plan doesn't support API access or has exceeded document limits
- Upgrade your plan at inFakt
Rate Limit Errors (429)
- Wait before retrying
- Implement exponential backoff
- Consider caching responses
Validation Errors (422)
- Check required fields are provided
- Verify data formats (dates as YYYY-MM-DD, valid VAT rates, etc.)
- Review error messages in response
Resources
License
MIT
Support
For API issues, contact inFakt support at pomoc@infakt.pl
For MCP server issues, please open an issue in this repository.