mcp-fetch


Namemcp-fetch JSON
Version 0.6.5 PyPI version JSON
download
home_pageNone
SummaryA Model Context Protocol server providing tools to fetch and convert web content for usage by LLMs (robots.txt checking removed)
upload_time2025-07-13 01:52:59
maintainerlanggpt
docs_urlNone
authorlanggpt
requires_python>=3.10
licenseMIT
keywords automation http llm mcp
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # MCP Fetch

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.

## Available Tools

- `fetch` - Fetches a URL from the internet and extracts its contents as markdown.
    - `url` (string, required): URL to fetch
    - `max_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)

## Available Prompts

- **fetch**
  - Fetch a URL and extract its contents as markdown
  - Arguments:
    - `url` (string, required): URL to fetch

## Installation and Usage

### Local Development Setup

1. **Clone or download the source code:**
   ```bash
   git clone https://github.com/LangGPT/mcp-fetch.git
   cd mcp-fetch
   ```

2. **Install dependencies using uv:**
   ```bash
   uv sync
   ```

3. **Test the server:**
   ```bash
   uv run python -m mcp_fetch --help
   ```

### Using with Claude Desktop (Local Source)

1. **Create Claude Desktop configuration:**
   ```json
   {
     "mcpServers": {
       "mcp-fetch": {
         "command": "uv",
         "args": [
           "run",
           "--directory",
           "/path/to/your/mcp-fetch",
           "python",
           "-m",
           "mcp_fetch"
         ]
       }
     }
   }
   ```

2. **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`

3. **Restart Claude Desktop** to load the new server.

### Using with VS Code (Local Source)

Add to your VS Code settings or `.vscode/mcp.json`:

```json
{
  "mcp": {
    "servers": {
      "mcp-fetch": {
        "command": "uv",
        "args": [
          "run",
          "--directory",
          "/path/to/your/mcp-fetch",
          "python",
          "-m",
          "mcp_fetch"
        ]
      }
    }
  }
}
```

### Installation via Package Manager

#### Using uv (recommended)

