Skip to main content

An example MCP server exposing tools to interact with Yelp

Project description

MCP Server for Yelp Fusion AI

Yelp Fusion AI brings conversational intelligence to your applications, enabling users to ask natural language questions and receive real-time, contextually relevant answers powered by Yelp’s latest business data and reviews.

Fusion AI Capabilities

  • Next generation search & discovery – Search with natural language, discover, and connect with contextually relevant businesses. ("Find the best tacos in the Bay Area")
  • Multi-turn conversations – Support back-and-forth interactions and refine queries with follow-up questions. ("Which of the options have open air seating?")
  • Direct business queries – Ask targeted questions about businesses without needing to perform a prior search. ("Does Ricky’s Taco allow pets?")
  • Conversational restaurant reservations – Explore availability and book a table at restaurants through natural language interactions. (Please note that this is available on request only. To enable reservations, please contact us.) ("Reserve a table for 4 tomorrow at 8PM at Ricky’s")

Tools:

This server exposes one primary tool:

  • yelp_agent: Designed for agent-to-agent communication. This tool handles natural language requests about local businesses, providing both natural language responses and structured business data. It supports follow-up questions using a chat_id. Capabilities include business search, detailed questions, comparisons, itinerary planning, and more, leveraging Yelp's dataset. Key Arguments:
    • natural_language_query (str): Your query (e.g. "find the best tacos in the Bay Area").
    • search_latitude (float or null): Latitude for location-specific searches.
    • search_longitude (float or null): Longitude for location-specific searches.
    • chat_id (str or null): ID for continuing a previous conversation.

Prerequisites

You either need a container manager (like Docker or Podman) or the following installed locally:

  • Python: Version 3.10 or higher (as specified in pyproject.toml).
  • uv: The Python package manager. You can find installation instructions at https://docs.astral.sh/uv/.

You will also need an API key for Yelp Fusion AI. You can get a key by creating an app here, which will start your free trial. If you need more time to evaluate, email us at fusion@yelp.com to extend your trial.

Find more details and comprehensive documentation about Yelp Fusion AI here.

Setup and Installation

  1. Clone the repository:
git clone <repository_url>
cd yelp-mcp
  1. Install dependencies: This command will create a virtual environment (if one doesn't exist), install all necessary dependencies as defined in pyproject.toml and uv.lock, and install the project into the uv environment.
make install

Building the Docker Image (Optional)

If you prefer to run the server in a container, you can build a Docker image:

docker build -t mcp-yelp-agent .

This will create an image named mcp-yelp-agent:latest.

Running the Server

This repository is designed to be run as a Model Context Protocol server. You will need an MCP client (like compatible versions of Claude, Cursor, or VS Code with MCP support) to interact with it.

Method 1: Running without Docker

Ensure you have completed the "Setup and Installation" steps, especially installing the project so the mcp-yelp-agent script is available.

Server Configuration

The server supports multiple transport protocols and can be configured with command-line arguments. While stdio is the primary transport for most MCP clients, other options are available for different use cases.

  • --transport: Choose the communication protocol.
    • stdio (default): Standard input/output, ideal for local tools.
    • streamable-http: Streamable HTTP.
    • sse: Server-Sent Events.
  • --host: The host address to bind to (e.g., 127.0.0.1 or 0.0.0.0). Default is 127.0.0.1.
  • --port: The port to listen on. Default is 8000.

Method 1: Running without Docker

Configure your MCP client with the following JSON settings to run the server with the default stdio transport.

{
  "mcpServers": {
    "yelp_agent": {
      "command": "uv",
      "args": [
        "--directory",
        "<PATH_TO_YOUR_CLONED_PROJECT_DIRECTORY>",
        "run",
        "mcp-yelp-agent"
      ],
      "env": {
        "YELP_API_KEY": "<YOUR_YELP_FUSION_API_KEY>"
      }
    }
  }
}

Notes:

  • Replace <PATH_TO_YOUR_CLONED_PROJECT_DIRECTORY> with the absolute path to where you cloned this project.
  • Replace <YOUR_YELP_FUSION_API_KEY> with your actual Yelp Fusion API key.
  • If your MCP client has trouble invoking uv directly, you might need to provide the full path to the uv binary. You can find this by running which uv in your terminal.

Method 2: Running with Docker

Ensure you have built the Docker image as described in "Building the Docker Image".

Configure your MCP client with the following JSON settings:

{
  "mcpServers": {
    "yelp_agent": {
      "command": "docker",
      "args": [
        "run",
        "-i",          // Interactive mode
        "--rm",        // Automatically remove the container when it exits
        "--init",      // Run an init process as PID 1 in the container
        "-e", "YELP_API_KEY=<YOUR_YELP_FUSION_API_KEY>",
        "mcp-yelp-agent:latest" // The image name built earlier
      ]
    }
  }
}

Notes:

  • Replace <YOUR_YELP_FUSION_API_KEY> with your actual Yelp Fusion API key.
  • If your MCP client has trouble invoking docker from the system PATH, you might need to provide the full path to its binary (e.g., run which docker).

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

iflow_mcp_yelp_mcp-0.1.0.tar.gz (13.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

iflow_mcp_yelp_mcp-0.1.0-py3-none-any.whl (14.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: iflow_mcp_yelp_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 13.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.10 {"installer":{"name":"uv","version":"0.9.10"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for iflow_mcp_yelp_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f5e3ec69f01dc94c92d80810454444f97a45f8fb6dd1b0464195147947acfcf7
MD5 3a6d9f8f9bebc675318f7b1ad633f437
BLAKE2b-256 4ebffff2e79fa54749dd94c4d162982a0191ab05fbe680bc1fed4ee67fabda46

See more details on using hashes here.

File details

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

File metadata

  • Download URL: iflow_mcp_yelp_mcp-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 14.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.10 {"installer":{"name":"uv","version":"0.9.10"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for iflow_mcp_yelp_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 51a8796aa48648cdec4df32c6639c7e6fe48b0c1f4ee4cf649e1a27735344300
MD5 b8e1871678984d4a376daf015abf99c8
BLAKE2b-256 68c2b7e2676c8e99efdd75cb6dc2a2f6a9c6e52f2b723266ed4fc4885c95acd1

See more details on using hashes here.

Supported by

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