ScreenshotNeo

BlogHow-to

How to Fix an MCP Website Screenshot Tool That Cannot Open Indian Government Portals

Diagnose MCP connection, browser, portal, session, and timeout failures step by step, then choose the right fix for what the browser actually shows.

By the ScreenshotNeo team4 October 20268 min read

An MCP screenshot tool can fail before it reaches a portal, during navigation, while the portal loads its scripts or session, or only when the image is captured. Find the failing stage before changing settings: confirm the MCP connection, navigate to the portal’s official URL, inspect the final URL and page state, check browser capabilities and session behavior, then compare with a regular browser. Increase a timeout only if the page is still making progress. A specific root cause cannot be identified without the portal URL, MCP server and client, and exact error.

This guide uses Playwright MCP as an example of an MCP browser tool; it may not be the tool you are using. Its documentation describes navigation, screenshots, network inspection, console access, and browser storage features. Playwright MCP documentation

1. Confirm the MCP connection and browser startup

  1. Check that the MCP server process is running and that your client is configured to connect to it.
  2. Call a simple browser tool action, such as opening a public page. If the tool is unavailable or the browser cannot start, the failure is before portal access.
  3. Read the complete tool response and client logs. Record whether the error is a connection/configuration error, browser startup error, navigation error, or screenshot error.

Do not diagnose a portal from a tool call that never opened a browser. Follow the setup instructions for your MCP server and client; for Playwright MCP, see its setup and usage documentation.

2. Navigate to the exact official portal URL

Start from the portal’s canonical link, including its full host and path. Confirm the destination using an official government portal or directory rather than relying only on a search result. GIGW identifies .gov.in and .nic.in as government domain indicators; a domain suffix by itself does not explain why navigation failed. GIGW guidelines

Record both the requested URL and the final URL after redirects. A redirect to a login page, maintenance page, access-denied page, or another host is useful diagnostic evidence. GIGW’s scope covers government websites at central, state, district, and local levels. GIGW scope and objective

3. Capture and inspect the state the browser reached

Take a screenshot even if the page looks broken. Then inspect the accessible snapshot, console messages, and network requests if your MCP server exposes them. Classify the observed state before changing browser options:

  • Blank page: check whether navigation completed, scripts failed, or the page is still loading.
  • Loading indicator: inspect whether requests continue to make progress and whether the page ever reaches a stable state.
  • Redirect: record the final URL and determine whether it is expected, such as a login or session route.
  • CAPTCHA or access denied: treat this as an access check, not a rendering defect by default.
  • Browser or network error: compare the same URL from another browser and network environment.
  • Page visible but screenshot missing: investigate the capture action and its target or output handling separately from navigation.

Playwright MCP documents browser screenshots, snapshots, network inspection, and console access. Availability and command names vary across MCP servers. Playwright MCP capabilities

4. Check JavaScript, CSS, cookies, and session state

Confirm that the browser context has JavaScript enabled, stylesheets are not blocked, and cookies can be stored. Portal requirements differ. For example, the Income Tax Department says JavaScript is required for portal transactions, cookies are needed for login and transactions, and disabling CSS prevents an appropriate user experience. Those statements describe that portal, not every Indian government site. Income Tax Department browser support

If the page relies on login or a prior session, a fresh automated browser context may behave differently from your normal browser. Inspect cookie and storage state if appropriate, and compare a fresh context with an authorized signed-in session. Do not copy session cookies into logs or share them. Playwright MCP describes browser storage and cookie features in its documentation. Playwright MCP documentation

When a CAPTCHA, login requirement, or explicit denial appears, use the portal’s intended human or official access process. Do not try to defeat the challenge. GIGW discusses CAPTCHA and cookie considerations, including accessibility. GIGW accessibility guidance

5. Compare the MCP browser with a regular browser

Open the same URL in an ordinary browser. Keep the URL and, where possible, network route constant. Compare:

  1. Whether both reach the same final URL.
  2. The visible page, error, or challenge.
  3. JavaScript, CSS, and cookie behavior.
  4. Browser name and version.
  5. Session and cookie state.
  6. Proxy, VPN, firewall, or network route.
  7. Elapsed time until the page reaches a stable state.

If the regular browser succeeds while the MCP browser fails, focus on browser version, context settings, session state, and network route. If both fail, investigate portal availability, the portal’s access policy, or the network. GIGW recommends testing government websites across browsers and versions, operating systems, connection speeds, and screen resolutions. GIGW guidelines

6. Adjust navigation timeouts only when the page is progressing

A timeout says that an operation did not finish within its limit; it does not say why. Playwright MCP documents a default navigation timeout of 60,000 milliseconds and configuration options for changing it. Check the current documentation and your MCP server’s actual configuration because options can vary by version. Playwright MCP configuration options

Extend the navigation timeout when observations show the portal is still loading or completing slow requests. A longer timeout is unlikely to help when the host refuses the connection, a request is blocked, an access check is shown, or the browser cannot reach the network. Avoid setting an extremely long global timeout: it can make a genuinely failed job appear stuck and tie up workers.

