Multi-Tenant Invoice Autofill MCP Server
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Multi-Tenant Invoice Autofill MCP Server
A Python backend service enabling function-calling or MCP-capable LLMs (Claude, Gemini, GPT, etc.) to autofill and save invoices on Digital Invoicing Software on behalf of tenants.
Features
Dual Transport Support: Exposed via standard MCP protocol (stdio / Streamable HTTP) and REST API (FastAPI) with OpenAPI schema.
Multi-Tenancy & Auth: Per-tenant credential encryption, custom MCP API keys, and isolated session management.
Resilient Adapter: Encapsulated HTTP adapter replicating browser headers, with reactive session refresh and dynamic cookie expiry parsing.
Idempotency & Concurrency: Deduplication via document hash and per-tenant Redis distributed locking (
lock:tenant:{id}).Privacy First: Mandatory structured log redaction layer scrubbing passwords, cookies, keys, and tokens.
Zero Hardcoded Values: No credentials or business identities baked into code, comments, or tests; full synthetic test data generation.
Related MCP server: Invoice MCP Server
Local Prerequisites
Python 3.12+
Docker & Docker Compose (for local Postgres & Redis)
Getting Started
1. Environment Setup
Copy .env.example to .env and set local variables:
cp .env.example .env2. Launch Local Database & Redis
docker-compose up -d3. Install Dependencies
python -m venv .venv
# Windows:
.\.venv\Scripts\pip install -r requirements.txt
# Linux/macOS:
source .venv/bin/activate
pip install -r requirements.txt4. Run Migrations
.\.venv\Scripts\alembic upgrade head5. Start the Server
# Start FastAPI REST server:
.\.venv\Scripts\uvicorn mcp_digitalinvoice.main:app --reload --port 8000
# Run MCP stdio server:
.\.venv\Scripts\python -m mcp_digitalinvoice.mcp_server.serverSecurity
Encryption Key Management: The ENCRYPTION_KEY environment variable must be set to a secure 32-byte base64-encoded Fernet key. Application startup will fail immediately if ENCRYPTION_KEY is not provided. If an encryption key was ever used to encrypt real tenant data and is suspected of exposure, that data must be re-encrypted under a freshly generated key, since the old key must be considered compromised.
Workflows
Tenant Onboarding (connect_account)
Call
connect_accountwith the tenant's Digital Invoicing Software login email, password, and business name.The server encrypts credentials, validates them via an initial login, and returns a unique
mcp_api_key.Provide this
mcp_api_keyto the LLM (as a Bearer token or header) for subsequent tool invocations.
Invoice Autofill (fill_invoice)
The LLM invokes fill_invoice with extracted invoice JSON payload (buyer, items, meta). The service validates required fields, enforces single-document sequencing, checks idempotency, resolves tenant session, maps payload to downstream shape, and creates the invoice draft.
Running Tests
.\.venv\Scripts\pytest -v tests/This server cannot be deployed
Maintenance
Related MCP Connectors
Turn AI-host work into invoices you review before send — Continue as guest or OAuth via hosted MCP.
Invoicing you drive by talking to your AI: log time, raise invoices and track what's owed via MCP.
Create, send and track invoices from a conversation in Claude, ChatGPT or any MCP client that supports OAuth. Draft an invoice from one sentence or from last month's invoice for the same client, finalize it, email it to your client and send payment reminders for overdue ones. See revenue by month and by client, download PDFs and e-invoices (ZUGFeRD, XRechnung), and export DATEV packages for your tax advisor. Invoices follow the tax rules of 25 countries, including reverse charge and the small-business VAT exemption. New invoices are drafts, and nothing is emailed until you ask. Pay per invoice with no subscription: the first invoice is free.
Multi-tenant MCP gateway for AI commerce. One connection, every store.
Related MCP Servers
- -licenseNot gradedqualityBmaintenanceEnables AI assistants to prepare and create invoices via Outvoicer's invoicing platform using Streamable HTTP MCP.-
- AlicenseNot gradedqualityDmaintenanceAllows AI clients like Claude and Cursor to authenticate and interact with an invoice generator backend, enabling login, invoice creation, and invoice download.7 npmMIT
- AlicenseAqualityBmaintenanceEnables AI assistants to securely interact with rental management data (leases, rent status, tenant records, tax filings) through a per-user OAuth 2.0 authenticated MCP server, with human-in-the-loop for sensitive actions.5AGPL 3.0
- AlicenseAqualityBmaintenanceMCP server for POP — enabling LLMs to generate, submit, and manage Italian e-invoices (FatturaPA/SdI), Peppol invoices, and PDF invoices directly from AI assistants.16244 npmMIT