Lexware Office MCP Server
An open-source, self-hostable server for the accounting API. Run your own instance, connect it to Claude, and let an agent read your invoices, vouchers, contacts and articles — and (optionally) draft new ones.
接入你的智能体
從發布者安裝。不是 PlugMCP 端點。
遠端 URL 還是本機指令? 兩種安裝方式的差異
來自發布者
An open-source, self-hostable server for the accounting API. Run your own instance, connect it to Claude, and let an agent read your invoices, vouchers, contacts and articles — and (optionally) draft new ones.
Self-hostable MCP server with OAuth 2.1 — connect Claude, ChatGPT, or any other MCP-capable AI to your Lexware Office bookkeeping.
Bring your own Lexware API key — the server is single-tenant per deployment and never stores anyone else's credentials. It runs as a remote HTTP server on any container host, built with the Skybridge framework.
Two authentication methods — choose one:
Setup for both is in the Client support & authentication section below.
Related projects — local (stdio) Lexware MCP servers: lazyants/lexware-mcp-server, JannikWempe/mcp-lexware-office.
⚠️ This brokers real accounting data. Read SECURITY.md, protect your tokens, and note that finalized invoices are legally binding — you are responsible for their tax/legal correctness. No warranty (MIT).
62 tools across three tiers you enable via environment variables, plus one opt-in tool
outside them (upload-file-from-url, see below):
Set LEXWARE_READ_ONLY=true to force read-only (overrides the flags above).
upload-file-from-url — outside the tiers, off by defaultOne tool sits outside this table: upload-file-from-url fetches a file from a share link
server-side and stores it in Lexware, which is how a receipt already sitting in
OneDrive/SharePoint gets into the books without a round trip through the model. It is
enabled with LEXWARE_ENABLE_URL_UPLOAD=true and needs the drafts tier (it will not turn
that tier on for you).
It has its own switch because it has its own risk: it is the only tool that makes this server originate an outbound request to a destination the model chose — server-side request forgery, in the general case. Three things bound it, applied at every redirect hop:
evilsharepoint.com cannot pass as
sharepoint.com. Configure with LEXWARE_UPLOAD_ALLOWED_HOSTS; unset means the
Microsoft file-sharing defaults, a set value replaces them, an empty value blocks
everything.169.254.169.254 metadata endpoint), CGNAT, multicast and reserved space, in every
IPv4, IPv6 and IPv4-in-IPv6 spelling.Only https is accepted, the download is capped at 20 MB and 30 s, and redirects are
followed manually — at most three — so no hop skips the checks.
"Summarize my open invoices for this quarter — who still owes what?"
"Draft an invoice to Müller GmbH for 12 consulting hours at 140 €, due in 14 days."
"Here's the Hetzner receipt for June — file it in the bookkeeping." → see Uploading receipts
"Render invoice RE-2026-0042 as a PDF and give me the deeplink to it."
Attaching a file through a chat has an awkward default: upload-file needs the bytes as
base64 inside the model's tool call, so the whole receipt travels through the
conversation — every byte billed as tokens (base64 adds ~33% on top), the file's contents
sitting in the transcript, and a ~8 MB practical ceiling. The model never needed the bytes;
it only needs the file id that comes back.
The ticket flow routes the bytes around the model:
create-upload-ticket and hands you a
link like https://your-server…/upload/<ticket>.curl
one-liner next to a local file (replace only the FILE= path; nothing else needs to be
installed or edited). The bytes go client → server → Lexware directly.get-upload-result (the curl variant
prints it directly) and carries on with the actual bookkeeping — e.g. create-voucher
with files: [fileId], or linking the receipt to an existing voucher.The ticket is the credential. It is minted only through the authenticated /mcp
endpoint (drafts tier), is 24 random bytes (192-bit) rendered base64url, valid for
15 minutes, single-use, and write-only — it authorizes exactly one file drop and grants no
read access. The /upload/:ticket endpoint sits outside the OAuth gate by design (a
plain browser or curl holds no MCP token); this is the same trust model as a pre-signed
upload URL. Filenames travel as X-Filename-B64 (base64url of the UTF-8 bytes), so
umlauts, dashes, typographic quotes and emoji arrive in the books intact.
The ticket store is in-memory: run a single instance (see Deploy), and note
that a restart voids open tickets — they answer 410, and you simply issue a new one.
The server supports two ways to protect /mcp, chosen by environment:
OAUTH_ISSUER, …) — the recommended path. Use any OAuth provider (e.g.
WorkOS AuthKit, Stytch, Auth0, Clerk; or self-hosted
Keycloak/Zitadel) as the authorization server. This makes the server work as a custom
connector in the Claude app, on claude.ai web, and in ChatGPT, with a real
sign-in. Optionally restrict access with OAUTH_ALLOWED_EMAIL_DOMAINS (enforced
server-side via the token's email / the provider's userinfo endpoint).MCP_AUTH_TOKEN) — the simpler fallback. Works with Claude
Code and Claude Desktop (which let you set a request header). claude.ai can send one
too, but only when an organization admin adds the connector with a static header — a
beta available to a limited set of organizations. Claude sends the value exactly as entered,
so enter Bearer <token>. Every user of that connector then shares one credential, so
prefer OAuth wherever users sign in individually.OAuth takes precedence when OAUTH_ISSUER is set; otherwise the static token is used. With
neither set, the server refuses to start unless MCP_ALLOW_UNAUTHENTICATED=true.
Use the MCP endpoint URL — https://…/mcp, exactly as users will enter it in Claude — in all
three places below. Claude sends that URL (path included) as the RFC 8707 resource when it
asks for a token, and expects this server's protected-resource metadata to name it exactly.
aud, which this server checks (OAUTH_VERIFY_AUDIENCE, on by
default). With WorkOS AuthKit: add it under the MCP
Auth resource indicators in the dashboard — without one, AuthKit ignores the requested
resource and stamps every token with an environment-wide default audience.https://claude.ai/api/mcp/auth_callback and give users the
client ID.OAUTH_ISSUER, OAUTH_RESOURCE=https://…/mcp, and optionally
OAUTH_ALLOWED_EMAIL_DOMAINS. Upload links are built from the same URL without /mcp.https://…/mcp. Claude
discovers the authorization server via the protected-resource metadata and walks you
through sign-in.git clone https://github.com/marselsel/Lexware-MCP-Server && cd Lexware-MCP-Server
cp .env.example .env # set LEXWARE_API_KEY and MCP_AUTH_TOKEN
docker compose up --build # serves on http://localhost:8080/mcp
Generate a strong auth token:
openssl rand -hex 32
Without Docker:
npm install
npm run build
LEXWARE_API_KEY=... MCP_AUTH_TOKEN=... npm start
¹ The server needs either OAUTH_ISSUER (OAuth) or MCP_AUTH_TOKEN (static). It
refuses to start with neither, unless MCP_ALLOW_UNAUTHENTICATED=true.
Add to your MCP config (e.g. ~/.claude.json or the Desktop config):
{
"mcpServers": {
"lexware": {
"type": "http",
"url": "https://<your-host>/mcp",
"headers": { "Authorization": "Bearer <MCP_AUTH_TOKEN>" }
}
}
}
The server is a standard Docker container (Dockerfile) — run it on any host that can serve HTTPS (a VPS, Fly.io, Render, Railway, Cloud Run, Kubernetes, …):
docker build -t lexware-mcp .
docker run -p 8080:8080 --env-file .env lexware-mcp
Production notes:
OAUTH_ISSUER… or MCP_AUTH_TOKEN) — the server fails closed otherwise.GET /status (returns 200).Google Cloud Run: a step-by-step recipe (Secret Manager + gcloud run deploy + custom
domain) is in docs/cloud-run.md.
src/config.ts — env parsing/validation, fail-closed auth, capability tiers.src/auth.ts — constant-time static-bearer middleware on /mcp.src/lexware/ — rate-limited (~2 req/s, token bucket), retry-aware client with safe error
mapping; never retries non-idempotent POSTs on ambiguous failures (no duplicate documents).src/tools/ — tools registered conditionally by tier.src/uploads/ — the single-use ticket store and the raw-body /upload/:ticket routes
(mounted only with the drafts tier; the ticket is the credential).src/server.ts — wires it together on the Skybridge Express server.See CONTRIBUTING.md. npm run dev starts the Skybridge dev server +
DevTools at http://localhost:3000.
MIT © marselsel.
Self-hostable MCP server with OAuth 2.1 — connect Claude, ChatGPT, or any other MCP-capable AI to your Lexware Office bookkeeping.
工具
尚無工具清單。遠端伺服器會在首次健康檢查後取得工具清單。
常見問題
在本頁複製適用於 Cursor、Claude Desktop、Claude Code 或 VS Code 的 stdio 設定。它使用發布者的安裝方式,而不是 PlugMCP 代理伺服器。
這筆記錄未列出必要的環境變數。
Lexware 透過 stdio 在本機執行。
上次檢查時間:2026-10-28。 Self-hostable MCP server with OAuth 2.1 — connect Claude, ChatGPT, or any other MCP-capable AI to your Lexware Office bookkeeping.