modelcontextprotocol / modelcontextprotocol/servers

Add support for host allowlisting to Fetch server

Open
#2,317 8 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement server-fetch
Dominant language
TypeScript
Stars
90.5k
Forks
11.7k
Avg merge
2d 2h
Merged PRs (30d)
5

Description

Is your feature request related to a problem? Please describe.
The fetch MCP server currently allows connections to local/internal IP addresses without any restrictions, which poses a security risk. While the README has been updated with a caution notice, this reference implementation could be misused if deployed without proper safeguards.

Describe the solution you'd like
Implement a host allowlisting mechanism for the fetch server that would:

  • Allow administrators to specify which hosts/domains the server can connect to
  • By default, block connections to local/internal IP ranges (127.0.0.0/8, 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, etc.)
  • Provide configuration options to explicitly allow internal IPs if needed for specific use cases
  • Implement checks at the socket level to avoid TOCTOU (Time-of-Check-Time-of-Use) vulnerabilities

Describe alternatives you've considered

  • Leave as-is with documentation only: Continue with just the warning in the README, but this leaves the reference implementation vulnerable and sets a poor security example

Additional context

  • Consider adding example configurations to the Readme showing secure deployment patterns.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the fetch server entry point and review the existing README caution notice to understand current connection handling and configuration. Done means administrators can configure host allowlisting, internal ranges are blocked by default with explicit overrides, socket-level checks address TOCTOU concerns, and the README includes secure deployment examples.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend, security
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.