Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@j0hanz/fetch-url-mcp

Package Overview
Dependencies
Maintainers
1
Versions
83
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@j0hanz/fetch-url-mcp

An MCP server that fetches web pages and converts them to clean, readable Markdown.

latest
Source
npmnpm
Version
2.0.2
Version published
Maintainers
1
Created
Source

Fetch URL MCP Server

npm version License

Install in VS Code Install in VS Code Insiders Install in Visual Studio

Add to LM Studio Install in Cursor

An MCP server that fetches web pages and converts them to clean, readable Markdown.

Overview

This server takes a URL, fetches the page, and strips away everything you don't need — navigation, sidebars, banners, scripts — leaving just the main content as Markdown. It's perfect for feeding into LLMs, giving them the distilled essence of a page without the noise. It also recognizes GitHub, GitLab, Bitbucket, and Gist URLs and rewrites them to fetch the raw content directly.

By default it runs over stdio. Pass --http if you need a proper HTTP endpoint with auth, rate limiting, TLS, and session support.

Key Features

  • HTML to Markdown — Turns any public web page into clean, readable Markdown with metadata like title, url, contentSize, and truncated.
  • Smart URL handling — Recognizes GitHub, GitLab, Bitbucket, and Gist page URLs and rewrites them to raw-content endpoints before fetching.
  • Task mode — Big or slow pages can run as async MCP tasks with progress updates, instead of blocking. In HTTP mode, tasks are bound to the authenticated caller rather than a single MCP session, so they can be resumed after reconnecting as the same authenticated subject. Polling task state exposes task summaries; numeric progress remains out-of-band via notifications/progress.
  • Self-documenting — Includes an internal://instructions resource and a get-help prompt so clients know how to use it.
  • HTTP mode — Optionally serves over Streamable HTTP with host/origin validation, bearer or OAuth auth, rate limiting, health checks, and TLS.

Web Client

A browser-based client is available if you want to use the server without any MCP setup.

Live app · Source code

Requirements

  • Node.js >= 24
  • Docker (optional) — only needed if you want to run the container image

Quick Start

Add this to your MCP client config:

{
  "mcpServers": {
    "fetch-url-mcp": {
      "command": "npx",
      "args": ["-y", "@j0hanz/fetch-url-mcp@latest"]
    }
  }
}

Client Configuration

Install in VS Code

Install in VS Code

Add to .vscode/mcp.json:

{
  "servers": {
    "fetch-url-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@j0hanz/fetch-url-mcp@latest"]
    }
  }
}

Or install via CLI:

code --add-mcp '{"name":"fetch-url-mcp","command":"npx","args":["-y","@j0hanz/fetch-url-mcp@latest"]}'

For more info, see VS Code MCP docs.

Install in VS Code Insiders

Install in VS Code Insiders

Add to .vscode/mcp.json:

{
  "servers": {
    "fetch-url-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@j0hanz/fetch-url-mcp@latest"]
    }
  }
}

Or install via CLI:

code-insiders --add-mcp '{"name":"fetch-url-mcp","command":"npx","args":["-y","@j0hanz/fetch-url-mcp@latest"]}'

For more info, see VS Code Insiders MCP docs.

Install in Cursor

Install in Cursor

Add to ~/.cursor/mcp.json:

{
  "mcpServers": {
    "fetch-url-mcp": {
      "command": "npx",
      "args": ["-y", "@j0hanz/fetch-url-mcp@latest"]
    }
  }
}

For more info, see Cursor MCP docs.

Install in Visual Studio

Install in Visual Studio

For solution-scoped setup, add this to .mcp.json at the solution root:

{
  "servers": {
    "fetch-url-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@j0hanz/fetch-url-mcp@latest"]
    }
  }
}

For more info, see Visual Studio MCP docs.

Install in Goose

Add to ~/.config/goose/config.yaml on macOS/Linux or %APPDATA%\Block\goose\config\config.yaml on Windows:

extensions:
  fetch-url-mcp:
    name: fetch-url-mcp
    cmd: npx
    args: ['-y', '@j0hanz/fetch-url-mcp@latest']
    enabled: true
    type: stdio
    timeout: 300

