price_mcp

pipaber/price_mcp

3.2

If you are the rightful owner of price_mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

The Airbnb Price Predictor MCP Server is designed to forecast the nightly price of Airbnb listings using a trained scikit-learn pipeline.

Tools
1
Resources
0
Prompts
0

Airbnb Price Predictor MCP Server

Overview

price_mcp.py exposes a Model Context Protocol (MCP) server that wraps a scikit-learn pipeline trained to forecast the nightly price of Airbnb listings. The predict_airbnb_price tool accepts the same 13 features used during training and returns a currency-rounded prediction. A companion prompt, price_prediction_prompt, helps clients craft consistent tool invocations.

Features

  • MCP tool predict_airbnb_price that validates input via Pydantic and returns structured output.
  • Compatibility layer for legacy scikit-learn pickles (handles _RemainderColsList and missing installs).
  • Prompt price_prediction_prompt that renders a ready-to-send user message with JSON payload.
  • Structured responses (PricePrediction) for downstream automation.
  • Shared SVG icon (price_icon.svg) applied to the server and tool for richer MCP client UIs.

Requirements

  • Python 3.11+

  • Dependencies:

    pip install fastmcp pandas joblib scikit-learn==1.6.1
    

    Use the training version of scikit-learn to avoid unpickling warnings.

Getting Started

  1. Ensure model_airbnb_price.pkl sits next to price_mcp.py.

  2. Install the dependencies inside a virtual environment.

  3. Run the server locally:

    python price_mcp.py
    
  4. Connect your MCP-compatible client to the process (transport="stdio" by default).

Tools & Prompts

NameTypeDescription
predict_airbnb_priceToolPredicts the nightly price using the trained pipeline.
price_prediction_promptPromptGenerates a user message guiding the tool invocation.

The prompt validates arguments with the same schema as the tool, so MCP clients know exactly how to format feature payloads.

Development Notes

  • Reloading the server after installing a missing dependency or updating the model is enough; the loader retries on demand.
  • Add unit tests or smoke scripts to tests/ (not included) if you want regression coverage.
  • Keep the README up to date when the tool schema or prompt contract changes.