October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk6 min

Build a Safer stdio MCP Fetcher: Cache Pages and Return Sources

A stdio MCP server can fetch and extract pages, but safe network controls, persistent caching, freshness, and citation provenance are application responsibilities.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A stdio MCP server can give an agent a tool for fetching web pages, but the transport does not provide a durable page cache or a citation record for the text returned. Build those as application features: constrain where requests can go, bound the work each fetch can trigger, store freshness and redirect details, and return extracted text with provenance the agent can cite.

What stdio MCP gives you—and what you must build

stdio is a local process transport: an MCP client starts the server as a child process, then exchanges JSON-RPC messages over the process’s standard input and output. The TypeScript SDK v1 server guide documents this pattern with StdioServerTransport, registered tools, and a server connection. Keep protocol messages on stdout; write diagnostics to stderr so logs do not corrupt the stream. The exact imports and APIs are specific to that SDK version, not a guarantee for every SDK major version.

As an Amazon Associate I earn from qualifying purchases.

The MCP basic specification revision dated 2026-07-28 says request processing must not depend on earlier requests. A live stdio connection therefore is not, by itself, a conversation-state or result-cache mechanism. If your application needs state to span requests, give it an explicit identifier and define how that state is stored and retrieved.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A fetch tool is also not automatically a citation system. The protocol and the inspected reference fetch documentation do not establish a canonical citation schema or promise a persistent application-level cache. Your server must decide what to retain, when to consider it fresh, how to identify the source of extracted passages, and what metadata to return.

#1 Best Overall
CanaKit Raspberry Pi 5 Starter Kit PRO - Turbine Black (128GB Edition) (8GB RAM)
  • Includes Raspberry Pi 5 with 2.4Ghz 64-bit quad-core CPU (8GB RAM)
  • Includes 128GB Micro SD Card pre-loaded with 64-bit Raspberry Pi OS, USB MicroSD Card Reader
  • CanaKit Turbine Black Case for the Raspberry Pi 5
  • CanaKit Low Noise Bearing System Fan
  • Mega Heat Sink - Black Anodized

Shape the tool around one bounded job

Start with a narrow, read-only tool such as fetch_page(url). Its job is to retrieve an allowed page and return extracted text with status and provenance—not to browse arbitrary networks, execute page scripts, or follow instructions found in page content.

The official MCP fetch server is a useful reference for the retrieval-and-extraction part: it fetches URLs and converts page content to Markdown. It also supports an output-length limit and a start_index continuation offset when a result is truncated. Its README warns that the server can access local or internal IP addresses, so a reference implementation is not a complete network security boundary for your deployment.

Rank #2
CanaKit Raspberry Pi 4 4GB Starter PRO Kit - 4GB RAM
  • Includes Raspberry Pi 4 4GB Model B with 1.5GHz 64-bit quad-core CPU (4GB RAM)
  • Includes Pre-Loaded 32GB EVO+ Micro SD Card (Class 10), USB MicroSD Card Reader
  • CanaKit Premium High-Gloss Raspberry Pi 4 Case with Integrated Fan Mount, CanaKit Low Noise Bearing System Fan
  • CanaKit 3.5A USB-C Raspberry Pi 4 Power Supply (US Plug) with Noise Filter, Set of Heat Sinks, Display Cable - 6 foot (Supports up to 4K60p)
  • CanaKit USB-C PiSwitch (On/Off Power Switch for Raspberry Pi 4)

Use a safe request flow

Apply policy before a request leaves the process, and again whenever a redirect changes its destination. A practical sequence is:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. Parse and normalize the URL. Reject malformed input, unsupported schemes, and URLs containing embedded credentials. Define which schemes and destination classes your deployment permits.
  2. Resolve and validate the destination. Unless the tool has an explicit private-network use case, reject private and special-use IP addresses. Validate resolved addresses before connecting, and do not let a hostname bypass the policy through DNS resolution.
  3. Fetch within fixed limits. Set connection and total timeouts, a maximum response size, and a redirect-count limit. Reapply destination checks after every redirect rather than trusting the initial URL.
  4. Check the response before extraction. Handle status codes and content types explicitly. Bound parsing and extraction work, and return a clear status for unsupported MIME types or extraction failures.
  5. Apply robots guidance to autonomous requests. The reference fetch server checks robots.txt by default for model-initiated fetches. RFC 9309 describes crawler rules that crawlers are requested to honor; robots.txt is not authorization or an access-control system.
  6. Return a bounded result with its source record. If the extracted text exceeds the response limit, report truncation and provide a continuation offset or another explicit continuation mechanism. Never replace missing or failed page content with invented text.

These checks address different risks: URL policy and address validation constrain where the process can connect; time, byte, redirect, and parsing limits constrain resource use. The 2026-07-28 MCP basic specification also cautions against automatic network dereferencing of JSON Schema references and recommends bounding schema-validation work. That protocol guidance is separate from the destination checks your fetch tool needs.

Choose a cache that matches the job

Neither an open stdio connection nor the Fetch Standard’s HTTP cache behavior defines a durable result cache for your MCP application. The Fetch Standard describes HTTP cache behavior, including using a matching fresh response by default in the relevant cache mode; it does not prescribe your cache’s persistence, key, expiry policy, or stored representation. Choose and document those behaviors yourself.

Approach Durability Privacy and retention Invalidation and concurrency Operational footprint
Short-lived in-memory cache Does not survive a server-process restart. Retained data is limited to process lifetime, but still exists in memory while cached. Simple to expire by age; simultaneous requests and cache updates still need deliberate handling. Simple to add and avoids a separate storage system.
Persistent local cache Can survive process restarts. Requires an explicit retention policy and care over what fetched content is written to disk. Needs defined expiry, invalidation, and behavior when concurrent requests update the same entry. Adds local storage operations and their associated maintenance.

