microsoft / microsoft/markitdown

MCP server should support converting without returning content to preserve agent context

Open
#1,353 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
186k
Forks
13.7k
Avg merge
1d 4h
Merged PRs (30d)
49

Description

Currently, when using the MarkItDown MCP server to convert PDFs (or other large documents), the entire converted markdown content is returned to the agent/LLM, which consumes valuable context window space. This is problematic when working with large
PDFs that might contain thousands of lines of text.

Problem:

  • Converting a large PDF adds all its content to the LLM's context window
  • This reduces available context for subsequent operations
  • Users may want to convert and save files without needing to see/process the content immediately

Proposed Solution:
Add an option to convert files without returning their content. This could be implemented as:

  1. A parameter like return_content: bool = True on the existing tool
  2. A separate tool that only saves to file and returns metadata (file size, path, success status)

Use Case Example:
Current behavior - all content returned and added to context
result = convert_to_markdown("large_document.pdf") # Returns full markdown content

Desired behavior - convert and save without returning content
result = convert_and_save("large_document.pdf", "output.md", return_content=False)
Returns: {"success": true, "saved_to": "output.md", "size": 150000}

This would allow agents to process large documents without exhausting their context window, while still providing the conversion functionality.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No file or test is named. Start by locating the MCP server's existing convert_to_markdown tool and determine how conversion output is currently returned and saved. The change is done when large-document conversion can avoid returning content while reporting the saved path, size, and success status; the exact parameter or separate-tool design still needs resolution.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.