For more info, see Goose extension docs.

Install in LM Studio

Add to LM Studio

Add to ~/.lmstudio/mcp.json on macOS/Linux or %USERPROFILE%/.lmstudio/mcp.json on Windows:

{
  "mcpServers": {
    "fetch-url-mcp": {
      "command": "npx",
      "args": ["-y", "@j0hanz/fetch-url-mcp@latest"]
    }
  }
}

For more info, see LM Studio MCP docs.

Install in Claude Desktop

Add to claude_desktop_config.json:

{
  "mcpServers": {
    "fetch-url-mcp": {
      "command": "npx",
      "args": ["-y", "@j0hanz/fetch-url-mcp@latest"]
    }
  }
}

For more info, see Claude Desktop MCP docs.

Install in Claude Code

Use the CLI:

claude mcp add fetch-url-mcp -- npx -y @j0hanz/fetch-url-mcp@latest

For project-scoped config, Claude Code writes .mcp.json with:

{
  "mcpServers": {
    "fetch-url-mcp": {
      "command": "npx",
      "args": ["-y", "@j0hanz/fetch-url-mcp@latest"],
      "env": {}
    }
  }
}

For more info, see Claude Code MCP docs.

Install in Windsurf

Add to ~/.codeium/windsurf/mcp_config.json:

{
  "mcpServers": {
    "fetch-url-mcp": {
      "command": "npx",
      "args": ["-y", "@j0hanz/fetch-url-mcp@latest"]
    }
  }
}

For more info, see Windsurf MCP docs.

Install in Amp

Add to ~/.config/amp/settings.json on macOS/Linux, %USERPROFILE%\.config\amp\settings.json on Windows, or .amp/settings.json for workspace-scoped config:

{
  "amp.mcpServers": {
    "fetch-url-mcp": {
      "command": "npx",
      "args": ["-y", "@j0hanz/fetch-url-mcp@latest"]
    }
  }
}

Or install via CLI:

amp mcp add fetch-url-mcp -- npx -y @j0hanz/fetch-url-mcp@latest

For more info, see Amp docs.

Install in Cline

Open the MCP Servers panel, choose Configure MCP Servers, and add this to cline_mcp_settings.json:

{
  "mcpServers": {
    "fetch-url-mcp": {
      "command": "npx",
      "args": ["-y", "@j0hanz/fetch-url-mcp@latest"]
    }
  }
}

For more info, see Cline MCP docs.

Install in Codex CLI

Use the CLI:

codex mcp add fetch-url-mcp -- npx -y @j0hanz/fetch-url-mcp@latest

Or add this to ~/.codex/config.toml or project-scoped .codex/config.toml:

[mcp_servers.fetch-url-mcp]
command = "npx"
args = ["-y", "@j0hanz/fetch-url-mcp@latest"]

For more info, see Codex MCP docs.

Install in GitHub Copilot

Add to .vscode/mcp.json:

{
  "servers": {
    "fetch-url-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@j0hanz/fetch-url-mcp@latest"]
    }
  }
}

For more info, see GitHub Copilot MCP docs.

Install in Warp

Open Personal > MCP Servers in Warp, choose + Add, and either add a CLI server with:

  • command: npx
  • args: ["-y", "@j0hanz/fetch-url-mcp@latest"]

Or paste this JSON snippet when using Warp's multi-server import flow:

{
  "mcpServers": {
    "fetch-url-mcp": {
      "command": "npx",
      "args": ["-y", "@j0hanz/fetch-url-mcp@latest"]
    }
  }
}

For more info, see Warp MCP docs.

Install in Kiro

Use Kiro's MCP Servers panel or the Add to Kiro install flow. Kiro stores workspace-scoped MCP config in .kiro/settings/mcp.json and user-scoped config in ~/.kiro/settings/mcp.json.

For this server, use:

  • command: npx
  • args: ["-y", "@j0hanz/fetch-url-mcp@latest"]

For more info, see Kiro MCP docs.

Install in Gemini CLI

Add to ~/.gemini/settings.json:

