Skip to content

Add support for host allowlisting to Fetch server #2317

Description

@olaservo

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestserver-fetchReference implementation for the Fetch MCP server - src/fetch

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions