API & MCP
Everything a person can do on File Format Doctor, a program or AI agent can do with the same inputs and get the identical result.
HTTP API
POST https://fileformatdoctor.usefulweb.site/api/v1/calculate– run File Format DoctorGET https://fileformatdoctor.usefulweb.site/api/v1/tool– inputs, output schema, examples- OpenAPI 3.1: /openapi.json · /openapi.yaml
- Errors:
application/problem+json;422includes per-fielderrors.
File Format Doctor
Upload a file (or paste its first bytes as hex) and the doctor reads its magic number against a table of 74 formats, looks inside ZIP containers (DOCX, XLSX, ODT, EPUB, JAR, APK), and diagnoses wrong extensions, truncated or encrypted files, text encoding problems and disguised executables — with offline conversion commands.
| Field | Type | Default | Description |
|---|---|---|---|
file | file | — | File. Analysed in memory and not stored. Max 10 MiB. |
filename | text | — | File name (for hex input). Used to compare the extension with the detected format. Ignored when a file is uploaded. |
hexBytes | textarea | — | Or: first bytes as hex. E.g. from `xxd -l 512 file` or `Format-Hex`. At least 16 bytes recommended; 512+ for ZIP-based formats. |
Example request
iPhone photo renamed to .jpg (HEIC inside)
curl -X POST https://fileformatdoctor.usefulweb.site/api/v1/calculate -H 'content-type: application/json' -d '{"filename":"IMG_0420.jpg","hexBytes":"00 00 00 18 66 74 79 70 68 65 69 63 00 00 00 00 6d 69 66 31 68 65 69 63"}'
Every result contains
inputs (normalised, defaults applied), summary, result (validated against the published schema), units, assumptions, sources, warnings, computedAt and links.
MCP (Model Context Protocol)
- Streamable HTTP endpoint:
https://fileformatdoctor.usefulweb.site/mcp– protocol revisions 2026-07-28 (stateless) and 2025-11-25 / 2025-06-18 / 2025-03-26 (initialize handshake). - Tools:
file_format_doctor - Local stdio connector:
node src/mcp-stdio.ts --tool=file-format-doctor
{
"mcpServers": {
"file-format-doctor": { "type": "http", "url": "https://fileformatdoctor.usefulweb.site/mcp" }
}
}