<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Leon</title>
    <description>The latest articles on DEV Community by Leon (@warmcoding).</description>
    <link>https://dev.to/warmcoding</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4220188%2F5692268f-f7a0-4c22-80ef-ba0a86fca8bc.png</url>
      <title>DEV Community: Leon</title>
      <link>https://dev.to/warmcoding</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/warmcoding"/>
    <language>en</language>
    <item>
      <title>Building a Remote MCP Server to Handle Large Files (Audio/Video)</title>
      <dc:creator>Leon</dc:creator>
      <pubDate>Sun, 01 Nov 2026 08:12:16 +0000</pubDate>
      <link>https://dev.to/warmcoding/building-a-remote-mcp-server-to-handle-large-files-audiovideo-3b6l</link>
      <guid>https://dev.to/warmcoding/building-a-remote-mcp-server-to-handle-large-files-audiovideo-3b6l</guid>
      <description>&lt;p&gt;The rise of AI agents (like Cursor and Claude Desktop) is incredible. But if you've ever tried to build a custom tool for them to process large files—like a 50MB audio track or a video—you already know the pain. &lt;/p&gt;

&lt;p&gt;LLMs have strict token and payload limits. You can't just pass a local &lt;code&gt;.mp3&lt;/code&gt; file into a prompt.&lt;/p&gt;

&lt;p&gt;In this post, I'll share the architectural pattern I used to build a &lt;strong&gt;Remote MCP (Model Context Protocol) Server&lt;/strong&gt; that allows an AI agent to process heavy media files entirely hands-free.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Core Problem: File Size &amp;amp; Context Switching
&lt;/h2&gt;

&lt;p&gt;When you want an AI to process a file, the naive approach is to base64 encode it and send it. This blows up the context window instantly. &lt;/p&gt;

&lt;p&gt;Alternatively, you can build a local MCP server that reads the file directly. But what if the processing requires heavy GPU compute that your local laptop doesn't have?&lt;/p&gt;

&lt;h2&gt;
  
  
  The Solution: The Async Upload Pattern
&lt;/h2&gt;

&lt;p&gt;To solve this, I designed an MCP server that uses an &lt;strong&gt;asynchronous pipeline&lt;/strong&gt; with presigned URLs. &lt;/p&gt;

&lt;p&gt;Here is the exact flow the AI agent follows:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;get_upload_url&lt;/code&gt;&lt;/strong&gt;: The agent calls this tool. The server returns a presigned URL (e.g., an S3/R2 URL).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Local Upload&lt;/strong&gt;: The agent (or a local script it triggers) uploads the file directly to cloud storage. &lt;em&gt;No file data ever touches the LLM context window.&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;submit_task&lt;/code&gt;&lt;/strong&gt;: The agent tells the server, "Hey, process this uploaded file."&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;check_task_status&lt;/code&gt;&lt;/strong&gt;: The agent polls the server (or uses webhooks) to check when the GPU processing is done.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;get_download_url&lt;/code&gt;&lt;/strong&gt;: Finally, the agent gets a URL to download the processed stems, MIDI, or denoised audio back to the local workspace.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Why This Rocks for Agentic Workflows
&lt;/h2&gt;

&lt;p&gt;This pattern completely decouples the AI's reasoning from the heavy lifting.&lt;/p&gt;

&lt;p&gt;Here is what a prompt looks like in Cursor:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;"Extract the vocals from ./demo.mp3 and save the result locally."&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The AI handles the file system, calls the tools, waits for the GPU, and drops the finished file right back into your project folder. It feels like magic.&lt;/p&gt;

&lt;h2&gt;
  
  
  Implementation Tips
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Use Streamable HTTP&lt;/strong&gt;: If you are building for remote clients like Claude or Cursor, &lt;code&gt;stdio&lt;/code&gt; isn't enough. Host your server and expose it via HTTP.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Handle Polling Gracefully&lt;/strong&gt;: LLMs can get stuck in loops if a task fails. Make sure your &lt;code&gt;check_task_status&lt;/code&gt; returns clear error states, not just "pending".&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Authentication&lt;/strong&gt;: Protect your server with OAuth. Exposing a GPU-backed API without auth is a quick way to get a massive bill.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Open Source Example
&lt;/h2&gt;

&lt;p&gt;I built this entire architecture for &lt;strong&gt;Sonicaura MCP&lt;/strong&gt; (an audio processing engine). It's completely open-source and published in the official MCP Registry if you want to dig into the code or try it out.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Repo&lt;/strong&gt;: &lt;a href="https://github.com/warmcoding/sonicaura-mcp" rel="noopener noreferrer"&gt;warmcoding/sonicaura-mcp&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Registry&lt;/strong&gt;: &lt;a href="https://registry.modelcontextprotocol.io/?q=sonicaura-mcp" rel="noopener noreferrer"&gt;Official MCP Registry&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you are building agents, I'd love to know: &lt;strong&gt;How are you handling large file processing in your MCP servers?&lt;/strong&gt; Let me know in the comments!&lt;/p&gt;

</description>
      <category>ai</category>
      <category>mcp</category>
      <category>openai</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
