The MCP Fetch server provides versatile tools for web interaction and automation:
HTTP Requests: Full control over methods, headers, body, and fetch options
GraphQL Operations: Execute queries, mutations, and schema introspection to list operations or get type details
WebSocket Management: Connect to URLs, send/receive messages, list active connections, and close them
Browser Automation: Use Puppeteer to launch/close browsers (headless or non-headless), create/close pages, list active instances, and execute JavaScript code
Built-in Documentation: Access comprehensive documentation detailing all tools, parameters, and usage examples
Provides browser automation capabilities using Puppeteer, enabling control of browsers, page creation, and execution of arbitrary JavaScript for web scraping, testing, and development tasks.
MCP Fetch
A Model Context Protocol server providing tools for HTTP requests, GraphQL queries, WebSocket connections, and browser automation using Puppeteer.
Configuration
Add this to your MCP settings configuration file:
Installation
If the puppeteer tool is not working, remember to install the chrome browser
Features
HTTP Requests: Perform HTTP requests with full control over method, headers, and body
GraphQL Client: Execute queries/mutations and introspect GraphQL schemas
WebSocket Management: Connect, send, receive messages, and manage WebSocket connections
Browser Automation: Launch browsers, create pages, and execute JavaScript using Puppeteer
Comprehensive Docs: AI-ready documentation via
get-rules
tool
Available Tools
HTTP Requests
fetch
Perform HTTP requests with full control over method, headers, body, and other fetch options.
Parameters:
url
(string, required): The URL to fetch frommethod
(string, optional): HTTP method (GET, POST, PUT, DELETE, PATCH, HEAD, OPTIONS). Default: "GET"headers
(object, optional): HTTP headers as key-value pairsbody
(string, optional): Request body for POST, PUT, PATCH, DELETEmode
(string, optional): Request mode (cors, no-cors, same-origin)credentials
(string, optional): Credentials mode (omit, same-origin, include)cache
(string, optional): Cache mode (default, no-store, reload, no-cache, force-cache, only-if-cached)redirect
(string, optional): Redirect handling (follow, error, manual). Default: "follow"referrer
(string, optional): Referrer URLreferrerPolicy
(string, optional): Referrer policytimeout
(number, optional): Request timeout in millisecondsfollowRedirects
(boolean, optional): Whether to follow redirects. Default: true
Returns:
Example Usage:
GraphQL
graphql
Execute GraphQL queries and mutations with support for variables and custom headers.
Parameters:
action
(object, required): Action to perform with discriminated union:For execution:
type
: "execute"endpoint
(string): GraphQL endpoint URLquery
(string): GraphQL query or mutation stringvariables
(object, optional): Variables for the query/mutationheaders
(object, optional): HTTP headers (e.g., authorization)operationName
(string, optional): Operation name when query contains multiple operationstimeout
(number, optional): Request timeout in milliseconds. Default: 30000
For introspection:
type
: "introspect"endpoint
(string): GraphQL endpoint URLheaders
(object, optional): HTTP headersaction
(string): What to fetch: "full-schema", "list-operations", or "get-type"typeName
(string, optional): Type name (required when action is "get-type")useCache
(boolean, optional): Use cached schema if available. Default: truecacheTTL
(number, optional): Cache time-to-live in milliseconds. Default: 300000
Returns: For execution:
For introspection:
Example Usage:
WebSocket
socket
Manage WebSocket connections - connect, send, receive messages, list connections, and close.
Parameters:
action
(object, required): Action to perform with discriminated union:For listing connections:
type
: "list"
For connecting:
type
: "connect"url
(string): WebSocket URL (ws:// or wss://)protocols
(array, optional): WebSocket subprotocolsheaders
(object, optional): HTTP headers for connectionautoReconnect
(boolean, optional): Auto-reconnect on disconnection. Default: falsemaxReconnectAttempts
(number, optional): Max reconnection attempts. Default: 5reconnectInterval
(number, optional): Base reconnect interval in ms. Default: 1000messageHistoryLimit
(number, optional): Max messages to keep. Default: 100
For sending:
type
: "send"socketId
(string): Socket connection IDmessage
(string or object): Message to sendbinary
(boolean, optional): Send as binary data. Default: false
For receiving:
type
: "receive"socketId
(string): Socket connection IDaction
(string): "get-latest", "get-all", or "get-since"since
(string, optional): ISO timestamp for get-sinceclearAfterRead
(boolean, optional): Clear queue after reading. Default: false
For closing:
type
: "close"socketId
(string): Socket connection IDcode
(number, optional): Close code. Default: 1000reason
(string, optional): Close reason. Default: "Normal closure"
Returns: For connect:
Example Usage:
Browser Automation
puppeteer
Control browsers and pages with Puppeteer - launch/close browsers, open/close pages, execute JavaScript, and more.
Parameters:
action
(object, required): Action to perform with discriminated union:For listing browsers:
type
: "list-browsers"
For launching browser:
type
: "launch-browser"headless
(boolean, optional): Run in headless mode. Default: falsewidth
(number, optional): Window width. Default: 1280height
(number, optional): Window height. Default: 720url
(string, optional): URL to navigate to after launch
For closing browser:
type
: "close-browser"browserId
(string): Browser instance ID
For listing pages:
type
: "list-pages"
For opening page:
type
: "open-page"browserId
(string): Browser instance IDurl
(string, optional): URL to navigate to
For closing page:
type
: "close-page"pageId
(string): Page ID
For executing code:
type
: "exec-page"pageId
(string): Page IDsource
(string): JavaScript code to execute (has access topage
object)
Returns: For launch-browser:
Example Usage:
Documentation
get-rules
Get comprehensive documentation about this MCP server.
Parameters:
random_string
(string): Dummy parameter for no-parameter tools
Returns: Complete documentation including schemas, use cases, and best practices.
Use Cases
API Integration
Use the fetch
tool to integrate with REST APIs, webhooks, and external services.
GraphQL Operations
Use the graphql
tool for type-safe API queries and schema exploration.
Real-time Communication
Use the socket
tool for WebSocket connections, chat applications, and live data feeds.
Web Automation
Use the puppeteer
tool for web scraping, automated testing, and browser interactions.
Best Practices
General
Always handle errors - Wrap operations in try-catch blocks
Use appropriate timeouts - Set reasonable timeouts for network operations
Clean up resources - Close connections when done (browsers, websockets)
Follow rate limits - Respect API rate limits and add delays if needed
HTTP & GraphQL
Use proper headers - Set Content-Type, Accept, and Authorization headers
Handle redirects appropriately - Consider security implications
Validate responses - Check status codes and response formats
Use HTTPS - Always prefer secure connections
WebSockets
Implement reconnection logic - Use autoReconnect for critical connections
Handle connection states - Check readyState before sending
Process messages efficiently - Clear message queues regularly
Use appropriate close codes - Follow WebSocket close code standards
Browser Automation
Use headless mode for automation - Better performance and resource usage
Wait for elements - Use waitForSelector before interacting
Handle navigation - Use waitForNavigation after clicks
Limit concurrent browsers - Avoid resource exhaustion
Clean up pages and browsers - Prevent memory leaks
Installation
Dependencies are automatically installed when running the server. If you encounter issues:
Limitations
Browser instances and WebSocket connections are stored in memory and lost on restart
Each browser instance consumes significant system resources
WebSocket message history is limited by messageHistoryLimit
GraphQL introspection cache is temporary and cleared on restart
File uploads are not directly supported (use base64 encoding in body)
License
MIT
local-only server
The server can only run on the client's local machine because it depends on local resources.
Enables browser automation using Puppeteer through the MCP interface. Allows launching browsers, creating pages, and executing arbitrary JavaScript for web scraping, testing, and debugging tasks.
Related MCP Servers
- AsecurityAlicenseAqualityEnables browser automation with Puppeteer, supporting navigation, form interactions, and connection to active Chrome instances for comprehensive web page interaction.Last updated -82,829256MIT License
- -securityAlicense-qualityEnables browser automation using the Selenium WebDriver through MCP, supporting browser management, element location, and both basic and advanced user interactions.Last updated -326260MIT License
- -securityAlicense-qualityA Model Context Protocol server that enables LLMs to automate web browsers using Puppeteer, allowing navigation, screenshots, form filling, and JavaScript execution in a real browser environment.Last updated -2MIT License
- AsecurityFlicenseAqualityA Model Context Protocol server that provides browser automation capabilities using Puppeteer with configurable options through environment variables, enabling LLMs to interact with web pages, take screenshots, and execute JavaScript in a browser environment.Last updated -73