Digital Invoice Web MCP
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Digital Invoice Web MCPvalidate the latest invoice and export it as PDF"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
digital-invoice-web — Independent Web-MCP Server
A standalone, multi-tenant Model Context Protocol (MCP) server that automates UI-only operations on Digital Invoicing Software using Playwright browser automation, FastAPI, and Central Auth token verification.
1. Architectural Highlights
Zero Coupling: Operates completely independently from any backend invoicing API servers. No shared databases, imports, or session states.
Strict Multi-Tenancy: Every tool call resolves the calling tenant strictly from the Central Auth JWT
tenant_idclaim. Browser contexts, cookies, and credentials are completely isolated per tenant.Session Caching: Playwright
storage_state(cookies and localStorage) is encrypted at rest in Supabase (AES-256-GCM), reusing authenticated sessions to eliminate repetitive logins while falling back cleanly to UI login on session expiration.Concurrency & Resource Protection: Limits active concurrent browser contexts via an asyncio semaphore to protect VPS RAM and CPU.
Related MCP server: Salesforce MCP UI Automation
2. Registering Audience with Central Auth
This server sits behind the Central Auth server and verifies incoming JWT tokens using the official drop-in McpAuthMiddleware.
Open your Central Auth Server Admin Console (or API).
Register a new MCP Server:
Server Name:
Digital Invoice Web MCPAudience:
digital-invoice-web(must matchMCP_AUTH_AUDIENCEin your.env)Server URL:
https://web-mcp.<your-domain>/sse(or Streamable HTTP/mcp)Required Token Claims: Ensure
tenant_idis included in token payloads.
Keep the audience distinct from any other server (e.g.
digital-invoice-api) to prevent cross-token usage.
3. Required Environment Variables
Copy .env.sample to .env and fill in every blank value before running — the server will refuse to start otherwise.
(Reference illustrative values can be inspected in .env.example).
Security-critical settings have no silent defaults; the server will fail fast at startup if any of these are missing, empty, or using placeholder values:
MCP_AUTH_AUDIENCE— Must match exact audience registered in Central Auth.SUPABASE_URL— Supabase project API URL.SUPABASE_SERVICE_ROLE_KEY— Supabase backend service role key.ENCRYPTION_MASTER_KEY— 32-byte AES key generated viapython scripts/generate_master_key.py.
Template (.env.sample):
# Server & Port
HOST=0.0.0.0
PORT=8000
LOG_LEVEL=INFO
# Central Auth (JWKS)
JWKS_URI=https://t91cvjn5boilhilaixggt5y9.s0226.digitalsofts.com/.well-known/jwks.json
MCP_AUTH_AUDIENCE=digital-invoice-web
REVOCATIONS_URI=https://t91cvjn5boilhilaixggt5y9.s0226.digitalsofts.com/revocations
# Supabase (Database & RLS)
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_SERVICE_ROLE_KEY=your-supabase-service-role-key
# Cryptography (AES-256-GCM)
# Generate with: python scripts/generate_master_key.py
ENCRYPTION_MASTER_KEY=0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef
CURRENT_KEY_VERSION=1
# Playwright Browser Automation
PORTAL_BASE_URL=https://www.digitalinvoicingsoftware.com
HEADLESS=true
MAX_CONCURRENT_BROWSERS=3
NAVIGATION_TIMEOUT_MS=20000
ACTION_TIMEOUT_MS=15000
SESSION_TTL_HOURS=244. Supabase Database Setup
Run the SQL migration in your Supabase SQL Editor:
This script provisions:
tenants: Registered organizations and active kill-switch status.tenant_credentials: AES-256-GCM encrypted portal login credentials.tenant_sessions: Encrypted Playwrightstorage_statecaching.tool_call_logs: Execution audit and diagnostic error logging.Row-Level Security (RLS) policies on all tables.
5. Onboarding a New Tenant's Credentials
Option A: Self-Service Web UI (Recommended)
New users can onboard directly through the self-service web interface without needing terminal access or manual tenant UUID handling:
Navigate to
https://<deployed-domain>/onboarding(e.g.http://localhost:8000/onboarding).Step 1 — Central Auth Authentication: Click "Sign in with Central Auth" (or enter a valid token). The server verifies your token and cryptographically resolves your
tenant_idfrom claims. Manual tenant entry is prohibited to prevent tenant spoofing.Step 2 — Credential Configuration & Test: Enter your Company Name, Portal Email, and Password (masked input,
autocomplete="new-password"). Credentials are encrypted with AES-256-GCM. Click "Test Connection" to trigger an instant headless browser login check.Step 3 & 4 — LLM Client Connect: Copy the MCP endpoint (
https://<deployed-domain>/mcp), note that no API key is required (uses OAuth 2.1), and follow the step-by-step guides for Claude, Claude Code, ChatGPT, Cursor, and Antigravity.
Note: All onboarding pages include <meta name="robots" content="noindex, nofollow"> to prevent search engine indexing, and credential endpoints are rate-limited.
Option B: CLI Onboarding Utility (Admin/Developer Alternative)
# 1. Generate an encryption master key (if not already set in .env):
python scripts/generate_master_key.py
# 2. Add tenant credentials to Supabase via CLI:
python scripts/add_tenant.py \
--tenant-id "a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11" \
--company-name "Acme Logistics Inc" \
--email "billing@acme.com" \
--password "SecurePassword123!"(You can also run python scripts/add_tenant.py without arguments for interactive masked input).
6. Local Development & Testing
# 1. Create and activate virtual environment
python -m venv .venv
source .venv/bin/activate # Or on Windows: .venv\Scripts\activate
# 2. Install dependencies & Playwright browser
pip install -r requirements.txt
playwright install --with-deps chromium
# 3. Configure environment
# Copy .env.sample to .env and fill in every blank value before running — the server will refuse to start otherwise
cp .env.sample .env
# 4. Run automated tests
python -m pytest -v tests
# 5. Start local server
python main.pyServer endpoints:
SSE Stream:
http://localhost:8000/sseSSE Messages:
http://localhost:8000/messagesStreamable HTTP:
http://localhost:8000/mcpHealth Check:
http://localhost:8000/health(unauthenticated)
7. Deployment on Coolify (VPS)
Create a new service in your Coolify dashboard: Application -> Dockerfile.
Point Coolify to this repository.
Set your custom subdomain (e.g.
web-mcp.yourdomain.com).Paste all environment variables from Section 3 into Coolify's Environment Variables tab.
Deploy. The Dockerfile automatically handles:
System Chromium dependencies (
playwright install --with-deps chromium).Unprivileged user permissions.
Built-in container health checks on
/health.
8. Exposed MCP Tools
Tool | Category | Description |
| Plumbing | Verifies active session on portal |
| Plumbing | Direct navigation to portal sections |
| Diagnostic | Returns visible DOM text for element discovery |
| Diagnostic | Returns base64 PNG data URL of current view |
| High | Scrapes overview metrics and quick links |
| High | Extracts failed invoices with error reasons |
| High | Applies date-picker filters and returns report table |
| Medium | Checks invoice checkboxes and triggers validation |
| Medium | Edits specified draft invoice field and saves |
| Medium | Fills add-user form and handles confirmation dialog |
| Low | Triggers invoice duplicate action |
| Low | Triggers UI export and captures file download |
9. DOM Selectors & Discovery Workflow
All selectors are isolated in browser/selectors.py.
When testing with a live sandbox account:
Call
tool_check_login_statusto ensure login is operational.If any element differs from candidate selectors, use
tool_get_page_textandtool_take_screenshotto inspect the live markup.Update
browser/selectors.pywith the exact attributes discovered.
This server cannot be deployed
Maintenance
Related MCP Connectors
Browserless MCP — wraps the Browserless headless-Chromium REST API (browserless.io)
1Hosted real Google Chrome MCP with per-user persistent state. Navigate, click, type, screenshot.
Stealth web automation for AI agents. Login, signup, navigate, screenshot.
Stealth web automation for AI agents. Login, signup, navigate, screenshot.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA comprehensive browser automation MCP server using Playwright, offering 50+ tools for page control, element interaction, content extraction, and more across multiple browser engines.13 npm1MIT
- AlicenseBqualityCmaintenanceAutomates Salesforce via browser using Playwright with persistent session. Supports Data Cloud, Setup, and other UI-only areas through generic tools.30MIT
- AlicenseNot gradedqualityAmaintenanceEnables browser automation and smoke testing via Playwright, with tools for navigation, DOM interaction, screenshots, network capture, and more.7 npm2MIT
- FlicenseAqualityBmaintenanceEnables automated testing and demo video creation using Playwright, with login, session orchestration, narration, and video compilation.8-