XSN Viewer

Local API and command line of XSN Viewer

Read InfoPath forms, convert whole folders to CSV and migrate their data from your own programs: command line and local HTTP API, on your computer or on a company server, with no forms sent to the cloud.

Download (Windows, macOS, Linux) For AI assistants

Why local

Installation

  1. Download xsnviewer-mcp.zip and extract it to a folder. Node.js 18 or later is required.
  2. Open a terminal in the folder and try: node server.js help.
  3. The first 10 documents are free; after that you need XSN Viewer Pro: node server.js login (email and code).

Command line

node server.js read "C:\forms\leave-request.xml" --template "C:\forms\leave-request.xsn"
node server.js html "C:\forms\leave-request.xml" "C:\out"
node server.js attachments "C:\forms\leave-request.xml" "C:\out\attachments"
node server.js table "C:\forms\archive" --output "C:\out"
node server.js template "C:\forms\leave-request.xsn"

Every command prints its result as JSON. Exit code: 0 success, 1 error (message on stderr), 3 XSN Viewer Pro needed. table reads a whole folder, subfolders included (up to 1000 forms), and with --output also writes forms.csv for Excel.

Local HTTP API

Start the API: it answers on http://127.0.0.1:8767, only to this computer.

node server.js serve

Send the file in the request body (application/octet-stream, file name in the name parameter) or, if the program runs on the same machine, its path as JSON:

curl -X POST "http://127.0.0.1:8767/v1/read_form?name=leave-request.xml" ^
     -H "content-type: application/octet-stream" --data-binary @leave-request.xml

curl -X POST http://127.0.0.1:8767/v1/forms_to_table -H "content-type: application/json" ^
     -d "{\"folder\": \"C:/forms/archive\"}"

In Python:

import requests

with open("leave-request.xml", "rb") as f:
    r = requests.post("http://127.0.0.1:8767/v1/read_form",
                      params={"name": "leave-request.xml"}, data=f,
                      headers={"content-type": "application/octet-stream"})
form = r.json()["result"]
print(form["title"], len(form["fields"]), "fields")

Answers are {"ok": true, "result": …} or {"ok": false, "error": "…", "code": "…"}, with HTTP status 402 when Pro is needed, 404 for a missing file and 413 for a file that is too large.

On a company network server

node server.js serve --host 0.0.0.0 --port 8767 --token A-LONG-SECRET-WORD

Programs send the token with every request (Authorization: Bearer …). Requests coming from web pages and requests with a different server name are refused.

Your own agent or MCP server

The API exposes the same tools as the extension for AI assistants, with JSON schemas at /v1/tools and /openapi.json: connect them to your own agent, to an MCP server of yours, to an automation flow or generate the client for your language. If you use Claude, Cursor or VS Code, the extension is ready.

Licence and price

Command line, local API and the extension for AI assistants are a feature of XSN Viewer Pro: €29, one-off, the same licence that works on the website and in the Windows app. The first 10 documents are free. The licence is personal: one person, on their own devices, also for work.

For several people, shared servers or internal programs there is the Business licence (€149/year).

Servers, several people and in-house programs need the Business licence€149/year · VAT included · renews yearly, cancel any time
Business licence →

Frequently asked questions

Do I need an Internet connection?

No. The command line and the API work on the computer or server where you start them, even offline. The Internet is needed only to activate Pro (email and code); when a connection is available, the licence is also checked about once a week.

Which languages can I use?

Any language that can make an HTTP request and read JSON: Python, C#, Java, PHP, JavaScript, PowerShell, VBA… The OpenAPI description (/openapi.json) lets you generate a client for your language.

Can I build my own MCP server or agent on the API?

Yes. The API exposes the same tools as the AI-assistant extension, with published JSON schemas: use them in your own agent, your own MCP server or an automation flow. If you just want to use it with Claude, Cursor or VS Code, there is already a ready-made extension.

Is it safe on a company network server?

By default it answers only the computer it runs on. On a network, start it with a secret token (--token) that programs send with every request; requests coming from web pages and requests with a different server name are refused. To reach it from outside the internal network, put an HTTPS proxy in front.

Does it run on Linux and Mac?

Yes: you need Node.js 18 or later. It is the same program on Windows, Linux and macOS.