7. Troubleshooting common symptoms

Symptom Likely layer What to check and do
MCP tool is missing or returns a connection error Client/server connection Check that the server is running and the client configuration points to the right command or endpoint. Confirm the browser tool works on a simple page.
Browser fails before navigation Browser startup Check the MCP server’s browser installation and startup logs. Portal settings cannot fix a browser that never starts.
Navigation times out while requests continue Slow navigation or page readiness Inspect network activity and elapsed time. If progress continues, raise the navigation timeout for this operation and wait for a meaningful readiness condition.
Navigation times out with refused or failed requests Network or access Compare from a regular browser and another permitted network environment. A longer timeout will not repair a refused connection.
Page is blank or scripts report errors Page scripts or browser context Check console output, JavaScript settings, blocked resources, and whether the portal depends on a supported browser feature.
Page styling is missing or layout is unusable CSS or resource blocking Ensure CSS and required resources are not disabled or blocked. Some portals rely on styling for usable navigation.
Login repeats or the portal loses state Cookies or session Check whether cookies persist in the browser context and whether the portal requires a fresh authorized login. Compare with a normal browser session.
CAPTCHA or access-denied page appears Portal access check Use the intended human or official access route, or contact portal support. Do not attempt to bypass the challenge.
Regular browser works but MCP browser does not Environment difference Compare browser version, context configuration, storage, proxy, and network route.
Page is visible but no image is returned Screenshot action or output handling Check the MCP tool’s screenshot parameters, target page or element, and returned image content separately from navigation.

8. Make the failure easier to reproduce

For a useful bug report, record the portal URL (remove private query parameters), MCP server and version, client, browser and version, operating system, network or proxy context, exact tool call, complete error, final URL, elapsed time, and a screenshot of the state reached. Include relevant console or network errors after removing credentials, cookies, personal data, and other secrets. This evidence helps distinguish a portal issue from an MCP configuration or environment issue.

Performance, reliability, and cost considerations

  • Performance: capture only after an explicit readiness condition when available. Waiting for every network request to stop may be a poor fit for pages that keep analytics or polling connections open. Use the narrowest wait that reliably represents the content you need.
  • Reliability: preserve the observed error state and final URL. Retry only transient failures, and avoid rapid repeated navigation to a portal that is denying or challenging access.
  • Session safety: treat browser storage and cookies as credentials. Keep them out of screenshots, source control, and shared logs.
  • Cost: self-hosted or locally run browser automation consumes your compute and maintenance time. A hosted screenshot API trades browser setup for service usage; check its billing rules and whether failed navigations are charged before adopting it.

Or skip the browser setup

For a straightforward website screenshot, ScreenshotNeo provides a one-request API. It is a website screenshot API and MCP server for developers. Cookie and consent banners are accepted before capture, and 60+ known consent platforms, newsletter popups, and chat widgets can be removed; each step can be turned off. Bot checks and CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, with the outcome identified in response headers. AI agents can use its MCP server through tools including take_screenshot, get_page_info, and capture_pdf. Every plan includes the features; 1,000 screenshots a month are free with no card, and paid plans start at $5 for 3,000.

Install ScreenshotNeo or use its API documentation for the full request options.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://incometax.gov.in -o shot.webp
import requests

r = requests.get(
    "https://api.screenshotneo.com/v1/shot",
    params={"access_key": "YOUR_API_KEY", "url": "https://incometax.gov.in"},
    timeout=90,
)
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({
  access_key: 'YOUR_API_KEY',
  url: 'https://incometax.gov.in'
});
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
if (!res.ok) throw new Error(`Screenshot request failed: ${res.status}`);
await Bun.write('shot.webp', res);

Replace the example host with the portal’s verified official URL. If the portal requires a human login or displays an access challenge, use its intended access process. ScreenshotNeo’s plans are Free: 1,000 per month; Starter: $5 for 3,000; Growth: $15 for 15,000; Pro: $39 for 60,000; Scale: $99 for 250,000; and Business: $249 for 1,000,000. Yearly billing gives two months free.

Create a free ScreenshotNeo account for 1,000 screenshots a month with no card.

FAQ

Why can’t my MCP browser open a .gov.in website?

The domain alone does not identify the cause. Check MCP connectivity, browser startup, the final URL, page errors, session behavior, network access, and any access check.

Should I disable JavaScript or cookies to make the page load?

Usually, do not disable features without evidence. Some portal flows depend on them. Check the specific portal’s browser support guidance; the Income Tax Department, for example, says its transactions require JavaScript and its login and transaction flows use cookies.

Can I fix a CAPTCHA with a longer timeout?

No. A timeout does not remove an access challenge. Use the portal’s intended human or official route.

What information is needed to identify the exact cause?

The portal URL, MCP server and client, browser version, exact error, final URL, and a screenshot or sanitized console/network evidence are the useful starting details.