A Model Context Protocol server that provides web content fetching capabilities with robots.txt checking removed. This server enables LLMs to retrieve and process content from web pages, converting HTML to markdown for easier consumption.
This is a modified version of the original mcp-server-fetch that removes all robots.txt checking, allowing unrestricted access to web content.
Caution
This server can access local/internal IP addresses and may represent a security risk. Exercise caution when using this MCP server to ensure this does not expose any sensitive data. Additionally, this version ignores robots.txt restrictions which may violate some websites' access policies.
The fetch tool will truncate the response, but by using the start_index argument, you can specify where to start the content extraction. This lets models read a webpage in chunks, until they find the information they need.
fetch- Fetches a URL from the internet and extracts its contents as markdown.url(string, required): URL to fetchmax_length(integer, optional): Maximum number of characters to return (default: 5000)start_index(integer, optional): Start content from this character index (default: 0)raw(boolean, optional): Get raw content without markdown conversion (default: false)
- fetch
- Fetch a URL and extract its contents as markdown
- Arguments:
url(string, required): URL to fetch
-
Clone or download the source code:
git clone https://github.com/LangGPT/mcp-fetch.git cd mcp-fetch -
Install dependencies using uv:
uv sync
-
Test the server:
uv run python -m mcp_fetch --help
-
Create Claude Desktop configuration:
{ "mcpServers": { "mcp-fetch": { "command": "uv", "args": [ "run", "--directory", "/path/to/your/mcp-fetch", "python", "-m", "mcp_fetch" ] } } } -
Add configuration to Claude Desktop:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%/Claude/claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
- macOS:
-
Restart Claude Desktop to load the new server.
Add to your VS Code settings or .vscode/mcp.json:
{
"mcp": {
"servers": {
"mcp-fetch": {
"command": "uv",
"args": [
"run",
"--directory",
"/path/to/your/mcp-fetch",
"python",
"-m",
"mcp_fetch"
]
}
}
}
}When using uv no specific installation is needed. We will
use uvx to directly run mcp-fetch:
uvx mcp-fetchpip install mcp-fetchAfter installation, run it as:
python -m mcp_fetch{
"mcpServers": {
"mcp-fetch": {
"command": "uvx",
"args": ["mcp-fetch"]
}
}
}{
"mcp": {
"servers": {
"mcp-fetch": {
"command": "uvx",
"args": ["mcp-fetch"]
}
}
}
}-
Install development dependencies:
uv sync --dev
-
Run linting and type checking:
uv run ruff check uv run pyright
-
Build the package:
uv build
Test the server locally:
uv run python -m mcp_fetchUse the MCP inspector for debugging:
npx @modelcontextprotocol/inspector uv run python -m mcp_fetch- Edit the source code in
src/mcp_fetch/ - Test your changes with
uv run python -m mcp_fetch - Update version in
pyproject.tomlif needed - Run tests and linting
-
Build the package:
uv build
-
Publish to PyPI:
uv publish
Or using twine:
pip install twine twine upload dist/*
-
Initialize git repository (if not already done):
git init git branch -m main
-
Add and commit files:
git add . git commit -m "Initial commit: MCP Web Fetch server without robots.txt checking"
-
Create GitHub repository and push:
# Create repository on GitHub first, then: git remote add origin https://github.com/LangGPT/mcp-fetch.git git push -u origin main -
Create a release on GitHub:
- Go to your repository on GitHub
- Click "Releases" → "Create a new release"
- Tag version:
v0.6.3 - Release title:
v0.6.3 - MCP Fetch - Describe your changes
- Publish release
docker build -t mcp-fetch .
docker tag mcp-fetch LangGPT/mcp-fetch:latest
docker push LangGPT/mcp-fetch:latestThis version has robots.txt checking completely removed. All web requests will proceed regardless of robots.txt restrictions.
By default, depending on if the request came from the model (via a tool), or was user initiated (via a prompt), the server will use either the user-agent:
ModelContextProtocol/1.0 (Autonomous; +https://github.com/modelcontextprotocol/servers)
or:
ModelContextProtocol/1.0 (User-Specified; +https://github.com/modelcontextprotocol/servers)
This can be customized by adding the argument --user-agent=YourUserAgent to the args list in the configuration.
The server can be configured to use a proxy by using the --proxy-url argument.
You can use the MCP inspector to debug the server:
For local development:
npx @modelcontextprotocol/inspector uv run python -m mcp_fetchFor uvx installations:
npx @modelcontextprotocol/inspector uvx mcp-fetchWe encourage contributions to help expand and improve mcp-fetch. Whether you want to add new tools, enhance existing functionality, or improve documentation, your input is valuable.
mcp-fetch is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository.