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 サーバー
このプロジェクトは、 phonelcdparts.com
から製品検索結果をスクレイピングするツールを備えた Model Context Protocol (MCP) サーバーを提供します。
目的
主なツールでscrape_phonelcdparts
、MCP 対応クライアント(LLM エージェントなど)が検索語に基づいてphonelcdparts.com
ウェブサイトに商品情報を送信できるようにします。このツールは、商品名、価格、直接 URL、画像 URL を含む構造化 JSON データを返します。
これにより、価格追跡、データ分析、より大規模な AI 駆動型ワークフローへの統合など、さまざまなアプリケーションで製品情報の自動取得が可能になります。
前提条件
- Python 3.12 以上。
uv
(環境とパッケージ管理用)。- 有効な Firecrawl API キー ( firecrawl.devから)。
設定
- リポジトリをクローンするか(該当する場合)、プロジェクト ディレクトリに移動します。
uv
を使用して仮想環境を作成し、アクティブ化します。- Firecrawl APIキーの設定:
phonelcdpart-mcp
プロジェクトのルートディレクトリに.env
という名前のファイル(例:phonelcdpart-mcp/.env
)を作成します。このファイルにFirecrawl APIキーを追加します。アプリケーションはpython-dotenv
ライブラリを使用して、実行時にこのキーを読み込みます。 uv
を使用して依存関係をインストールします。これにより、python-dotenv
を含む、pyproject.toml
にリストされているすべての依存関係がインストールされます。
MCPサーバーの実行
サーバーを実行するにはいくつかのオプションがあります。
- Python を直接使用する(簡単な開発の場合):
- Uvicorn の使用 (開発に推奨、自動リロードを提供):
uvicorn
がインストールされていることを確認します (pyproject.toml
にあります)。(app:mcp``app.py
ファイル内のFastMCP
のmcp
インスタンスを参照します。) - インストールされたスクリプトを使用する (
uv pip install .
が成功した場合):uv pip install .
が成功すると、pyproject.toml
で定義されたスクリプトが使用できるようになります。これは通常、mcp.run()
メソッドを使用します。
サーバーは通常、 http://127.0.0.1:8000
またはhttp://0.0.0.0:8000
で起動します。
ツールの使用
サーバーが実行される場合は、MCP 互換のクライアントを使用してサーバーと対話できます。
- ツール名:
scrape_phonelcdparts
- **説明 (docstring から):**指定された検索クエリに対して、
phonelcdparts.com
から製品情報 (名前、価格、URL、画像 URL) を取得します。 - 口論:
search_query
(文字列): 製品の検索用語 (例: 「iphone 15 pro max lcd」)。
- **戻り値:**辞書のリスト。各辞書には次のものが含まれます。
name
(文字列)price
(文字列)url
(文字列)image_url
(文字列)
呼び出し例 (概念的、Python クライアントを使用):
このクライアント コードは、実行中の MCP サーバーに接続し、指定された検索クエリを使用してscrape_phonelcdparts
ツールを呼び出して、構造化された JSON 結果を出力します。
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.
任意の検索クエリに対して phonelcdparts.com から製品情報 (名前、価格、URL、画像) を取得する Web スクレイピング サーバー。
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-qualityProvides functionality to fetch and transform web content in various formats (HTML, JSON, plain text, and Markdown) through simple API calls.Last updated -125,855TypeScript