streamable-httpMITupdated 1mo ago
A Model Context Protocol server that exposes the InvoiceXML API to AI agents. Covers Factur-X, ZUGFeRD, XRechnung, UBL / CII, and Peppol BIS Billing 3.0.
What can you do with InvoiceXML?
InvoiceXML MCP Server
A Model Context Protocol server that exposes the InvoiceXML API to AI agents. Covers Factur-X, ZUGFeRD, XRechnung, UBL / CII, and Peppol BIS Billing 3.0.
The same codebase runs in two deployment shapes, selected at startup by one environment variable:
| Mode | Who runs it | Auth |
|---|---|---|
| Self-hosted | You, on your own machine or server | A single API key in env or appsettings.json |
| Hosted | InvoiceXML, on its own infrastructure | OAuth 2.1 + Dynamic Client Registration against invoicexml.com |
Both run the same binary; only the configuration differs. The repository is platform-independent ā it knows nothing about where or how you host it.
Architecture
+----------------------+ ProjectReference +----------------------+
| InvoiceXml.Mcp.Core | -------------------> | InvoiceXml.Mcp.Host |
| (SDK: client+tools) | | (the deployable) |
+----------------------+ +----------------------+
InvoiceXml.Mcp.Core is a small, transport-agnostic SDK:
IInvoiceXmlClientā typed client over the public REST APIHttpInvoiceXmlClientā the only implementation; consumes anHttpClientfromIHttpClientFactoryInvoiceXmlClientOptionsā base URL, timeout (no auth)AddInvoiceXmlMcpCore(IServiceCollection, IConfiguration)ā DI entry point; returns theIHttpClientBuilderso the host attaches auth as aDelegatingHandler
The SDK never sees credentials. The host applies them through the HTTP pipeline. That seam is what lets one codebase serve both deployment modes.
InvoiceXml.Mcp.Host is an ASP.NET Core 10 app:
- Reads
Mcp:AuthMode(ApiKeyorOAuth) at startup - Wires the matching
DelegatingHandleronto the Core HTTP client viaAddHostAuth(...) - Serves the MCP endpoint at
POST /, a human-friendly welcome page atGET /, and/health
Adding a new auth mode = one arm in AuthExtensions.cs plus a small folder under
Auth/<Mode>/. Adding a new tool = one [McpServerTool] class. Nothing else changes.
Repository layout
invoicexml-mcp/
āāā src/
ā āāā InvoiceXml.Mcp.Core/ # the SDK: client, models, tools
ā ā āāā Enums/ Interfaces/ Models/ Options/ Services/ Tools/ Extensions/
ā āāā InvoiceXml.Mcp.Host/ # the deployable host
ā āāā Auth/{ApiKey,OAuth}/ # the two auth modes
ā āāā Configuration/
ā āāā Program.cs
ā āāā appsettings.json # safe defaults, no secrets
āāā tests/
ā āāā InvoiceXml.Mcp.Core.Tests/
ā āāā InvoiceXml.Mcp.Host.Tests/
āāā Directory.Build.props # repo-wide MSBuild defaults
āāā Directory.Packages.props # Central Package Management
āāā global.json # pins the .NET SDK
āāā InvoiceXml.Mcp.slnx
Running locally
You need a .NET 10 SDK and an InvoiceXML API key.
# 1. Provide your API key (pick one):
# A. dotnet user-secrets (recommended ā kept outside the repo)
dotnet user-secrets --project src/InvoiceXml.Mcp.Host set "Mcp:ApiKey:Value" "your-key"
# B. environment variable
$env:INVOICEXML_API_KEY = "your-key"
# 2. Run
dotnet run --project src/InvoiceXml.Mcp.Host
GET http://localhost:5004/ shows a welcome page in a browser; the MCP endpoint is
POST http://localhost:5004/; GET /health returns { "status": "ok" }.
Configuration
{
// Required in OAuth mode. The public origin where this MCP server is reachable.
// Used in the protected-resource metadata response.
"McpUri": "https://mcp.example.com",
"InvoiceXml": {
"BaseUrl": "https://api.invoicexml.com", // override for staging / local
"Timeout": "00:01:40"
},
"Mcp": {
"AuthMode": "ApiKey", // "ApiKey" | "OAuth"
"ApiKey": {
"Value": "" // ApiKey mode: NEVER commit a real key
},
"OAuth": {
"AuthorizationServer": "https://invoicexml.com",
"ScopesSupported": [ "api_token.read" ]
},
"FileInput": { // limits for the URL-fetch input mode
"MaxFileSizeBytes": 5242880,
"FetchTimeout": "00:00:30"
}
}
}
Environment variable equivalents (double underscore = nesting):
| Variable | Maps to |
|---|---|
INVOICEXML_API_KEY |
Mcp:ApiKey:Value (friendly alias) |
Mcp__ApiKey__Value |
Mcp:ApiKey:Value |
Mcp__AuthMode |
Mcp:AuthMode (ApiKey or OAuth) |
Mcp__OAuth__AuthorizationServer |
Mcp:OAuth:AuthorizationServer |
McpUri |
McpUri (root-level) |
InvoiceXml__BaseUrl |
InvoiceXml:BaseUrl |
OAuth mode
When Mcp:AuthMode=OAuth the host stops accepting a static API key and instead:
- Returns 401 with
WWW-Authenticate: Bearer resource_metadata="ā¦"for anyPOST /that has no Bearer token. - Serves
GET /.well-known/oauth-protected-resourcepointing MCP clients atinvoicexml.comas the authorization server. - Forwards the inbound Bearer token verbatim on every outbound call to the InvoiceXML API (the API is the source of truth for token validity; the MCP server does not validate tokens locally).
The dance an MCP client performs:
client ā MCP POST / ā 401 + resource_metadata
client ā /.well-known/oauth-protected-resource ā { authorization_servers: [invoicexml.com] }
client ā invoicexml.com/.well-known/oauth-authorization-server
ā { authorize, token, register endpoints }
client ā invoicexml.com/oauth/register ā client_id + client_secret (DCR)
client ā invoicexml.com/oauth/authorize ā user consents, gets code
client ā invoicexml.com/oauth/token ā access_token (= user's API key)
client ā MCP POST / + Authorization: Bearer ā 200, tool call flows through
Deployment
The host is a standard ASP.NET Core app ā run it however you run .NET services (systemd, a container, a PaaS, etc.; the repo doesn't prescribe one):
dotnet publish src/InvoiceXml.Mcp.Host -c Release -o ./publish
# then run ./publish/InvoiceXml.Mcp.Host on your host
Set configuration via environment variables on the host (never commit secrets):
ASPNETCORE_ENVIRONMENT=ProductionMcp__AuthMode=ApiKey(orOAuth)Mcp__ApiKey__Value=ā¦/INVOICEXML_API_KEY=ā¦(ApiKey mode)McpUri=https://your-public-urlandMcp__OAuth__AuthorizationServer=https://invoicexml.com(OAuth mode)
Terminate TLS at your reverse proxy / load balancer and forward to the host's HTTP port. The server is stateless, so you can run multiple instances behind a load balancer.
License
MIT ā see LICENSE.
Install
Add InvoiceXML to your client. Pick the one you use.
claude mcp add --transport http invoicexml https://mcp.invoicexml.comcodex mcp add invoicexml --url https://mcp.invoicexml.com{
"mcpServers": {
"invoicexml": {
"url": "https://mcp.invoicexml.com"
}
}
}Add to `~/.cursor/mcp.json`, or `.cursor/mcp.json` for a single project.
{
"servers": {
"invoicexml": {
"type": "http",
"url": "https://mcp.invoicexml.com"
}
}
}Add to `.vscode/mcp.json` in your workspace.
{
"mcpServers": {
"invoicexml": {
"url": "https://mcp.invoicexml.com"
}
}
}Add to `claude_desktop_config.json`, then restart Claude Desktop.
{
"mcpServers": {
"invoicexml": {
"serverUrl": "https://mcp.invoicexml.com"
}
}
}Add to `~/.codeium/windsurf/mcp_config.json`.
Score
39 / 100
Incomplete
- Documentation25/25
- Maintenance16/25
- Trust16/20
- Capability0/15
- Install experience12/15
- Documents what it does and how to connect
- Has a resolvable package or endpoint
- Exposes at least one tool, prompt or resource
- README has substantive content
- Includes a code example
- Documents its configuration
- Mentions credentials or security posture
- Last commit 42 days ago
- Has a release history
- Repository is not archived
- Licensed MIT
- Namespace verified in the official MCP registry
- Claimed by its owner
- Published under an organisation
- 0 tool(s) documented
- Provides prompt templates
- Provides resources
- 6 documented install method(s)
- Published to a package registry
- Offers a hosted endpoint ā no local install
Version history
| Versions | Published |
|---|---|
| 1.0.0Latest | May 29, 2026 |