TR

Tripadvisor MCP Server for LLM Integration

Enable LLMs to access Tripadvisor via an MCP server for location data, reviews, and photos through standardized interfaces.

Quick Install
npx -y @pab1it0/tripadvisor-mcp

Overview

This repository implements a Model Context Protocol (MCP) server that exposes Tripadvisor content as standardized tools for large language models (LLMs). The server translates Tripadvisor location data, reviews, ratings and photos into a predictable, machine-friendly API surface so LLMs can request and reason about travel information without having to scrape web pages or embed custom parsers.

By running the Tripadvisor MCP server alongside an LLM or an LLM orchestration layer, developers can present Tripadvisor functionality (search, review retrieval, photo fetch, summaries) as native tools. This simplifies building travel assistants, itinerary generators, review summarizers, and multimodal experiences that combine text and images from Tripadvisor into the model’s context.

Repository: https://github.com/pab1it0/tripadvisor-mcp

Features

  • Exposes Tripadvisor content via MCP-compatible tool endpoints
  • Location search and structured location metadata (address, coordinates, categories)
  • Review retrieval with filtering (language, rating, recency) and sentiment metadata
  • Photo access with URLs and basic metadata (size, attribution)
  • Summarization helper endpoints for concise review and location summaries
  • Dockerized server and simple configuration via environment variables
  • Designed for easy integration with LLM tool-invocation patterns

Installation / Configuration

Clone and run locally:

git clone https://github.com/pab1it0/tripadvisor-mcp.git
cd tripadvisor-mcp

Create a Python virtual environment and install:

python -m venv venv
source venv/bin/activate
pip install -r requirements.txt

Environment variables (example):

export TRIPADVISOR_API_KEY="your_api_key_here"
export MCP_PORT=8080
export LOG_LEVEL=info

Start the server:

python -m tripadvisor_mcp.server --port $MCP_PORT

Docker:

docker build -t tripadvisor-mcp .
docker run -e TRIPADVISOR_API_KEY=$TRIPADVISOR_API_KEY -p 8080:8080 tripadvisor-mcp

Configuration file (YAML) example:

server:
  host: 0.0.0.0
  port: 8080

tripadvisor:
  api_key: "${TRIPADVISOR_API_KEY}"
  user_agent: "tripadvisor-mcp/1.0"

mcp:
  enable_discovery: true

Available Tools / Resources

The server exposes a set of MCP-style tools (endpoints). Each tool accepts JSON input and returns JSON output suitable for LLM consumption.

EndpointMethodPurpose
/mcp/toolsGETDiscovery: lists available MCP tools and metadata
/tool/searchPOSTSearch locations by name, city, category
/tool/locationPOSTRetrieve structured location details by id
/tool/reviewsPOSTRetrieve reviews for a location with filters
/tool/photosPOSTRetrieve photo URLs and metadata for a location
/tool/summaryPOSTSummarize reviews or location data into short text

Example: list tools

curl http://localhost:8080/mcp/tools

Example: search locations

curl -X POST http://localhost:8080/tool/search \
  -H "Content-Type: application/json" \
  -d '{"query":"Eiffel Tower", "limit":5, "location":"Paris"}'

Example response (abbreviated):

[
  {"id":"12345","name":"Eiffel Tower","category":"Attraction","lat":48.8584,"lng":2.2945},
  ...
]

Use Cases

  1. Travel assistant that finds and summarizes attractions

    • Flow: LLM issues a location search -> selects location id -> calls /tool/reviews and /tool/photos -> synthesizes itinerary and visual suggestions.
    • Concrete example: “Find top 3 family-friendly attractions in Paris” — server returns structured data and recent family-oriented reviews; model composes recommendations with links to photos.
  2. Review summarization and sentiment extraction

    • Flow: Use /tool/reviews with filters (language, min_rating) then /tool/summary to produce a short sentiment summary and bullet points of common pros/cons.
    • Concrete example: Fetch 20 English reviews for a hotel and generate a 3-sentence summary plus 5 common pain points (e.g., noise, breakfast quality).
  3. Photo enrichment for chat or UI

    • Flow: When a user asks to “show photos” of a restaurant, the LLM invokes /tool/photos to retrieve canonical image URLs and attributions; the app displays thumbnails and links.
    • Concrete example: Provide 6 photos for a cafe with captions and photographer credit.
  4. Contextual recommendation and routing

    • Flow: Combine location coordinates from /tool/location with external mapping or transit tools to create directions or nearby recommendations (e.g., “restaurants within 500m of a museum”).

Integration tips

  • Expose only the tools your LLM needs; apply rate limits and caching on heavy endpoints like reviews and photos.
  • Normalize Tripadvisor IDs and cache location metadata to avoid repeated lookups.
  • When passing tool outputs into the model, include structured fields (id, name, rating, excerpt) to avoid context hallucination.
  • Use the /mcp/tools discovery endpoint to dynamically register the server with LLM tool frameworks that support MCP.

For more details, examples, and contribution guidelines, see the project repository: https://github.com/pab1it0/tripadvisor-mcp