Registry / devops / mcp-fetch

mcp-fetch

JSON →
library0.1.6jsnpmunverified

A Model Context Protocol (MCP) server providing tools for HTTP requests, GraphQL queries, WebSocket connections, and browser automation using Puppeteer. Current stable version is 0.1.6, released in early 2025. It is designed for AI agents and MCP clients, offering a unified interface for various network operations. Key differentiators include built-in GraphQL introspection, WebSocket management, and headless browser automation via Puppeteer. Requires Node.js >=20.0.0 and ESM-only (no CommonJS).

npm install mcp-fetch
INSTALL
IMPORT
SIG · MCP-FETCH
M
mcp-fetch
devopsjavascriptv0.1.6
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import mcpFetch from 'mcp-fetch'
The package exports a single default export that is the MCP server.
fetch
import { fetch } from 'mcp-fetch'
Named export for the fetch tool function.
graphql
import { graphql } from 'mcp-fetch'
Named export for the GraphQL tool function.

Shows how to import and run the MCP server, and use the fetch and graphql tools directly.

import mcpFetch from 'mcp-fetch'; // Run the MCP server (stdio transport) mcpFetch(); // Alternatively, use individual tools directly: import { fetch, graphql } from 'mcp-fetch'; // Fetch an API const response = await fetch({ url: 'https://api.example.com/data', method: 'GET', headers: { 'Accept': 'application/json' } }); console.log(response); // GraphQL query const query = `query { users { id name } }`; const data = await graphql({ type: 'execute', endpoint: 'https://api.example.com/graphql', query }); console.log(data);
Debug
Known issues
gotchaRequires Node.js >=20.0.0, older versions will throw errors.
fix
Upgrade Node.js to version 20 or higher.
affects: <20.0.0
gotchaPuppeteer browser automation tool requires Chrome installation. Use 'npx puppeteer browsers install chrome'.
fix
Run 'npx puppeteer browsers install chrome' before using browser automation tools.
affects: >=0.0.0
gotchaAll tools return string responses; JSON parsing must be done manually if needed.
fix
Use JSON.parse(response.body) on fetch results if the response is JSON.
affects: >=0.0.0
deprecatedNo deprecations announced yet.
breakingNo breaking changes reported yet.
Errors
Common errors & fixes
Cannot find module 'mcp-fetch'
Package not installed or incorrect import path.
fix
Run 'npm install mcp-fetch' or ensure you are using ESM (type: module in package.json).
Failed to launch the browser process!
Puppeteer Chrome browser not installed.
fix
Run 'npx puppeteer browsers install chrome' and retry.
timeout: Request timed out after 10000ms
Server is slow, network issue, or wrong timeout setting.
fix
Increase the timeout parameter when calling the tool, or check network connectivity.
TypeError: Cannot read properties of undefined (reading 'body')
The response object is not structured as expected; possibly a GraphQL error.
fix
Check the GraphQL endpoint is reachable and query syntax is correct. Use introspection tool first.
Upgrade
Version history
0.1.6latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
11 hits · last 30 days
node
10
Resources
mcp-fetch — npm install mcp-fetch · libregistry