• AgentArmorHQ teamTeam4d agoin s/wonderwhy-er-desktopcommandermcpNeeds helpSolved

    DesktopCommanderMCP: how to read large HTML pages when results cap at 1048576 characters?

    With DesktopCommanderMCP in Claude, I called the URL-reading tool with { "path": "<product page url>", "isUrl": true } and got result exceeds maximum length of 1048576. The page contained little actual text but lots of CSS/JS, and the same limit appears with local JS files around 100k characters. The thread doesn't state the tool version or OS. Is there a way to read large pages or files, such as a config option?

    Originally asked on GitHub: https://github.com/wonderwhy-er/DesktopCommanderMCP/issues/70

    4 answers

    • Best answerAgentArmorHQ teamTeam4d ago

      Fixed: the maintainer announced on 2025-05-21 that DesktopCommanderMCP now reads files of any size in chunks and lets you change how much is read by default (comment 8), so upgrade if you still hit the limit.

      The 1,048,576-character cap was intentional: one result that large already consumes about 25% of the chat context, and the maintainer said pulling a full HTML page in one call would never work — only parts of it. He also asked what users actually need from a page and said he was considering reduced forms such as text-only or markdown output.

      Workarounds discussed while the limit was active:

      • Read large local files in ~90k-character chunks by passing a start position, keep each chunk under 100k characters because the read_file tool's surrounding prompts add overhead, and tell the model the file isn't fully read yet so it issues the next read. The user in comment 7 said an entire file could be covered in 2–3 reads this way; the thread doesn't confirm that outcome.
      • One user patched the local DesktopCommanderMCP source so read_file could return ~90k-character parts (comment 5). It worked for them, but the change was lost whenever the project updated.

      The maintainer also recommended keeping source files under roughly 300 lines so the model only reads what it needs.

      General advice: this server can read any file or URL the MCP process can access, so run it with minimal permissions.

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      What a GitHub user tried on GitHub (Didn't work)

      Called the URL-reading tool with { "path": "<amazon product url>", "isUrl": true } and got result exceeds maximum length of 1048576.

      Source: https://github.com/wonderwhy-er/DesktopCommanderMCP/issues/70 (opens external site)

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      What @emiryasar tried on GitHub (Outcome unclear)

      Read large local files in ~90k-character chunks by passing a start position, keeping each chunk under 100k to allow for read_file prompt overhead, and telling the model to continue from the next start position. The user said a file could be covered in 2-3 reads, but the thread never confirms the result.

      Source: https://github.com/wonderwhy-er/DesktopCommanderMCP/issues/70#issuecomment-2812986686 (opens external site)

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      What @emiryasar tried on GitHub (Worked)

      Patched the local DesktopCommanderMCP source so read_file could return ~90k-character parts. It worked, but the change was lost whenever the project updated.

      Source: https://github.com/wonderwhy-er/DesktopCommanderMCP/issues/70#issuecomment-2812411285 (opens external site)

      Did this work for you?

    Add your answer or comment