{
  "mcpServers": {
    "fetch-url-mcp": {
      "command": "npx",
      "args": ["-y", "@j0hanz/fetch-url-mcp@latest"]
    }
  }
}

For more info, see Gemini CLI MCP docs.

Install in Zed

Add to ~/.config/zed/settings.json:

{
  "context_servers": {
    "fetch-url-mcp": {
      "command": "npx",
      "args": ["-y", "@j0hanz/fetch-url-mcp@latest"],
      "env": {}
    }
  }
}

For more info, see Zed MCP docs.

Install in Augment

Use the Augment Settings panel and either add the server manually or choose Import from JSON:

{
  "mcpServers": {
    "fetch-url-mcp": {
      "command": "npx",
      "args": ["-y", "@j0hanz/fetch-url-mcp@latest"]
    }
  }
}

For more info, see Augment MCP docs.

Install in Roo Code

Use Roo Code's MCP Servers UI or marketplace flow.

For this server, use:

  • command: npx
  • args: ["-y", "@j0hanz/fetch-url-mcp@latest"]

For more info, see Roo Code docs.

Install in Kilo Code

Use Kilo Code's MCP Servers UI or marketplace flow.

For this server, use:

  • command: npx
  • args: ["-y", "@j0hanz/fetch-url-mcp@latest"]

For more info, see Kilo Code docs.

Use Cases

  • Documentation for LLMs — Grab a docs page, blog post, or reference article as Markdown and pass it straight into a context window.
  • Repository content — Hand it a GitHub, GitLab, or Bitbucket URL and it resolves the raw content endpoint. Works with Gists too.
  • Slow or large pages — Task mode lets big fetches run in the background while sending monotonic progress updates back to the client, while tasks/get exposes the latest task summary fields such as statusMessage, createdAt, lastUpdatedAt, ttl, and pollInterval.

Architecture

[MCP Client]
  ├─ stdio -> `src/index.ts` -> `startStdioServer()` -> `createMcpServer()`
  └─ HTTP (`--http`) -> `src/index.ts` -> `startHttpServer()` -> HTTP dispatcher
       ├─ `GET /health`
       ├─ `GET /.well-known/oauth-protected-resource`
       ├─ `GET /.well-known/oauth-protected-resource/mcp`
       └─ `POST|GET|DELETE /mcp`

`createMcpServer()`
  ├─ registers tool: `fetch-url`
  ├─ registers prompt: `get-help`
  ├─ registers resources:
  │    - `internal://instructions`
  ├─ enables capabilities: logging, resources, prompts, tasks
  └─ installs task handlers, log-level handling, and shutdown cleanup

`fetch-url` execution
  ├─ validate input with `fetchUrlInputSchema`
  ├─ normalize URL and block local/private targets unless allowed
  ├─ rewrite supported code-host URLs to raw endpoints when possible
  ├─ fetch content via the shared pipeline
  ├─ transform HTML into Markdown in the transform worker path
  └─ validate `structuredContent` with `fetchUrlOutputSchema`

Request Lifecycle

[Client] -- initialize {protocolVersion, capabilities} --> [Server]
[Server] -- {protocolVersion, capabilities, serverInfo} --> [Client]
[Client] -- notifications/initialized --> [Server]
[Client] -- tools/call {name, arguments} --> [Server]
[Server] -- {content: [{type, text}], structuredContent?, isError?} --> [Client]

MCP Surface

Tools

fetch-url

Takes a URL and returns Markdown. Read-only, with no JavaScript execution. Supports running as a background MCP task for large or slow pages. In task mode, tasks/get and tasks/list expose task summaries including status, statusMessage, createdAt, lastUpdatedAt, ttl, and pollInterval; numeric progress remains out-of-band via notifications/progress.

ParameterTypeRequiredDescription
urlstringyesTarget URL. Max 2048 chars.

You get text content back by default. If output validation passes, the response also includes structuredContent with typed fields: url, resolvedUrl, finalUrl, title, metadata, markdown, fetchedAt, contentSize, and truncated. A true value for truncated means the content hit a server-side size limit.

To opt into progress updates, include _meta.progressToken in the tool call. The token may be a string or number, and the server may emit monotonic notifications/progress updates while the fetch runs.

