Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Fix Clipped Full Page Screenshots from MCP Browser

· 5 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

If you use an MCP (Model Context Protocol) browser server to capture full-page screenshots for AI analysis or documentation, you may have noticed the bottom of the page gets cut off. This happens because the screenshot tool captures only the viewport or misreads the page height. This guide walks you through the most common causes and fixes, from simple viewport adjustments to script-level changes.

What You'll Need

  • Access to the MCP server configuration files (usually a JSON or JS file).
  • Basic familiarity with your MCP client (e.g., Claude Desktop, Cursor, or a custom Node.js script).
  • A text editor (VS Code, Notepad++, etc.).
  • Optional: Browser DevTools (F12) to inspect the page height.

Step-by-Step

  1. Identify the MCP server you're using. Common ones include Playwright MCP, Puppeteer MCP, or a custom browser MCP. The fix varies slightly, but the core concepts are the same.
  2. Check your current screenshot command. Most MCP servers have a tool like screenshot or page_screenshot. Look at the parameters it accepts—usually fullPage, clip, or viewport.
  3. Enable full-page capture. If your command has a fullPage option, set it to true. For example, in Playwright MCP, the tool is browser_screenshot with fullPage=true. If you're writing a script, use page.screenshot({ fullPage: true }) in Puppeteer.
  4. Adjust the viewport height. Some servers capture the entire page but the viewport height is set to a default (like 600px). If the page is taller, the screenshot gets clipped. Set the viewport to a large height, e.g., viewport: { width: 1280, height: 10000 } before capturing. In Playwright MCP, you can use browser_set_viewport or pass it in the screenshot call.
  5. Wait for lazy-loaded content. If images or sections load after the scroll, the screenshot may capture before they appear. Add a delay or wait for network idle. In Playwright MCP, use browser_wait with a timeout, or in a script use page.waitForTimeout(2000) or page.waitForNetworkIdle().
  6. Force a reflow. Sometimes the browser miscalculates the page height due to fonts or CSS. In a custom script, call await page.evaluate(() => document.body.scrollHeight) to get the actual height, then set the viewport to that height and capture again.
  7. Use a clip region as a fallback. If full-page still fails, you can manually specify the clip. For example, in Puppeteer: page.screenshot({ clip: { x: 0, y: 0, width: 1280, height: 2000 } }). You'll need to know the page height—use DevTools or the scrollHeight value.
  8. Update your MCP server. If the issue persists, your server version might have a bug. Check the repository for updates. For Playwright MCP, run npm update @playwright/mcp or similar.
  9. Test with a simple page. Create a local HTML file with a long gradient or a tall div. Capture it to see if the fix works. This isolates whether the problem is with the server or the specific website.

Common Mistakes

  • Setting fullPage but not viewport. Some servers ignore fullPage if the viewport is too small. Always set a tall viewport.
  • Using the wrong tool name. MCP servers have multiple tools like browser_screenshot vs page_screenshot. Read the server's documentation to get the exact name.
  • Not waiting for dynamic content. Single-page apps load content after the initial render. A screenshot taken immediately will miss the bottom.
  • Forgetting to reset viewport after. If you set viewport to 10000px, subsequent screenshots will be huge. Reset it to a normal size after capturing.
  • Assuming all pages are the same. Some sites have infinite scroll or fixed elements that confuse the height calculation. Test on multiple pages.

Tips

  • Use a high DPR (device pixel ratio). Set deviceScaleFactor: 2 to get crisp screenshots, but be aware it increases file size.
  • Add a scroll delay. For pages with animations, scroll to the bottom first, wait, then scroll back to top, then capture. This triggers all lazy loads.
  • Check the output format. Some servers return a base64 string that may be truncated in the MCP response. Save to a file instead if possible.
  • Use a headless browser with a fixed width. If the page is responsive, set a desktop width (1280px) to avoid mobile layout that might be shorter.

Troubleshooting

Still clipped after setting fullPage? The page might use a CSS technique that makes the body height 100% but the actual content overflows. Try setting page.setViewport({ width: 1280, height: 800 }) then use page.screenshot({ fullPage: true })—some browsers only capture full page when the viewport is set first.

Getting a blank bottom half? This is often due to lazy-loaded images. Add a wait for network idle or use page.evaluate(() => window.scrollTo(0, document.body.scrollHeight)) then wait 1-2 seconds, then scroll back.

Only the first screen is captured? Your MCP server might not support fullPage at all. Check the server's source code or documentation. If not, you'll need to write a custom script using Puppeteer or Playwright directly.

Error: "Cannot find module" or similar? The MCP server might be outdated. Reinstall it or update your Node.js dependencies.

Page height is infinite? Some pages have a scroll container (like a chat window) that makes the body height small. You may need to target a specific element. In Puppeteer, use await page.screenshot({ clip: { x: 0, y: 0, width: 1280, height: 2000 } }) after manually measuring.

Frequently Asked Questions

Why does my full-page screenshot stop at a certain height?

This happens when the browser's viewport height is smaller than the page, and the fullPage option is not properly implemented. Setting a taller viewport often solves it.

Can I fix this without changing the MCP server code?

Yes, if your MCP client allows passing parameters. For example, in Claude Desktop, you can specify fullPage: true in the tool call. If not, you may need to edit the server's configuration file to set a default viewport.

Does the fix work for all websites?

Mostly, but sites with infinite scroll or complex layouts may still clip. For those, you may need to use a custom script with manual height detection.

What if I'm using a remote MCP server?

The same principles apply, but you may not be able to change the viewport. Contact the server admin or use a local proxy that modifies the screenshot request.

Is there a way to capture a full page without fullPage support?

Yes, you can capture multiple viewport-sized screenshots and stitch them together, but that's more complex. A simpler hack is to set the viewport height to the page's scrollHeight before capturing.

Why does the screenshot include a scrollbar?

Sometimes the scrollbar is part of the page layout. Override the CSS to hide it: page.addStyleTag({ content: '::-webkit-scrollbar{display:none}' }) before capturing.