loading…
Search for a command to run...
loading…
Enables the generation of professional PDF invoices and their distribution via email using customizable templates. It allows users to create, manage, and send i
Enables the generation of professional PDF invoices and their distribution via email using customizable templates. It allows users to create, manage, and send invoices with standard business fields like tax rates and line items through natural language.
A Model Context Protocol (MCP) server for generating professional invoices as PDFs or sending them via email. This server provides tools that allow Claude to create, customize, and distribute invoices based on a professional template.
Run directly without installation:
npx invoice-mcp-server
# Pull and run
docker run -p 3000:3000 -v $(pwd)/invoices:/app/invoices invoice-mcp-server
# Or build locally
docker build -t invoice-mcp-server .
docker run -p 3000:3000 -v $(pwd)/invoices:/app/invoices invoice-mcp-server
git clone https://github.com/kmexnx/invoice-mcp-server.git
cd invoice-mcp-server
npm install
npm run build
The easiest way to get started:
# Run directly
npx invoice-mcp-server
# With custom output directory
OUTPUT_DIR=/Users/yourname/Documents/invoices npx invoice-mcp-server
# With environment variables
SMTP_HOST=smtp.gmail.com [email protected] OUTPUT_DIR=/tmp/invoices npx invoice-mcp-server
version: '3.8'
services:
invoice-mcp:
image: invoice-mcp-server
ports:
- "3000:3000"
volumes:
- ./invoices:/app/invoices
- ./.env:/app/.env
environment:
- SMTP_HOST=smtp.gmail.com
- SMTP_PORT=587
- [email protected]
- SMTP_PASS=your-app-password
- [email protected]
- FROM_NAME=Your Company Name
- OUTPUT_DIR=/app/invoices
docker-compose up -d
git clone https://github.com/kmexnx/invoice-mcp-server.git
cd invoice-mcp-server
npm install
npm run setup # Creates directories and checks permissions
cp .env.example .env
# Edit .env with your settings
npm run build
npm start
The server needs a directory to save generated PDF invoices. It uses this priority order:
OUTPUT_DIR environment variable./invoices in current directory# Set for current session
export OUTPUT_DIR=/Users/yourname/Documents/invoices
npx invoice-mcp-server
# Or inline
OUTPUT_DIR=/path/to/your/invoices npx invoice-mcp-server
Add to your shell profile (~/.zshrc, ~/.bashrc, etc.):
export OUTPUT_DIR=/Users/yourname/Documents/invoices
docker run -e OUTPUT_DIR=/app/invoices -v /your/local/path:/app/invoices invoice-mcp-server
The server automatically:
If you encounter permission issues:
# Create and set permissions manually
mkdir -p /path/to/your/invoices
chmod 755 /path/to/your/invoices
# Or use a directory you own
export OUTPUT_DIR=$HOME/Documents/invoices
Add this server to your Claude Desktop configuration:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"invoice-server": {
"command": "npx",
"args": ["invoice-mcp-server"],
"env": {
"OUTPUT_DIR": "/Users/yourname/Documents/invoices",
"SMTP_HOST": "smtp.gmail.com",
"SMTP_PORT": "587",
"SMTP_USER": "[email protected]",
"SMTP_PASS": "your-app-password",
"FROM_EMAIL": "[email protected]",
"FROM_NAME": "Your Company Name"
}
}
}
}
{
"mcpServers": {
"invoice-server": {
"command": "docker",
"args": ["exec", "invoice-mcp-container", "node", "/app/dist/index.js"],
"env": {
"OUTPUT_DIR": "/app/invoices",
"SMTP_HOST": "smtp.gmail.com",
"SMTP_PORT": "587",
"SMTP_USER": "[email protected]",
"SMTP_PASS": "your-app-password"
}
}
}
}
{
"mcpServers": {
"invoice-server": {
"command": "node",
"args": ["/path/to/invoice-mcp-server/dist/index.js"],
"env": {
"OUTPUT_DIR": "/Users/yourname/Documents/invoices",
"SMTP_HOST": "smtp.gmail.com",
"SMTP_PORT": "587",
"SMTP_USER": "[email protected]",
"SMTP_PASS": "your-app-password"
}
}
}
}
Claude, create me an invoice for "Acme Corp" for the amount of $5000
Claude, create an invoice with the following details:
- Client: TechStart Inc.
- Services: Web Development (40 hours at $125/hour), Logo Design ($500)
- Tax rate: 8.5%
- Due date: 30 days from today
- Save as PDF and email to [email protected]
Claude, generate an invoice for:
- Company: Global Solutions LLC
- Item 1: Consulting Services - $2,500
- Item 2: Project Management - $1,200
- Item 3: Documentation - $800
- Tax rate: 7.25%
- Email it to [email protected]
create_invoice_pdfGenerates a PDF invoice file.
Parameters:
invoice_data: Complete invoice informationfilename: Optional custom filenamesend_invoice_emailCreates and sends an invoice via email.
Parameters:
invoice_data: Complete invoice informationrecipient_email: Email address to send tosubject: Optional custom email subjectmessage: Optional custom email messageget_invoice_templateReturns the current invoice template structure for reference.
{
// Company Information
company: {
name: string;
address: string;
city: string;
state: string;
zipCode: string;
phone?: string;
fax?: string;
email?: string;
};
// Client Information
billTo: {
name: string;
company?: string;
address: string;
city: string;
state: string;
zipCode: string;
phone?: string;
};
// Invoice Details
invoiceNumber: string;
date: string;
dueDate?: string;
// Line Items
items: Array<{
description: string;
amount: number;
}>;
// Financial Details
taxRate?: number; // as percentage (e.g., 8.5 for 8.5%)
other?: number; // additional fees/discounts
}
| Variable | Description | Required | Default | Example |
|---|---|---|---|---|
OUTPUT_DIR |
PDF output directory | Recommended | ./invoices |
/Users/name/Documents/invoices |
SMTP_HOST |
SMTP server host | No* | - | smtp.gmail.com |
SMTP_PORT |
SMTP server port | No | 587 |
587 |
SMTP_USER |
SMTP username | No* | - | [email protected] |
SMTP_PASS |
SMTP password | No* | - | your-app-password |
FROM_EMAIL |
From email address | No | SMTP_USER |
[email protected] |
FROM_NAME |
From name | No | - | Your Company Name |
TEMP_DIR |
Temporary files directory | No | System temp | /tmp |
*Required only for email functionality
FROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
COPY dist ./dist
COPY .env.example ./.env
RUN mkdir -p invoices
EXPOSE 3000
CMD ["node", "dist/index.js"]
# Run with environment variables
docker run -e SMTP_HOST=smtp.gmail.com \
-e [email protected] \
-e SMTP_PASS=yourpassword \
-e OUTPUT_DIR=/app/invoices \
-v $(pwd)/invoices:/app/invoices \
invoice-mcp-server
invoice-mcp-server/
├── src/
│ ├── index.ts # Main MCP server
│ ├── invoice-generator.ts # PDF generation logic
│ ├── email-service.ts # Email functionality
│ ├── invoice-template.ts # HTML template
│ └── setup.js # Setup script
├── dist/ # Compiled JavaScript
├── invoices/ # Generated PDFs (created by setup)
├── Dockerfile # Docker configuration
├── docker-compose.yml # Docker Compose setup
├── package.json
└── README.md
npm run build # Compile TypeScript
npm run dev # Development mode with watch
npm start # Run compiled server
npm run setup # Create directories and check setup
npm run clean # Clean build directory
npm run docker # Build Docker image
Test the server using the MCP inspector:
npx @modelcontextprotocol/inspector node dist/index.js
The setup script (npm run setup) will:
# Solution 1: Set custom directory
export OUTPUT_DIR=/Users/yourname/Documents/invoices
mkdir -p $OUTPUT_DIR
# Solution 2: Use setup script
npm run setup
# Solution 3: Use temporary directory
export OUTPUT_DIR=/tmp/invoices
OUTPUT_DIR=/tmp/invoices npx invoice-mcp-server-p 3001:3000Enable debug logging:
DEBUG=invoice-mcp:* npx invoice-mcp-server
Run the setup script to diagnose issues:
npm run setup
This will show:
MIT License - see LICENSE file for details.
Quick Start Example:
export OUTPUT_DIR=/Users/yourname/Documents/invoicesnpx invoice-mcp-serverThe server handles all formatting, calculations, and delivery automatically while saving PDFs to your specified directory.
Добавь это в claude_desktop_config.json и перезапусти Claude Desktop.
{
"mcpServers": {
"invoice-mcp-server": {
"command": "npx",
"args": []
}
}
}