To run the tool in task mode, include params.task = { ttl?: <ms> }. tasks/result waits until the task reaches a terminal status and then returns the stored output or a terminal error payload for cancelled or failed tasks. Task summaries and final results include _meta["io.modelcontextprotocol/related-task"] = { "taskId": "<server-task-id>" }.

{
  "method": "tools/call",
  "params": {
    "name": "fetch-url",
    "arguments": {
      "url": "https://example.com/docs"
    },
    "task": {
      "ttl": 300000,
      "pollInterval": 1000
    },
    "_meta": {
      "progressToken": 7
    }
  }
}
1. [Client] -- tools/call {name: "fetch-url", arguments} --> [Server]
2. [Server] -- dispatch("fetch-url") --> [src/tools/fetch-url.ts]
3. [Handler] -- validate(fetchUrlInputSchema) --> normalize / fetch / transform
4. [Handler] -- validate(fetchUrlOutputSchema) --> assemble content + structuredContent
5. [Server] -- result or tool error --> [Client]

Resources

ResourceURIMIME TypeDescription
fetch-url-mcp-instructionsinternal://instructionstext/markdownGuidance for using the Fetch URL MCP server.

Prompts

PromptArgumentsDescription
get-helptopic?Return Fetch URL server instructions: workflows, task mode, and error handling. Optional values: capabilities, workflows, constraints, errors.

MCP Capabilities

CapabilityStatusNotes
completionsconfirmedAdvertised in createServerCapabilities().
loggingconfirmedAdvertised in createServerCapabilities().
resourcesconfirmedStatic instruction resource is registered during server startup. Subscription and list-changed support are not advertised.
promptsconfirmedget-help is registered during server startup.
tasksconfirmedAdvertised in createServerCapabilities() and backed by registered task handlers plus optional tool task support.
progress notificationsconfirmedOpt-in via _meta.progressToken. Tool execution reports monotonic notifications/progress updates during fetch and transform stages.
task status updatesconfirmednotifications/tasks/status is emitted when task status changes and TASKS_STATUS_NOTIFICATIONS=true.

Tool Annotations

AnnotationValue
readOnlyHinttrue
destructiveHintfalse
idempotentHinttrue
openWorldHinttrue

Structured Output

The tool declares an outputSchema and includes structuredContent in the response when validation passes. Clients that support structured output get typed data directly; the rest use the text fallback.

Configuration

All configuration is through environment variables. For basic stdio usage, nothing needs to be set.

HTTP Server

VariableDefaultNotes
HOST127.0.0.1Bind address. Non-loopback bindings also require ALLOW_REMOTE=true.
PORT3000Listening port for --http.
ALLOW_REMOTEfalseMust be enabled to bind to a non-loopback interface.
ALLOWED_HOSTSemptyAdditional allowed Host and Origin values.
SERVER_MAX_CONNECTIONS0Optional connection cap.
SERVER_TRUST_PROXYfalseTrust X-Forwarded-For / Forwarded for client IP resolution.
SERVER_HEADERS_TIMEOUT_MSunsetOptional Node server tuning.
SERVER_REQUEST_TIMEOUT_MSunsetOptional Node server tuning.
SERVER_KEEP_ALIVE_TIMEOUT_MSunsetOptional keep-alive tuning.
SERVER_KEEP_ALIVE_TIMEOUT_BUFFER_MSunsetOptional keep-alive tuning buffer.
SERVER_MAX_HEADERS_COUNTunsetOptional header count limit.
SERVER_BLOCK_PRIVATE_CONNECTIONSfalseEnables inbound private-network protections when not trusting a proxy.

Authentication & OAuth

