Provides a tool for scraping product search results from phonelcdparts.com using Firecrawl and BeautifulSoup, retrieving product information including name, price, URL, and image for any search query.
PhoneLCDParts MCP Server
This project provides a Model Context Protocol (MCP) server with a tool to scrape product search results from phonelcdparts.com
.
Purpose
The primary tool, scrape_phonelcdparts
, allows an MCP-compatible client (like an LLM agent) to query the phonelcdparts.com
website for products based on a search term. It returns structured JSON data containing the product name, price, direct URL, and image URL.
This enables automated product information retrieval for various applications, such as price tracking, data analysis, or integration into larger AI-driven workflows.
Prerequisites
- Python 3.12 or higher.
uv
(for environment and package management).- A valid Firecrawl API key (from firecrawl.dev).
Setup
- Clone the repository (if applicable) or navigate to the project directory:
- Create and activate a virtual environment using
uv
: - Configure Firecrawl API Key:
Create a file named
.env
in thephonelcdpart-mcp
project root directory (i.e.,phonelcdpart-mcp/.env
). Add your Firecrawl API key to this file:The application uses thepython-dotenv
library to load this key at runtime. - Install dependencies using
uv
:This will install all dependencies listed inpyproject.toml
, includingpython-dotenv
.
Running the MCP Server
You have a few options to run the server:
- Directly using Python (for simple development):
- Using Uvicorn (recommended for development, provides auto-reload):
Ensure
uvicorn
is installed (it's inpyproject.toml
).(Theapp:mcp
refers to themcp
instance ofFastMCP
in yourapp.py
file.) - Using the installed script (if
uv pip install .
was successful): After a successfuluv pip install .
, a script defined inpyproject.toml
should be available:This will typically use themcp.run()
method.
The server will usually start on http://127.0.0.1:8000
or http://0.0.0.0:8000
.
Using the Tool
Once the server is running, you can interact with it using any MCP-compatible client.
- Tool Name:
scrape_phonelcdparts
- Description (from docstring): Scrapes product information (name, price, URL, image URL) from
phonelcdparts.com
for a given search query. - Argument:
search_query
(string): The product search term (e.g., "iphone 15 pro max lcd").
- Returns: A list of dictionaries, where each dictionary contains:
name
(string)price
(string)url
(string)image_url
(string)
Example Call (conceptual, using a Python client):
This client code would connect to your running MCP server and invoke the scrape_phonelcdparts
tool with the specified search query, then print the structured JSON results.
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
A web scraping server that retrieves product information (name, price, URL, image) from phonelcdparts.com for any search query.
Related MCP Servers
- AsecurityFlicenseAqualityA server that provides tools to scrape websites and extract structured data from them using Firecrawl's APIs, supporting both basic website scraping in multiple formats and custom schema-based data extraction.Last updated -2JavaScript
- -securityAlicense-qualitySearching google, individual websites and scraping their content. Fast and cost-effective. ⚡️Last updated -16TypeScriptMIT License
- -security-license-qualityEnables free web searching using Google search results with no API keys required, returning structured results with titles, URLs, and descriptions.Last updated -6
- -securityFlicense-qualityExtract structured data from any website with a simple SDK call. No scraping code, no headless browsers - just prompt and get JSON.Last updated -16TypeScript