feat(mcp): add file output for large conversions#2202
Conversation
|
This adds an opt-in |
e5d0daf to
a5179c4
Compare
|
Correction to my note yesterday — I said the checks here were green, and that was wrong. The only check that has actually run on this branch is Since there is no CI signal, I ran both workflows' steps locally at the current head, which already contains
The offer from yesterday stands: if a smaller diff is easier to review, I am glad to split the README and workflow changes out and leave this PR as just the |
Summary
Add an opt-in
output_filemode to the MarkItDown MCP tool for conversions that exceed an MCP client's response limit.The default
convert_to_markdown(uri)behavior is unchanged. Whenoutput_fileis set, the tool writes the complete markdown to a new permission-restricted file and returns its absolute path instead of returning the full document through MCP.Motivation
Issue #1332 reports a 51,164-token conversion exceeding a 25,000-token MCP response limit and requests an option to write the result to a file. Returning a short local path avoids the response-size failure while preserving the full converted document. Automatic pagination from #1333 remains separate work.
Safety
0600on POSIX systems (platform-default permissions on Windows), and existing files are never overwritten.Evidence
A strict synthetic large-document evaluation measured the MCP tool result:
Supplementary autoresearch: public dashboard.
Validation
Fixes #1332