Skip to main content
Glama
cnguyen14

PhoneLCDParts MCP Server

by cnguyen14

PhoneLCDParts MCP サーバー

このプロジェクトは、 phonelcdparts.comから製品検索結果をスクレイピングするツールを備えた Model Context Protocol (MCP) サーバーを提供します。

目的

主なツールでscrape_phonelcdparts 、MCP 対応クライアント(LLM エージェントなど)が検索語に基づいてphonelcdparts.comウェブサイトに商品情報を送信できるようにします。このツールは、商品名、価格、直接 URL、画像 URL を含む構造化 JSON データを返します。

これにより、価格追跡、データ分析、より大規模な AI 駆動型ワークフローへの統合など、さまざまなアプリケーションで製品情報の自動取得が可能になります。

Related MCP server: Vinted-scrapper

前提条件

  • Python 3.12 以上。

  • uv (環境とパッケージ管理用)。

  • 有効な Firecrawl API キー ( firecrawl.devから)。

設定

  1. リポジトリをクローンするか(該当する場合)、プロジェクト ディレクトリに移動します。

    cd path/to/phonelcdpart-mcp
  2. uv

    uv venv
    source .venv/bin/activate
  3. Firecrawl APIキーの設定: phonelcdpart-mcpプロジェクトのルートディレクトリに.envという名前のファイル(例: phonelcdpart-mcp/.env )を作成します。このファイルにFirecrawl APIキーを追加します。

    FIRECRAWL_API_KEY="YOUR_ACTUAL_FIRECRAWL_API_KEY_HERE"

    アプリケーションはpython-dotenvライブラリを使用して、実行時にこのキーを読み込みます。

  4. uv

    uv pip install .

    これにより、 python-dotenvを含む、 pyproject.tomlにリストされているすべての依存関係がインストールされます。

MCPサーバーの実行

サーバーを実行するにはいくつかのオプションがあります。

  1. Python を直接使用する(簡単な開発の場合):

    python app.py
  2. Uvicorn の使用 (開発に推奨、自動リロードを提供): uvicornがインストールされていることを確認します ( pyproject.tomlにあります)。

    uvicorn app:mcp --reload --host 0.0.0.0 --port 8000

    ( app:mcp``app.pyファイル内のFastMCPmcpインスタンスを参照します。)

  3. インストールされたスクリプトを使用する ( uv pip install .が成功すると、 pyproject.tomlで定義されたスクリプトが使用できるようになります。

    start-mcp

    これは通常、 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 クライアントを使用):

# (This is a conceptual example of how a client might call the tool)
# import asyncio
# from fastmcp import Client
#
# async def main():
#     # Ensure the server_url matches where your MCP server is running
#     server_url = "http://127.0.0.1:8000/sse" 
#     async with Client(server_url) as client:
#         try:
#             result = await client.call_tool(
#                 "scrape_phonelcdparts", 
#                 {"search_query": "iphone 14 screen"}
#             )
#             if result and result.data:
#                 print("Tool Result:")
#                 for item in result.data:
#                     print(item)
#             else:
#                 print("No data returned or tool call failed.")
#         except Exception as e:
#             print(f"Error calling tool: {e}")
#
# if __name__ == "__main__":
#     asyncio.run(main())

このクライアント コードは、実行中の MCP サーバーに接続し、指定された検索クエリを使用してscrape_phonelcdpartsツールを呼び出して、構造化された JSON 結果を出力します。

-
security - not tested
F
license - not found
-
quality - not tested

Resources

Looking for Admin?

Admins can modify the Dockerfile, update the server description, and track usage metrics. If you are the server author, to access the admin panel.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/cnguyen14/plp-mcpserver'

If you have feedback or need assistance with the MCP directory API, please join our Discord server