MCP
file_analyze
Static analysis of a sample, binary, document or script over MCP. What it detects and extracts, what it returns, the limits and the errors. Nothing in the file is executed.
file_analyze takes one file and analyzes it statically in an isolated sandbox. Use it to triage a malware sample, a binary, an APK, a maldoc or a script before you open it in your own tools. Nothing in the file is executed at any step.
It is one of the tools on the remote and local MCP servers. The Research API runs the same analysis through POST /v1/files.
What it is for
- For malware triage: hashes, entropy, a packed-payload flag, imported functions, capabilities inferred from those imports, known tradecraft strings and executables hidden inside other files.
- For reverse engineering: with ELF and PE you get format, entry point, sections and imported functions. ELF, PE, Mach-O and DEX also get a disassembly preview of the first bytes and the printable strings. APK, JAR and other archives are walked entry by entry.
- For phishing and maldocs: VBA macros come out as text, with auto-run and suspicious calls flagged. PDFs that list JavaScript are flagged. So are polyglots.
- For code review and bug bounty: source files are scanned for dangerous sinks fed by input, such as SQL built by concatenation or a shell command with a variable, and for hardcoded credentials.
Every flag is a heuristic for you to check by hand.
How it works
- Your client sends the file. On the remote server you pass
nameandcontent_base64. Withnotholy mcpyou pass a localpath, and the CLI reads the file on your machine and sends it the same way. - The server checks the size and your organization's upload slots, then stores the file encrypted at rest under your organization.
- A disposable sandbox parses the file. The sandbox has no network. The type comes from the file's bytes, not its name or extension.
- The parser's output is validated outside the sandbox. The extracted text is split into chunks and stored encrypted.
- The call returns when the analysis ends, with the file record and the first 20 chunks. If the analysis is still running after 80 seconds, the call returns the file record with
statusstillprocessing, no chunks and anote, and the analysis carries on. Read the result withGET /v1/files/{id}on the Research API.
Nothing is executed
- The file is parsed, never run. Binaries are never started, scripts are read as text, macros are extracted as text and Python pickles are disassembled without being loaded.
- The sandbox has no network, so nothing in a file can call out.
- Each analysis has its own time and memory limits. A file that hits one ends as
rejectedwith a reason. It never runs longer or takes more memory. - What the parser returns is checked against a fixed schema before anything uses it.
- The result reaches your model marked as untrusted outside data. If a file says "ignore your instructions", that text is content to analyze.
Supported types
kind | Files | What you get |
|---|---|---|
elf, pe | Linux and Windows executables and libraries | SHA-256, entropy, format, entry point, sections, imported functions, capabilities, a disassembly preview and strings |
macho, dex | macOS binaries, Android bytecode | SHA-256, entropy, a disassembly preview and strings |
zip, tar, gzip, bzip2, xz, 7z, rar | Archives, including .docx, .xlsx, .pptx, .jar and .apk | Each entry goes through the same parsers, up to 3 levels deep, plus an index of entries. Office packages are marked office, macro-enabled ones (.docm, .xlsm, .pptm) get the macro scan, and APKs are marked android |
ole | Legacy .doc, .xls, .msi | VBA macros as text, auto-run and suspicious keywords, strings |
pdf | Text per page, object and page counts, a flag when JavaScript is listed | |
text | Source code, scripts, logs, configs | The text in 200-line chunks, with the code and credential scans |
json, xml, html, svg | Structured text and markup | The text. SVG with scripts or event handlers is flagged. DTDs and entities are never expanded |
png, jpeg, gif | Images | Dimensions only. There is no OCR |
pickle | Python pickles | A pickletools disassembly. The pickle is never loaded |
binary | Anything else | Entropy, the first 256 bytes as hex, and strings |
The disassembly preview decodes the first 4 KB of the file as x86-64, up to 200 instructions. There is no decompiler.
What every file is scanned for
Findings land in file.warnings as short codes, with details in file.meta.
| Warning | Meaning | Details in meta |
|---|---|---|
credentials_detected | AWS, GitHub, Slack, Google, SendGrid, Twilio or npm tokens, JWTs, bearer tokens, private keys or password assignments | credential_kinds |
code:<category> | In source files and markup: sql_injection, command_injection, ssrf, path_traversal, code_execution, insecure_deserialization, remote_exec_download, weak_crypto | code_findings, one short evidence snippet per category |
ioc:<name> | Tradecraft strings: meterpreter, mimikatz, cobalt_strike, reverse_shell, powershell_encoded, lolbin_exec, persistence, ransom_destroy, sql_xp_cmdshell, webshell | indicators |
cap:<capability> | In binaries, from the imported functions: process_injection, download_exec, anti_debug, keylogging, dynamic_api_resolution, persistence_registry, service_control, crypto, screen_capture, network | capabilities |
high_entropy_packed | Whole-file entropy of 7.2 or more, typical of packed or encrypted payloads | entropy |
embedded_executable, polyglot | A second executable or container inside the file | embedded, with kind and offset |
vba_macros_present, pdf_javascript_listed, svg_script_found | Active content in a document, extracted or listed, never run | The macro source is in the chunks |
encrypted_entry, symlink_ignored | Archive entries that were skipped | archive_index |
text_truncated, ocr_unavailable, pickle_not_loaded | Limits of the analysis |
Input
| Argument | Where | Meaning |
|---|---|---|
content_base64 | Remote, required | The file in standard base64: A-Z, a-z, 0-9, + and /, padded with =. Line breaks are allowed. Anything else, such as a URL or URL-safe base64, is refused |
name | Remote, optional | The file name, up to 500 characters. A longer name is refused, never cut. Without name, the server uses the request's x-file-name header (URL-encoded for non-ASCII characters, with any path removed), and after that file. The type comes from the bytes. For plain text, the extension decides whether the source-code scan runs |
path | Local only | A path on your machine. notholy mcp reads it and sends name and content_base64 for you |
The remote server cannot read your disk, so path only works through notholy mcp.
Output
The result is JSON, returned as structuredContent.data and as text in content[0].text.
| Field | Meaning |
|---|---|
file.id | The file id |
file.name | The name you sent |
file.status | ready, or rejected with a reason. processing when the call returned before the analysis ended |
file.reason | Why it was rejected, or null |
file.kind | The detected type, from the table above |
file.size, file.sha256 | Size in bytes and the hash of the bytes you sent |
file.warnings | The findings, as codes |
file.meta | Details for the findings and the type: imports, sections, entropy, the disassembly preview, the archive index, page counts |
file.expiresAt | When the file expires, one hour after upload. It is deleted automatically after that |
chunks | The first 20 chunks of extracted text, each with seq, locator and text |
note | Only when the call returned before the analysis ended: where to read the result |
A chunk holds up to 4,000 characters. locator says where the text came from, for example file:lines 1-200, file:page 3, file#strings or a path inside an archive. A file yields up to 5 million characters of text. Past that, text_truncated is set.
MCP returns only the first 20 chunks. For the rest, read the same file id from the Research API with your API key: GET /v1/files/{id}/content?from=20&limit=200.
Example: remote
A small Python file with a SQL query built by concatenation, a shell command with request input and a hardcoded AWS key.
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "file_analyze",
"arguments": {
"name": "app.py",
"content_base64": "aW1wb3J0IG9zCmZyb20gZmxhc2sgaW1wb3J0IHJlcXVlc3QKCmRlZiBnZXRfdXNlcihkYik6CiAgICB1aWQgPSByZXF1ZXN0LmFyZ3NbImlkIl0KICAgIHJldHVybiBkYi5leGVjdXRlKCJTRUxFQ1QgKiBGUk9NIHVzZXJzIFdIRVJFIGlkID0gIiArIHVpZCkKCmRlZiBwaW5nKCk6CiAgICBvcy5zeXN0ZW0oInBpbmcgLWMgMSAiICsgcmVxdWVzdC5hcmdzWyJob3N0Il0pCgpBV1NfS0VZID0gIkFLSUFJT1NGT0ROTjdFWEFNUExFIgo="
}
}
}structuredContent.data in the response:
{
"file": {
"id": "file_01jd2m8k4q9x7c3v5b6n0p1r2s",
"name": "app.py",
"status": "ready",
"reason": null,
"kind": "text",
"size": 245,
"sha256": "13fa852e9d2b46f32120f01169d0dc0c9211871d6545124953d26f909b19d078",
"warnings": ["code:code_execution", "code:command_injection", "code:sql_injection", "credentials_detected"],
"meta": {
"credential_kinds": ["aws_access_key"],
"code_findings": [
{ "category": "code_execution", "evidence": "os.system(" },
{ "category": "command_injection", "evidence": "os.system(\"ping -c 1 \" + request." },
{ "category": "sql_injection", "evidence": "SELECT * FROM users WHERE id = \" + u" }
],
"indicators": []
},
"expiresAt": "2026-11-21T15:04:05.000Z"
},
"chunks": [
{
"seq": 0,
"locator": "file:lines 1-12",
"text": "import os\nfrom flask import request\n\ndef get_user(db):\n uid = request.args[\"id\"]\n return db.execute(\"SELECT * FROM users WHERE id = \" + uid)\n\ndef ping():\n os.system(\"ping -c 1 \" + request.args[\"host\"])\n\nAWS_KEY = \"AKIAIOSFODNN7EXAMPLE\"\n"
}
]
}Example: local
With notholy mcp, the client passes a path and the CLI does the encoding:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": { "name": "file_analyze", "arguments": { "path": "./samples/app.py" } }
}The response is the same as in the remote example. notholy mcp --security-data leaves file_analyze out, so a file only leaves your machine when you ask for it. Use plain notholy mcp to get it.
Limits
- Size: up to 4 MB per call.
file_analyzewaits for the analysis, and the connection is closed after 100 seconds, so a larger file does not fit in one call and is refused with an error that says so. For files up to 32 MB, upload the raw bytes toPOST /v1/fileson the Research API withoutwait=1, then readGET /v1/files/{id}untilstatusisreadyorrejected. - Concurrent uploads: each organization has 20 upload slots and 400 MB in flight at once, shared with the chat and
POST /v1/files. A slot is freed as soon as its analysis ends. - Archives: 3 levels of nesting, 10,000 entries, 2 GB expanded and a 100:1 expansion ratio. Entries over 32 MB are hashed but not parsed.
- Documents: PDFs up to 2,000 pages and 200,000 objects, images up to 50 megapixels, JSON nested up to 128 levels.
- Rate: MCP calls count against your organization's 120 calls a minute. Past that, the server answers HTTP 429 with a
Retry-Afterheader.
Retention and cost
The file and its extracted text are stored encrypted, scoped to your organization. Each file_analyze upload is deleted automatically one hour after upload, with its extracted text. To have one removed sooner, write to [email protected]. This is storage you ask for, separate from inference, which stores no content.
file_analyze needs credit on your account, like the other research tools. It does not use tokens.
file_analyze may be metered per file. When a price is set, each file is charged to your balance; a call that returns an error is not charged. The price, if any, is on the pricing page.
Errors
A file the parser cannot handle is a normal result: file.status is rejected, file.reason says why, and chunks is empty. Common reasons:
reason | What happened |
|---|---|
nesting_limit, too_many_entries, entry_size_limit, extracted_size_limit, compression_ratio_limit | An archive went over a limit. A zip bomb stops here |
zip_malformed, zip_overlapping_entries, tar_malformed | A broken or crafted archive |
pdf_malformed, pdf_too_many_pages, pdf_too_many_objects, pdf_reference_loop | A broken, oversized or looping PDF |
image_too_large, json_too_deep | Over the image or JSON limit |
parser_timeout, resource_limit, memory_limit, recursion_limit, output_too_large | The analysis hit its time, memory or output limit |
parser_crashed, invalid_parser_output, processing_failed | The parser failed on this file |
sandbox_busy, sandbox_unavailable | No sandbox was free. Try again shortly |
These come back as a JSON-RPC error with code -32602 (invalid params) instead of a result:
| Message | Cause |
|---|---|
invalid params: content_base64 is required | No file was sent |
invalid params: content_base64 is not valid base64… | The content is not standard base64 with = padding |
invalid params: name is … characters; the limit is 500 | The name is too long |
invalid params: the file is … MB and file_analyze over MCP takes up to 4 MB… | The file is over the per-call limit. Upload it with POST /v1/files |
A call over the rate limit gets JSON-RPC error -32029, with rate limit: too many research calls this minute… as the message and the seconds to wait in data.retryAfter.
These come back as a tool error, with isError: true and the message as text:
| Message | Cause |
|---|---|
too many uploads for this organization right now; try again shortly | All of your organization's upload slots are in use |
research tools need credit on the account… | No credit on the account |
tool failed | An unexpected failure. No internal detail is returned |
Locally, notholy mcp answers with a JSON-RPC error when the path does not exist or the file is over 4 MB.
When to use it
file_analyzewhen you have the artifact: a sample, a binary, an APK, a document, a script, a bundle or a lockfile.cke_searchwhen you need method rather than evidence: how to test a weakness class, what an ATT&CK technique does, the right tool command. A common flow isfile_analyzefirst, thencke_searchfor the techniques and weaknesses it flagged.web_readwhen the thing you need is a public web page, such as an advisory, a writeup or patch notes.web_readreads pages andfile_analyzereads files you hold.