VariableDefaultNotes
ACCESS_TOKENSunsetComma- or space-separated static bearer tokens.
API_KEYunsetAlternate static token source for header auth.
OAUTH_ISSUER_URLunsetEnables OAuth mode when combined with the other OAuth URLs.
OAUTH_AUTHORIZATION_URLunsetOptional explicit authorization endpoint.
OAUTH_TOKEN_URLunsetOptional explicit token endpoint.
OAUTH_REVOCATION_URLunsetOptional OAuth revocation endpoint.
OAUTH_REGISTRATION_URLunsetOptional OAuth dynamic client registration endpoint.
OAUTH_INTROSPECTION_URLunsetRequired for OAuth token introspection.
OAUTH_REQUIRED_SCOPESemptyRequired scopes enforced after auth.
OAUTH_CLIENT_IDunsetOptional introspection client ID.
OAUTH_CLIENT_SECRETunsetOptional introspection client secret.

TLS

VariableDefaultNotes
SERVER_TLS_KEY_FILEunsetEnable HTTPS when set together with SERVER_TLS_CERT_FILE.
SERVER_TLS_CERT_FILEunsetTLS certificate path.
SERVER_TLS_CA_FILEunsetOptional custom CA bundle.

Fetching

VariableDefaultNotes
ALLOW_LOCAL_FETCHfalseAllows loopback and private-network fetch targets.
FETCH_TIMEOUT_MS15000Network fetch timeout in milliseconds.
USER_AGENTfetch-url-mcp/<version>Override the outbound user agent string.

Tool Output

VariableDefaultNotes
MAX_INLINE_CONTENT_CHARS00 means no explicit inline truncation limit.

Tasks

VariableDefaultNotes
TASKS_MAX_TOTAL5000Total retained task capacity, including completed/cancelled tasks until they expire.
TASKS_MAX_PER_OWNER1000Per-owner retained task cap, clamped to the total cap.
TASKS_STATUS_NOTIFICATIONSfalseEnables status notifications for tasks.
TASKS_REQUIRE_INTERCEPTIONtrueRequires interception for task-capable tool execution.

Transform Workers

VariableDefaultNotes
TRANSFORM_CANCEL_ACK_TIMEOUT_MS200Cancellation acknowledgement timeout.
TRANSFORM_WORKER_MODEthreadsWorker execution mode.
TRANSFORM_WORKER_MAX_OLD_GENERATION_MBunsetOptional worker memory limit.
TRANSFORM_WORKER_MAX_YOUNG_GENERATION_MBunsetOptional worker memory limit.
TRANSFORM_WORKER_CODE_RANGE_MBunsetOptional worker memory limit.
TRANSFORM_WORKER_STACK_MBunsetOptional worker stack size.

Content Cleanup

VariableDefaultNotes
FETCH_URL_MCP_EXTRA_NOISE_TOKENSemptyExtra noise-removal tokens.
FETCH_URL_MCP_EXTRA_NOISE_SELECTORSemptyExtra DOM selectors for noise removal.
FETCH_URL_MCP_LOCALEsystem defaultLocale override for extraction heuristics.
MARKDOWN_HEADING_KEYWORDSbuilt-in listOverride heading keywords used by cleanup.

Logging

VariableDefaultNotes
LOG_LEVELinfodebug, info, warn, or error.
LOG_FORMATtextSet to json for structured logs.

HTTP Endpoints

MethodPathAuthPurpose
GET/healthno, unless ?verbose=1 on a remote serverBasic health response, with optional diagnostics.
GET/.well-known/oauth-protected-resourcenoOAuth protected-resource metadata.
GET/.well-known/oauth-protected-resource/mcpnoOAuth protected-resource metadata for the MCP endpoint.
POST/mcpyesSession initialization and JSON-RPC requests.
GET/mcpyesSession-bound server-to-client stream handling.
DELETE/mcpyesSession shutdown.

Security

ControlStatusNotes
Host and origin validationimplementedHTTP requests are rejected unless Host and Origin match the allowlist built from loopback, the configured host, and ALLOWED_HOSTS.
AuthenticationimplementedHTTP mode supports static bearer tokens locally or OAuth token introspection; remote bindings require OAuth.
Protocol version checksimplementedSession-bound MCP HTTP requests validate MCP-Protocol-Version and pin it to the negotiated session version.
Rate limitingimplementedRequests pass through the HTTP rate limiter before route dispatch. Enable SERVER_TRUST_PROXY=true behind a trusted reverse proxy so limits apply to the forwarded client IP instead of the proxy hop.
Outbound SSRF protectionsimplementedLocal/private IPs, metadata endpoints, and .local/.internal hosts are blocked unless ALLOW_LOCAL_FETCH=true.
TLSoptionalHTTPS is enabled when both TLS key and certificate files are configured.
Stdio logging safetyimplementedServer logs are written to stderr, not stdout, so stdio MCP traffic stays clean.

