Skip to main content

Oxylabs MCP server

Project description

MCP Server for Oxylabs Scraper

smithery badge

The scraper tool is an asynchronous utility that leverages the Oxylabs Web Scraper API to fetch and process content from a given URL. This tool is designed to handle various scraping scenarios efficiently, with flexible options for parsing and rendering web pages.

Key Features

  1. URL Scraping

    • Fetches the content of a specified URL using Oxylabs' API.
  2. HTML Parsing

    • If parsing is enabled, the content is returned in a processed format, suitable for handling by downstream systems like language models (LLMs).
    • If parsing is disabled, the tool strips unnecessary HTML tags and converts the cleaned content into a Markdown file for easier readability and compatibility.
  3. JavaScript Rendering

    • Offers an option to render pages using a headless browser, which ensures dynamic content (e.g., JavaScript-rendered pages) is included in the output.
    • Supports the html rendering option or skipping rendering entirely.

Examples on how to query Claude or other LLM

Prerequisites

Install uv first.

https://docs.astral.sh/uv/getting-started/installation/#installation-methods

Setup Intructions

Installing via Smithery

To install Oxylabs MCP server for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install @oxylabs/oxylabs-mcp --client claude

Setup with Claude Desktop

# claude_desktop_config.json
# Can find location through:
# Claude -> Settings -> Developer -> Edit Config
{
  "mcpServers": {
    "oxylabs_scraper": {
      "command": "uvx",
      "args": ["oxylabs-mcp"],
      "env": {
        "OXYLABS_USERNAME": "YOUR_USERNAME_HERE",
        "OXYLABS_PASSWORD": "YOUR_PASSWORD_HERE",
      }
    }
  }
}

Local/Dev Setup Instructions

Clone repo

git clone <git:url>

Install dependencies

Install MCP server dependencies:

cd mcp-server-oxylabs

# Create virtual environment and activate it
uv venv

source .venv/bin/activate # MacOS/Linux
# OR
.venv/Scripts/activate # Windows

# Install dependencies
uv sync

Setup with Claude Desktop

# claude_desktop_config.json
# Can find location through:
# Claude -> Settings -> Developer -> Edit Config
{
  "mcpServers": {
    "oxylabs_scraper": {
      "command": "uv",
      "args": [
        "--directory",
        "/<Absolute-path-to-folder>/oxylabs-mcp",
        "run",
        "oxylabs-mcp"
      ],
      "env": {
        "OXYLABS_USERNAME": "YOUR_USERNAME_HERE",
        "OXYLABS_PASSWORD": "YOUR_PASSWORD_HERE"
      }
    }
  }
}

Debugging

Run:

make run

Then access MCP Inspector at http://localhost:5173. You may need to add your username and password in the environment variables in the inspector under OXYLABS_USERNAME and OXYLABS_PASSWORD.


NOTE

Usage with the MCP inspector is affected by an ongoing issue with the Python SDK for MCP, see: https://github.com/modelcontextprotocol/python-sdk/pull/85. For Claude, a forked version of the SDK is used as a temporary fix.


License

This project is licensed under the MIT License.

About Oxylabs

Established in 2015, Oxylabs are a market-leading web intelligence collection platform, driven by the highest business, ethics, and compliance standards, enabling companies worldwide to unlock data-driven insights.

image

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

oxylabs_mcp-0.1.0.tar.gz (26.5 kB view details)

Uploaded Source

Built Distribution

oxylabs_mcp-0.1.0-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file oxylabs_mcp-0.1.0.tar.gz.

File metadata

  • Download URL: oxylabs_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 26.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for oxylabs_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f4f62a4e22e00bb9f9ef95998912496d1cc08d35803fe2d9defa697a065617b4
MD5 738cd54c35c98d6bb19d20db674e8a42
BLAKE2b-256 06239c1c2a4c84ee8b812dcebfa1386299452f860b22a429f3188c00c1b1ea31

See more details on using hashes here.

File details

Details for the file oxylabs_mcp-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: oxylabs_mcp-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for oxylabs_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eed22b56c89f2ad865c1fb5c608b38987136923f43a633bc026a330539fd4c18
MD5 2db0e204ea2c29e5c5839ab559e1c480
BLAKE2b-256 edf84a7569cdef5c4ef0aece6d9984fef279d67358dbe7accbf2d4f1a3ffb428

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page