When using [`uv`](https://docs.astral.sh/uv/) no specific installation is needed. We will
use [`uvx`](https://docs.astral.sh/uv/guides/tools/) to directly run *mcp-fetch*:

```bash
uvx mcp-fetch
```

#### Using pip

```bash
pip install mcp-fetch
```

After installation, run it as:
```bash
python -m mcp_fetch
```

### Package Manager Configuration

#### Claude Desktop with uvx

```json
{
  "mcpServers": {
    "mcp-fetch": {
      "command": "uvx",
      "args": ["mcp-fetch"]
    }
  }
}
```

#### VS Code with uvx

```json
{
  "mcp": {
    "servers": {
      "mcp-fetch": {
        "command": "uvx",
        "args": ["mcp-fetch"]
      }
    }
  }
}
```

## Development

### Setting up Development Environment

1. **Install development dependencies:**
   ```bash
   uv sync --dev
   ```

2. **Run linting and type checking:**
   ```bash
   uv run ruff check
   uv run pyright
   ```

3. **Build the package:**
   ```bash
   uv build
   ```

### Testing

Test the server locally:
```bash
uv run python -m mcp_fetch
```

Use the MCP inspector for debugging:
```bash
npx @modelcontextprotocol/inspector uv run python -m mcp_fetch
```

### Making Changes

1. Edit the source code in `src/mcp_fetch/`
2. Test your changes with `uv run python -m mcp_fetch`
3. Update version in `pyproject.toml` if needed
4. Run tests and linting

## Publishing

### Publishing to PyPI

1. **Build the package:**
   ```bash
   uv build
   ```

2. **Publish to PyPI:**
   ```bash
   uv publish
   ```
   
   Or using twine:
   ```bash
   pip install twine
   twine upload dist/*
   ```

### Publishing to GitHub

1. **Initialize git repository (if not already done):**
   ```bash
   git init
   git branch -m main
   ```

2. **Add and commit files:**
   ```bash
   git add .
   git commit -m "Initial commit: MCP Web Fetch server without robots.txt checking"
   ```

3. **Create GitHub repository and push:**
   ```bash
   # Create repository on GitHub first, then:
   git remote add origin https://github.com/LangGPT/mcp-fetch.git
   git push -u origin main
   ```

4. **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

### Building Docker Image

```bash
docker build -t mcp-fetch .
docker tag mcp-fetch LangGPT/mcp-fetch:latest
docker push LangGPT/mcp-fetch:latest
```

## Customization

### robots.txt

**This version has robots.txt checking completely removed.** All web requests will proceed regardless of robots.txt restrictions.

### User-agent

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.

### Proxy

The server can be configured to use a proxy by using the `--proxy-url` argument.

## Debugging

You can use the MCP inspector to debug the server:

For local development:
```bash
npx @modelcontextprotocol/inspector uv run python -m mcp_fetch
```

For uvx installations:
```bash
npx @modelcontextprotocol/inspector uvx mcp-fetch
```

## Contributing

We 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.

## License

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.
            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "mcp-fetch",
    "maintainer": "langgpt",
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "automation, http, llm, mcp",
    "author": "langgpt",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/a9/84/66bb6cc502f50c49a1db61d8ace891bec18a1c194c350fef91eb7ce05302/mcp_fetch-0.6.5.tar.gz",
    "platform": null,
    "description": "# MCP Fetch\n\nA 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.\n\nThis is a modified version of the original mcp-server-fetch that removes all robots.txt checking, allowing unrestricted access to web content.\n\n> [!CAUTION]\n> 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.\n\nThe 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.\n\n## Available Tools\n\n- `fetch` - Fetches a URL from the internet and extracts its contents as markdown.\n    - `url` (string, required): URL to fetch\n    - `max_length` (integer, optional): Maximum number of characters to return (default: 5000)\n    - `start_index` (integer, optional): Start content from this character index (default: 0)\n    - `raw` (boolean, optional): Get raw content without markdown conversion (default: false)\n\n## Available Prompts\n\n- **fetch**\n  - Fetch a URL and extract its contents as markdown\n  - Arguments:\n    - `url` (string, required): URL to fetch\n\n## Installation and Usage\n\n### Local Development Setup\n\n1. **Clone or download the source code:**\n   ```bash\n   git clone https://github.com/LangGPT/mcp-fetch.git\n   cd mcp-fetch\n   ```\n\n2. **Install dependencies using uv:**\n   ```bash\n   uv sync\n   ```\n\n3. **Test the server:**\n   ```bash\n   uv run python -m mcp_fetch --help\n   ```\n\n### Using with Claude Desktop (Local Source)\n\n1. **Create Claude Desktop configuration:**\n   ```json\n   {\n     \"mcpServers\": {\n       \"mcp-fetch\": {\n         \"command\": \"uv\",\n         \"args\": [\n           \"run\",\n           \"--directory\",\n           \"/path/to/your/mcp-fetch\",\n           \"python\",\n           \"-m\",\n           \"mcp_fetch\"\n         ]\n       }\n     }\n   }\n   ```\n\n2. **Add configuration to Claude Desktop:**\n   - macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`\n   - Windows: `%APPDATA%/Claude/claude_desktop_config.json`\n   - Linux: `~/.config/Claude/claude_desktop_config.json`\n\n3. **Restart Claude Desktop** to load the new server.\n\n### Using with VS Code (Local Source)\n\nAdd to your VS Code settings or `.vscode/mcp.json`:\n\n```json\n{\n  \"mcp\": {\n    \"servers\": {\n      \"mcp-fetch\": {\n        \"command\": \"uv\",\n        \"args\": [\n          \"run\",\n          \"--directory\",\n          \"/path/to/your/mcp-fetch\",\n          \"python\",\n          \"-m\",\n          \"mcp_fetch\"\n        ]\n      }\n    }\n  }\n}\n```\n\n### Installation via Package Manager\n\n#### Using uv (recommended)\n\nWhen using [`uv`](https://docs.astral.sh/uv/) no specific installation is needed. We will\nuse [`uvx`](https://docs.astral.sh/uv/guides/tools/) to directly run *mcp-fetch*:\n\n```bash\nuvx mcp-fetch\n```\n\n#### Using pip\n\n```bash\npip install mcp-fetch\n```\n\nAfter installation, run it as:\n```bash\npython -m mcp_fetch\n```\n\n### Package Manager Configuration\n\n#### Claude Desktop with uvx\n\n```json\n{\n  \"mcpServers\": {\n    \"mcp-fetch\": {\n      \"command\": \"uvx\",\n      \"args\": [\"mcp-fetch\"]\n    }\n  }\n}\n```\n\n#### VS Code with uvx\n\n```json\n{\n  \"mcp\": {\n    \"servers\": {\n      \"mcp-fetch\": {\n        \"command\": \"uvx\",\n        \"args\": [\"mcp-fetch\"]\n      }\n    }\n  }\n}\n```\n\n## Development\n\n### Setting up Development Environment\n\n1. **Install development dependencies:**\n   ```bash\n   uv sync --dev\n   ```\n\n2. **Run linting and type checking:**\n   ```bash\n   uv run ruff check\n   uv run pyright\n   ```\n\n3. **Build the package:**\n   ```bash\n   uv build\n   ```\n\n### Testing\n\nTest the server locally:\n```bash\nuv run python -m mcp_fetch\n```\n\nUse the MCP inspector for debugging:\n```bash\nnpx @modelcontextprotocol/inspector uv run python -m mcp_fetch\n```\n\n### Making Changes\n\n1. Edit the source code in `src/mcp_fetch/`\n2. Test your changes with `uv run python -m mcp_fetch`\n3. Update version in `pyproject.toml` if needed\n4. Run tests and linting\n\n## Publishing\n\n### Publishing to PyPI\n\n1. **Build the package:**\n   ```bash\n   uv build\n   ```\n\n2. **Publish to PyPI:**\n   ```bash\n   uv publish\n   ```\n   \n   Or using twine:\n   ```bash\n   pip install twine\n   twine upload dist/*\n   ```\n\n### Publishing to GitHub\n\n1. **Initialize git repository (if not already done):**\n   ```bash\n   git init\n   git branch -m main\n   ```\n\n2. **Add and commit files:**\n   ```bash\n   git add .\n   git commit -m \"Initial commit: MCP Web Fetch server without robots.txt checking\"\n   ```\n\n3. **Create GitHub repository and push:**\n   ```bash\n   # Create repository on GitHub first, then:\n   git remote add origin https://github.com/LangGPT/mcp-fetch.git\n   git push -u origin main\n   ```\n\n4. **Create a release on GitHub:**\n   - Go to your repository on GitHub\n   - Click \"Releases\" \u2192 \"Create a new release\"\n   - Tag version: `v0.6.3`\n   - Release title: `v0.6.3 - MCP Fetch`\n   - Describe your changes\n   - Publish release\n\n### Building Docker Image\n\n```bash\ndocker build -t mcp-fetch .\ndocker tag mcp-fetch LangGPT/mcp-fetch:latest\ndocker push LangGPT/mcp-fetch:latest\n```\n\n## Customization\n\n### robots.txt\n\n**This version has robots.txt checking completely removed.** All web requests will proceed regardless of robots.txt restrictions.\n\n### User-agent\n\nBy default, depending on if the request came from the model (via a tool), or was user initiated (via a prompt), the\nserver will use either the user-agent:\n```\nModelContextProtocol/1.0 (Autonomous; +https://github.com/modelcontextprotocol/servers)\n```\nor:\n```\nModelContextProtocol/1.0 (User-Specified; +https://github.com/modelcontextprotocol/servers)\n```\n\nThis can be customized by adding the argument `--user-agent=YourUserAgent` to the `args` list in the configuration.\n\n### Proxy\n\nThe server can be configured to use a proxy by using the `--proxy-url` argument.\n\n## Debugging\n\nYou can use the MCP inspector to debug the server:\n\nFor local development:\n```bash\nnpx @modelcontextprotocol/inspector uv run python -m mcp_fetch\n```\n\nFor uvx installations:\n```bash\nnpx @modelcontextprotocol/inspector uvx mcp-fetch\n```\n\n## Contributing\n\nWe 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.\n\n## License\n\nmcp-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.",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A Model Context Protocol server providing tools to fetch and convert web content for usage by LLMs (robots.txt checking removed)",
    "version": "0.6.5",
    "project_urls": null,
    "split_keywords": [
        "automation",
        " http",
        " llm",
        " mcp"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "f7492611f3bf8b7345fa9e9ff194b6280d202dc089a543479b9b43fa5a4cde41",
                "md5": "2b1fd1669b7274248d4681c5cd2b3efe",
                "sha256": "c3d7339925e85cd803ef6d744b68e5fa004f48b04dba9acf8af3c97037e98c49"
            },
            "downloads": -1,
            "filename": "mcp_fetch-0.6.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "2b1fd1669b7274248d4681c5cd2b3efe",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 8030,
            "upload_time": "2025-07-13T01:52:58",
            "upload_time_iso_8601": "2025-07-13T01:52:58.312886Z",
            "url": "https://files.pythonhosted.org/packages/f7/49/2611f3bf8b7345fa9e9ff194b6280d202dc089a543479b9b43fa5a4cde41/mcp_fetch-0.6.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "a98466bb6cc502f50c49a1db61d8ace891bec18a1c194c350fef91eb7ce05302",
                "md5": "bc4c4d6ff72f8398c96bbb3454eb5b4f",
                "sha256": "82e3ca4cfa4697c931d94695f74a25d3e174663a05c01cca644f6ad95d8c4725"
            },
            "downloads": -1,
            "filename": "mcp_fetch-0.6.5.tar.gz",
            "has_sig": false,
            "md5_digest": "bc4c4d6ff72f8398c96bbb3454eb5b4f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 41958,
            "upload_time": "2025-07-13T01:52:59",
            "upload_time_iso_8601": "2025-07-13T01:52:59.861127Z",
            "url": "https://files.pythonhosted.org/packages/a9/84/66bb6cc502f50c49a1db61d8ace891bec18a1c194c350fef91eb7ce05302/mcp_fetch-0.6.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-13 01:52:59",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "mcp-fetch"
}
        
Elapsed time: 0.66633s