Development

Essential Commands

CommandDescription
npm run buildClean, compile TypeScript, copy assets.
npm run devWatch mode TypeScript compilation.
npm run dev:runRun the server with --watch and .env support.
npm startStart the compiled server.
npm testRun the full test suite.
npm run lintLint with ESLint.
npm run lint:fixAuto-fix lint issues.
npm run type-checkType-check source and tests.
npm run formatFormat with Prettier.
npm run inspectorBuild and launch MCP Inspector.
All npm scripts
ScriptCommand
cleannode scripts/tasks.mjs clean
buildnode scripts/tasks.mjs build
copy:assetsnode scripts/tasks.mjs copy:assets
preparenpm run build
devtsc --watch --preserveWatchOutput
dev:runnode --env-file=.env --watch dist/index.js
startnode dist/index.js
formatprettier --write .
type-checknode scripts/tasks.mjs type-check
type-check:srcnode node_modules/typescript/bin/tsc -p tsconfig.json --noEmit
type-check:testsnode node_modules/typescript/bin/tsc -p tsconfig.test.json --noEmit
type-check:diagnosticstsc --noEmit --extendedDiagnostics
type-check:tracenode -e "require('fs').rmSync('.ts-trace',{recursive:true,force:true})" && tsc --noEmit --generateTrace .ts-trace
linteslint .
lint:testseslint src/__tests__
lint:fixeslint . --fix
testnode scripts/tasks.mjs test
test:fastnode --test --import tsx/esm src/__tests__/**/*.test.ts node-tests/**/*.test.ts
test:coveragenode scripts/tasks.mjs test --coverage
knipknip
knip:fixknip --fix
inspectornpm run build && npx -y @modelcontextprotocol/inspector node dist/index.js --stdio
prepublishOnlynpm run lint && npm run type-check && npm run build

Build and Release

  • npm run prepublishOnly runs lint, type-check, and build as a single release gate.
  • CI workflows are under .github/workflows/.
  • Dockerfile and docker-compose.yml are included for containerized runs.
  • Published on npm as @j0hanz/fetch-url-mcp.

Troubleshooting

SymptomLikely CauseFix
Server output mixes with MCP traffic on stdioLogs going to stdoutEnsure all logging writes to stderr; the server does this by default.
HTTP mode returns 403Host/origin mismatchAdd the domain to ALLOWED_HOSTS or verify loopback bindings.
HTTP mode rate limits every request from your proxySERVER_TRUST_PROXY not enabledEnable SERVER_TRUST_PROXY=true when the server is behind a trusted reverse proxy.
HTTP mode returns 401Missing or invalid tokenSet ACCESS_TOKENS or configure OAuth env vars for remote bindings.
Fetch returns private-IP errorSSRF protections blocked the targetSet ALLOW_LOCAL_FETCH=true if the target is intentionally local.
truncated: true in responseContent exceeded inline limitsIncrease MAX_INLINE_CONTENT_CHARS or accept truncated output.
Transform timeout or worker crashLarge or complex HTMLTune TRANSFORM_WORKER_MAX_OLD_GENERATION_MB or increase FETCH_TIMEOUT_MS.
Client config not workingWrong config format for the clientCheck the matching <details> block above — config keys vary by client.

Credits

DependencyRegistry
@modelcontextprotocol/servernpm
@modelcontextprotocol/nodenpm
@mozilla/readabilitynpm
linkedomnpm
node-html-markdownnpm
undicinpm
zodnpm

Contributing and License

Pull requests welcome. Please make sure these pass before submitting:

  • npm run lint and npm run type-check
  • npm test
  • npm run format

License

MIT License. See LICENSE for details.

Keywords

mcp

FAQs

Package last updated on 11 Apr 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts