Lexware Office MCP Server
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., "@Lexware Office MCP ServerShow me all contacts with the name Müller"
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.
Lexware Office MCP Server
An MCP server for Lexware Office (formerly Lexoffice). It lets MCP-capable assistants query and manage contacts, sales documents, vouchers, files, payments, webhooks, and reference data through the Lexware Office public API.
The server uses Code Mode: instead of one MCP tool per API endpoint, it exposes two tools — search to explore a curated Lexware API catalog and execute to run constrained, sandboxed API workflows. This keeps the tool surface small while covering the whole API, including pagination, aggregation, and multi-step reporting in a single call.
Upgrading from 1.x? The legacy tool-per-endpoint server was removed in 2.0.0. See docs/guide.md#migrating-from-1x.
Features
Broad Lexware Office API coverage for read and write workflows
Sales documents: invoices, quotations, order confirmations, credit notes, delivery notes, dunning notices, and down-payment invoices
Contact management: create, read, and update customers and vendors
Bookkeeping: vouchers, posting categories, payments, and file uploads
Reference data: profile, countries, print layouts, payment conditions, recurring templates
Webhooks: create, list, inspect, and delete event subscriptions
Read-only by default: writes require explicit opt-in via environment variable
Related MCP server: lexware-mcp-server
How it works
The server exposes two MCP tools:
search— runs a sandboxed JavaScript async arrow function against a curated OpenAPI-lite Lexware catalog.execute— runs a sandboxed JavaScript async arrow function with one host capability,lexware.request, for relative/v1/...Lexware API calls.
Example execute call:
async () => {
const response = await lexware.request({
method: 'GET',
path: '/v1/contacts',
query: { name: 'Muster', page: 0, size: 10 }
});
return response.data;
}The sandbox does not receive the Lexware API key, Node globals, filesystem access, imports, fetch, or arbitrary network access. lexware.request only accepts relative /v1/... paths and sends the API key from the host process.
Binary-safe file uploads
Uploads are binary-safe via multipart parts with contentPath (host reads a local file from disk), contentBase64 (binary FormData parts), or bodyBase64 (raw binary body). The host reads/decodes and builds Buffer / Blob bodies outside the QuickJS sandbox.
Preferred: contentPath — pass the file's absolute path instead of inlining bytes. Requires LEXWARE_OFFICE_ALLOW_WRITES=true (uploads are writes) and works only when the MCP server runs on the machine that has the file:
async () => {
const response = await lexware.request({
method: 'POST',
path: '/v1/files',
multipart: [
{ name: 'file', contentType: 'application/pdf', contentPath: '/absolute/path/to/receipt.pdf' },
{ name: 'type', value: 'voucher' },
],
});
// response.sent echoes { bytes, parts: [{ name, filename, bytes, sha256 }] } for integrity checks
return { id: response.data?.id, sent: response.sent };
}See docs/guide.md for details and all supported modes.
Configuration
Get a Lexware Office API key
Create an API key at https://app.lexoffice.de/addons/public-api.
Prerequisites
Node.js 22 or higher
LEXWARE_OFFICE_API_KEYenvironment variable
Claude Desktop / MCP config with NPX
Recommended: consume the packaged server
Run the packaged binary from the latest GitHub release (#semver:^2 resolves to the newest v2.x tag and picks up future releases automatically). The package builds itself during GitHub installs via prepare, so users do not need to clone the repository or commit build/ artifacts.
{
"mcpServers": {
"lexware-office": {
"command": "npx",
"args": ["-y", "--package=github:JannikWempe/mcp-lexware-office#semver:^2", "lexware-office"],
"env": {
"LEXWARE_OFFICE_API_KEY": "YOUR_API_KEY_HERE",
"LEXWARE_OFFICE_READ_ONLY": "true"
}
}
}
}Troubleshooting: If the npx command above fails during git-dependency preparation with an error mentioning --before, your npm user config may contain minimum-release-age, which conflicts with npm's internal --before flag. Two fixes:
# Option 1: bypass your user config for this invocation
NPM_CONFIG_USERCONFIG=/dev/null \
npx -y --package=github:JannikWempe/mcp-lexware-office#semver:^2 lexware-office
# Option 2: remove the conflicting setting permanently
npm config delete minimum-release-age --location=userWhen this package is published to npm, replace the GitHub package spec with the npm package name:
"args": ["-y", "--package=mcp-lexware-office", "lexware-office"]Local development from TypeScript source
For local development, you can run the TypeScript source directly with tsx after cloning the repo and installing dependencies:
{
"mcpServers": {
"lexware-office-local": {
"command": "npx",
"args": ["-y", "tsx", "/absolute/path/to/mcp-lexware-office/src/index.ts"],
"env": {
"LEXWARE_OFFICE_API_KEY": "YOUR_API_KEY_HERE",
"LEXWARE_OFFICE_READ_ONLY": "true"
}
}
}
}Use this source-based setup only for development. End users should prefer the packaged binary above.
Write safety
The server is read-only by default. POST, PUT, PATCH, and DELETE requests are blocked unless you explicitly opt in:
{
"LEXWARE_OFFICE_ALLOW_WRITES": "true"
}LEXWARE_OFFICE_READ_ONLY=true is a hard block that wins over ALLOW_WRITES=true:
{
"LEXWARE_OFFICE_READ_ONLY": "true"
}See docs/guide.md#permissions for the detailed permission model.
Docker
Build the image:
docker build -t mcp-lexware-office:latest -f src/Dockerfile .Run it:
docker run -i --rm \
-e LEXWARE_OFFICE_API_KEY \
-e LEXWARE_OFFICE_READ_ONLY=true \
mcp-lexware-office:latestBuild and test
npm run build
npm testDocumentation
License
MIT. See LICENSE.
Available Tools
2 toolsexecuteA
Execute a constrained Lexware Office API workflow by running a JavaScript async arrow function.
Use search first when you need endpoint/domain guidance; do not guess Lexware paths from memory. The sandbox exposes no API key, filesystem, process, imports, fetch, or arbitrary network access.
Available globals:
declare const spec: LexwareApiCatalog; declare const lexware: { request<T = unknown>(input: LexwareRequest): Promise<LexwareResponse>; json(input: LexwareRequest): Promise; paginate<T = unknown>(input: LexwareRequest, options?: { maxPages?: number }): Promise<T[]>; requireNumber(row: unknown, fieldPath: string): number; requireMoney(row: unknown, fieldPath: string): number; sumMoney(rows: unknown[], fieldPath: string): number; formatMoney(cents: number, currency?: string): string; };
type LexwareRequest = { method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE'; path: string; // relative /v1/... only; no absolute URLs or // hosts query?: Record<string, string | number | boolean | Array<string | number | boolean> | null | undefined>; body?: unknown; // JSON by default; string when rawBody=true (UTF-8 encoded, NOT binary-safe) bodyBase64?: string; // raw binary body as base64; the host decodes it outside the sandbox multipart?: MultipartPart[]; // multipart/form-data uploads (e.g. POST /v1/files); host builds FormData contentType?: string; rawBody?: boolean; accept?: string; }; // At most one of body, bodyBase64, or multipart per request.
type MultipartPart = { name: string; value?: string; // plain text form field contentBase64?: string; // binary part content as base64; host decodes it contentPath?: string; // absolute file path on the MCP server machine; host reads the file directly — preferred for local files (no base64, no size blowup) filename?: string; // defaults to the contentPath basename contentType?: string; }; // Exactly one of value, contentBase64, or contentPath per part.
type LexwareResponse<T = unknown> = { ok: boolean; status: number; statusText: string; data?: T; text?: string; truncated?: boolean; contentType: string; headers: Record<string, string>; errorCategory?: string; retryAfterSeconds?: number; operation?: { operationId: string; method: string; pathTemplate: string; summary: string }; request: { method: string; path: string; query: Record<string, string[]> }; sent?: { bytes: number; sha256?: string; parts?: Array<{ name: string; filename?: string; bytes: number; sha256: string }> }; // echo of uploaded binary payloads for integrity checks };
lexware.request returns all HTTP responses, including non-OK, as LexwareResponse. Check response.ok/status for recovery logic, or use lexware.json(...) / lexware.paginate(...) when you want non-OK or non-JSON responses to throw.
This server is read-only by default. POST, PUT, PATCH, and DELETE are blocked unless the server is started with LEXWARE_OFFICE_ALLOW_WRITES=true. Setting LEXWARE_OFFICE_READ_ONLY=true is a hard block that overrides ALLOW_WRITES. Check spec.info.writesEnabled to branch before attempting a write.
Example:
async () => { const response = await lexware.request({ path: '/v1/contacts', query: { page: 0, size: 5 } }); return { status: response.status, request: response.request, data: response.data }; }
File upload example (bookkeeping Beleg). Never inline file bytes in code — pass the file's absolute path via contentPath and the host reads it from disk:
async () => { const response = await lexware.request({ method: 'POST', path: '/v1/files', multipart: [ { name: 'file', contentType: 'application/pdf', contentPath: '/absolute/path/to/receipt.pdf' }, { name: 'type', value: 'voucher' }, ], }); return { status: response.status, id: response.data?.id, sent: response.sent }; }
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | JavaScript async arrow function to execute a constrained Lexware API workflow | |
| maxRequests | No | Maximum number of Lexware API requests this execution may perform. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full responsibility and delivers extensively. It discloses sandbox limitations (no API key, filesystem, process, imports, fetch, or arbitrary network access), write-blocking behavior based on server flags, response handling (even non-OK responses are returned for lexware.request), and file upload precautions (never inline bytes; use contentPath). This goes far beyond minimal disclosure.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is long but well-structured and front-loaded: purpose, then search guidance, sandbox constraints, type definitions, and examples. Every section earns its place, though the extensive TypeScript type declarations make it denser than typical. It is appropriately sized for a code-execution tool, but less concise than shorter counterparts.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity and lack of an output schema, the description is nearly complete. It covers sandbox restrictions, write permissions, request/response shapes, and provides examples illustrating expected return patterns. However, it does not explicitly state that the arrow function's return value becomes the tool's output, nor does it mention execution timeouts or error handling for thrown exceptions, leaving minor gaps.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema already describes both parameters with 100% coverage. The description adds substantial meaning for the 'code' parameter by defining the available globals (lexware, spec), request/response types, multipart rules, and two complete examples. It does not add much for maxRequests beyond the schema's description, but the code semantics are richly enhanced.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description opens with 'Execute a constrained Lexware Office API workflow by running a JavaScript async arrow function,' specifying a clear verb, resource, and mechanism. It distinguishes from siblings by explicitly directing users to 'search first when you need endpoint/domain guidance,' clarifying that this tool executes rather than explores.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides explicit usage guidance: 'Use search first when you need endpoint/domain guidance; do not guess Lexware paths from memory.' This not only tells when to use the tool but also names the alternative (search) and the condition for switching. It further clarifies constraints like read-only defaults and checking spec.info.writesEnabled before writes.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
searchA
Search the curated Lexware Office API catalog by running a JavaScript async arrow function.
Use this before execute to discover endpoints, request shapes, response notes, workflows, and domain-specific caveats.
Available global:
declare const spec: LexwareApiCatalog;
Useful starting points:
spec.info.domainIndex: compact map from business domains to endpoint lists
spec.info.writesEnabled: whether this server currently allows POST/PUT/PATCH/DELETE — check before planning writes
spec.paths: path -> method -> operation catalog with params, requestBody, responses, examples, capabilities, docsUrl
spec.workflows: curated recipes for reporting, sales documents, files/uploads, webhooks, and API quirks
spec.info.voucherStatusSemantics and financeReportingSemantics: finance/status guidance for revenue/Umsatz/profit questions
Sandbox: no network, filesystem, process, fetch, imports, or API key. Return JSON-serializable data; console logs are captured.
Examples:
async () => Object.entries(spec.info.domainIndex) .filter(([name, domain]) => [name, ...domain.tags].some(value => value.toLowerCase().includes('contact'))) .map(([name, domain]) => ({ name, ...domain }))
async () => { const op = spec.paths['/v1/voucherlist']?.get; return { summary: op?.summary, parameters: op?.parameters, notes: op?.notes, examples: op?.examples }; }
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | JavaScript async arrow function to search the Lexware API catalog |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden. It thoroughly discloses the sandbox limitations ('no network, filesystem, process, fetch, imports, or API key'), return expectations ('Return JSON-serializable data; console logs are captured'), and the available global 'spec' object, providing strong behavioral context.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is long but well-structured with bullet points and code blocks. Each section serves a purpose: purpose, usage, global, starting points, sandbox, and examples. It is front-loaded and scannable despite its length.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity and the absence of an output schema, the description is remarkably complete. It explains the execution environment, data structures, use cases, constraints, and examples, which fully prepares an agent to select and invoke the tool correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Although the schema already describes the 'code' parameter, the description goes far beyond by documenting the structure of the 'spec' global, listing key properties like domainIndex and workflows, and providing two complete code examples. This enriches the parameter meaning substantially.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's function: 'Search the curated Lexware Office API catalog by running a JavaScript async arrow function.' It names the specific resource (catalog) and differentiates from the sibling 'execute' by explicitly prescribing use before it.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicit guidance is provided: 'Use this before execute to discover endpoints, request shapes, response notes, workflows, and domain-specific caveats.' It also offers practical starting points and reminds the agent to check 'writesEnabled' before planning writes, effectively telling when and how to use the tool.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
2 tool updates
v2.0.0- First observed
execute - First observed
search
TDQS
Scored across 2 tools
The two tools have clearly distinct purposes: search is for discovering API endpoints and workflows, while execute is for making actual API requests. The descriptions explicitly state to use search before execute, eliminating ambiguity.
Both tool names are single lowercase verbs ('search' and 'execute'), following a consistent imperative style. There is no mixing of conventions or confusing patterns.
With only 2 tools, the server is at the low end of what might be considered adequate. However, the design intentionally uses a minimal pair of discovery and execution, which is reasonable for the broad API access it provides.
The search tool exposes the full API catalog, including workflows and domain guides, while execute can perform any documented API operation. Together they cover the complete lifecycle of discovering and interacting with the Lexware Office API, leaving no functional gaps.
Maintenance
Related MCP Connectors
An MCP server that provides read access to your cloud storage providers, bank accounts and more.
API-first CRM for LLMs - contacts, companies, deals and activities over a native MCP server.
Secure MCP server for exploring incwo CRM data, documents, and email workflows.
MCP server for the PDFGate API. Generate PDFs, manage documents and handle e-signatures.
Related MCP Servers
- FlicenseBqualityDmaintenanceMCP server for DACH accounting automation. Connect AI assistants to sevDesk and Lexoffice — create invoices, manage contacts, handle bookings and vouchers for German-speaking businesses.1527-
- AlicenseBqualityAmaintenanceMCP server for the Lexware Office API that enables management of invoices, contacts, articles, vouchers, and more through the Model Context Protocol.662986Functional Source , Version 1.1, MIT Future
- AlicenseAqualityCmaintenanceA standalone MCP server for the bexio REST API, enabling interaction with bexio resources like contacts, invoices, and projects through natural language from any MCP client.2111MIT
- AlicenseAqualityAmaintenanceMCP server for the bexio API, enabling interaction with contacts, sales, accounting, projects, and more through 35 tools. Supports both PAT and OAuth authentication with read-only mode and tool group filtering.35113MIT