A practical key can combine the normalized requested URL with any request options that change the extracted output. Store only the forms your use case needs—such as the response body, extracted Markdown, or both—and retain enough metadata to tell whether an entry is useful: fetch time, expiry, response status, relevant HTTP validators, and the final URL after redirects. Use ETag or Last-Modified validators when supported by the origin.

Rank #4
Raspberry SC15184 Pi 4 Model B 2019 Quad Core 64 Bit WiFi Bluetooth (2GB)
  • Broadcom BCM2711, quad-core Cortex-A72 (ARM v8) 64-bit SoC @ 1. 5GHz
  • 2. 4 GHz and 5. 0 GHz IEEE 802. 11b/g/n/ac wireless LAN, Bluetooth 5. 0, BLE
  • 2 × USB 3. 0 ports, 2 x USB 2. 0 Ports
  • 2 × micro HDMI ports supproting up to 4Kp60 video resolution
  • Micro SD card slot for loading operating system and data storage

Make freshness visible to callers rather than silently presenting old text as current. Define how the server handles network errors, redirects, no-store directives, expired entries, and revalidation failures. For example, your policy might return a still-available stale entry with an explicit stale status after a failed refresh, or return an error instead; the important point is to make the choice explicit and expose it in the result.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Return text that can be traced to a page

Pair extracted text with a compact provenance object. A useful application-level record can include:

Best Value
CanaKit Raspberry Pi 5 16GB Starter Kit PRO - Turbine Black (128GB Edition) (16GB RAM)
  • Includes Raspberry Pi 5 16GB with 2.4Ghz 64-bit quad-core CPU (16GB RAM)
  • Includes 128GB Micro SD Card pre-loaded with 64-bit Raspberry Pi OS, USB MicroSD Card Reader
  • CanaKit Turbine Black Case for the Raspberry Pi 5
  • CanaKit Low Noise Bearing System Fan
  • Mega Heat Sink - Black Anodized
  • the requested URL and the final URL actually fetched;
  • the fetch timestamp and response status;
  • a page title, when extraction identifies one reliably;
  • the extracted text, with a passage span, section identifier, or offset where feasible;
  • freshness or cache status, including whether a result was truncated.

This is a design recommendation, not a citation format mandated by MCP. Preserve the link between each passage and its source when splitting a long page into chunks; otherwise, a later answer may have text but no reliable way to identify which page supplied it. Instruct the agent to cite only source records returned by the tool and to say when those records do not support a claim.

Page content is untrusted input. Treat text from a fetched page as material to analyze, not as instructions that can override system guidance or the fetch tool’s policy. This is prudent application security guidance; the consulted protocol and fetch documentation do not define a complete prompt-injection defense.

Handle failures as data, not as missing evidence

Give the caller a clear status for blocked destinations, robots restrictions, network timeouts, unsupported content types, extraction errors, and truncation. Include source metadata that is actually available, such as the requested URL or an HTTP status received before an extraction failure. Do not imply a page was read when the request was blocked or failed.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Continuation is useful for large pages, but it shifts a small responsibility to the client: it must retain and pass the correct offset. The reference fetch tool’s start_index demonstrates this option. A single bounded result is simpler for clients; offset-based continuation can preserve access to more of a long document without returning it all at once. In either case, report truncation clearly and keep the offset associated with the same fetched content so a changing page or cache refresh does not silently shift the passage.

Check SDK compatibility before implementing

The MCP fetch-server README specifies MCP Python SDK 1.x, with the constraint mcp>=1.29.0,<2, and notes that SDK 2.0 renamed APIs while a port is in progress. Confirm the repository and SDK compatibility for the version you intend to deploy before copying its setup details. The TypeScript SDK v1 guide is a separate transport example; its API surface should not be assumed to match another language or major version.

Quick Recap

Bestseller No. 1
CanaKit Raspberry Pi 5 Starter Kit PRO - Turbine Black (128GB Edition) (8GB RAM)
CanaKit Raspberry Pi 5 Starter Kit PRO - Turbine Black (128GB Edition) (8GB RAM)
Includes Raspberry Pi 5 with 2.4Ghz 64-bit quad-core CPU (8GB RAM); CanaKit Turbine Black Case for the Raspberry Pi 5
$259.95
Bestseller No. 2
CanaKit Raspberry Pi 4 4GB Starter PRO Kit - 4GB RAM
CanaKit Raspberry Pi 4 4GB Starter PRO Kit - 4GB RAM
Includes Raspberry Pi 4 4GB Model B with 1.5GHz 64-bit quad-core CPU (4GB RAM); Includes Pre-Loaded 32GB EVO+ Micro SD Card (Class 10), USB MicroSD Card Reader
$159.99
Bestseller No. 4
Raspberry SC15184 Pi 4 Model B 2019 Quad Core 64 Bit WiFi Bluetooth (2GB)
Raspberry SC15184 Pi 4 Model B 2019 Quad Core 64 Bit WiFi Bluetooth (2GB)
Broadcom BCM2711, quad-core Cortex-A72 (ARM v8) 64-bit SoC @ 1. 5GHz; 2. 4 GHz and 5. 0 GHz IEEE 802. 11b/g/n/ac wireless LAN, Bluetooth 5. 0, BLE
$92.97
Bestseller No. 5
CanaKit Raspberry Pi 5 16GB Starter Kit PRO - Turbine Black (128GB Edition) (16GB RAM)
CanaKit Raspberry Pi 5 16GB Starter Kit PRO - Turbine Black (128GB Edition) (16GB RAM)
Includes Raspberry Pi 5 16GB with 2.4Ghz 64-bit quad-core CPU (16GB RAM); CanaKit Turbine Black Case for the Raspberry Pi 5
$419.99

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.