Skip to main content
Glama
pab1it0

Tripadvisor MCP

by pab1it0

Tripadvisor MCP 服务器

Tripadvisor 内容 API 的模型上下文协议(MCP) 服务器。

这可以通过标准化的 MCP 界面访问 Tripadvisor 位置数据、评论和照片,从而让 AI 助手搜索旅行目的地和体验。

特征

  • [x] 在 Tripadvisor 上搜索地点(酒店、餐厅、景点)

  • [x] 获取特定位置的详细信息

  • [x] 检索地点的评论和照片

  • [x] 根据坐标搜索附近的位置

  • [x] API密钥认证

  • [x] Docker 容器化支持

  • [x] 为AI助手提供交互工具

工具列表是可配置的,因此您可以选择要向 MCP 客户端提供的工具。

Related MCP server: expedia-travel-recommendations-mcp

用法

  1. Tripadvisor 开发者门户获取您的 Tripadvisor 内容 API 密钥。

  2. 通过.env文件或系统环境变量配置您的 Tripadvisor Content API 的环境变量:

# Required: Tripadvisor Content API configuration
TRIPADVISOR_API_KEY=your_api_key_here
  1. 将服务器配置添加到客户端配置文件中。例如,对于 Claude Desktop:

{
  "mcpServers": {
    "tripadvisor": {
      "command": "uv",
      "args": [
        "--directory",
        "<full path to tripadvisor-mcp directory>",
        "run",
        "src/tripadvisor_mcp/main.py"
      ],
      "env": {
        "TRIPADVISOR_API_KEY": "your_api_key_here"
      }
    }
  }
}

注意:如果您在 Claude Desktop 中看到Error: spawn uv ENOENT ,则可能需要指定uv的完整路径或在配置中设置环境变量NO_UV=1

Docker 使用

该项目包括 Docker 支持,以便于部署和隔离。

构建 Docker 镜像

使用以下方式构建 Docker 镜像:

docker build -t tripadvisor-mcp-server .

使用 Docker 运行

您可以通过多种方式使用 Docker 运行服务器:

直接使用 docker run:

docker run -it --rm \
  -e TRIPADVISOR_API_KEY=your_api_key_here \
  tripadvisor-mcp-server

使用docker-compose:

使用您的 Tripadvisor API 密钥创建一个.env文件,然后运行:

docker-compose up

在 Claude Desktop 中使用 Docker 运行

要将容器化服务器与 Claude Desktop 一起使用,请更新配置以使用带有环境变量的 Docker:

{
  "mcpServers": {
    "tripadvisor": {
      "command": "docker",
      "args": [
        "run",
        "--rm",
        "-i",
        "-e", "TRIPADVISOR_API_KEY",
        "tripadvisor-mcp-server"
      ],
      "env": {
        "TRIPADVISOR_API_KEY": "your_api_key_here"
      }
    }
  }
}

此配置使用仅带有变量名的-e标志将环境变量从 Claude Desktop 传递到 Docker 容器,并在env对象中提供实际值。

发展

欢迎贡献代码!如果您有任何建议或改进,请提交 issue 或 pull request。

本项目使用uv来管理依赖项。请按照您平台的说明安装uv

curl -LsSf https://astral.sh/uv/install.sh | sh

然后,您可以创建一个虚拟环境并使用以下命令安装依赖项:

uv venv
source .venv/bin/activate  # On Unix/macOS
.venv\Scripts\activate     # On Windows
uv pip install -e .

项目结构

该项目已采用src目录结构进行组织:

tripadvisor-mcp/
├── src/
│   └── tripadvisor_mcp/
│       ├── __init__.py      # Package initialization
│       ├── server.py        # MCP server implementation
│       ├── main.py          # Main application logic
├── Dockerfile               # Docker configuration
├── docker-compose.yml       # Docker Compose configuration
├── .dockerignore            # Docker ignore file
├── pyproject.toml           # Project configuration
└── README.md                # This file

测试

该项目包括一个测试套件,可确保功能并有助于防止回归。

使用 pytest 运行测试:

# Install development dependencies
uv pip install -e ".[dev]"

# Run the tests
pytest

# Run with coverage report
pytest --cov=src --cov-report=term-missing

工具

工具

类别

描述

search_locations

搜索

通过查询文本、类别和其他过滤器搜索位置

search_nearby_locations

搜索

查找特定坐标附近的位置

get_location_details

检索

获取有关位置的详细信息

get_location_reviews

检索

检索某个地点的评论

get_location_photos

检索

获取某个位置的照片

执照

麻省理工学院


Available Tools

5 tools
get_location_detailsC

Get detailed information about a specific location

ParametersJSON Schema
NameRequiredDescriptionDefault
locationIdYes
languageNoen

TDQS

C2.6/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It only states what the tool does ('Get detailed information') without describing traits like whether it's read-only, requires authentication, has rate limits, or what the output format might be. This leaves critical behavioral aspects unspecified for a tool with no structured annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, clear sentence with no wasted words. It is appropriately sized and front-loaded, directly stating the tool's purpose without unnecessary elaboration, making it efficient for quick understanding.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (2 parameters, no output schema, no annotations), the description is incomplete. It lacks details on parameter usage, behavioral traits, output expectations, and differentiation from siblings. For a tool with no structured support, this minimal description does not provide enough context for an agent to use it effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 0%, so the description must compensate for undocumented parameters. It mentions 'a specific location' but does not explain the parameters (locationId and language) or their semantics, such as what locationId represents or how language affects the response. This fails to add meaningful context beyond the bare schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the tool's purpose ('Get detailed information about a specific location'), which is clear but vague. It specifies the verb ('Get') and resource ('location'), but does not distinguish what 'detailed information' entails or how it differs from sibling tools like get_location_photos or get_location_reviews. This leaves the scope ambiguous compared to alternatives.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus siblings. It does not mention alternatives, prerequisites, or exclusions, such as whether it should be used for basic info versus photos or reviews. Without such context, an agent might struggle to select the correct tool among the provided options.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_location_photosC

Get photos for a specific location

ParametersJSON Schema
NameRequiredDescriptionDefault
locationIdYes
languageNoen

TDQS

C2.4/5.0
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must fully disclose behavioral traits. It only states the basic action without mentioning permissions, rate limits, pagination, response format, or whether it's read-only or has side effects. This leaves critical operational details unspecified for a tool with parameters.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, clear sentence with no wasted words. It's front-loaded and efficiently conveys the core purpose without unnecessary elaboration, making it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (2 parameters, no annotations, no output schema), the description is incomplete. It doesn't cover parameter meanings, behavioral aspects like safety or output, or usage context. For a tool that fetches data, more details on what to expect and how to use it are needed for effective agent operation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate by explaining parameters. It doesn't mention 'locationId' or 'language' at all, leaving both parameters undocumented. The description adds no meaning beyond the schema, failing to clarify what 'locationId' refers to or how 'language' affects results.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Get photos for a specific location' clearly states the action (get) and resource (photos for a location), but it's vague about scope (e.g., number of photos, types, or source). It doesn't differentiate from siblings like 'get_location_details' or 'get_location_reviews', which also fetch location-related data but for different resources.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. For example, it doesn't specify if this is for visual content versus textual details (vs. get_location_details) or reviews (vs. get_location_reviews), or when to prefer search tools like search_locations. The description lacks any context for selection among siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_location_reviewsC

Get reviews for a specific location

ParametersJSON Schema
NameRequiredDescriptionDefault
locationIdYes
languageNoen

TDQS

C2.6/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It only states the basic action without detailing traits like whether it's read-only, requires authentication, has rate limits, returns paginated results, or includes error handling. For a tool with zero annotation coverage, this is a significant gap in transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise with a single sentence that directly states the tool's purpose. It is front-loaded and wastes no words, making it easy to parse quickly. This efficiency is appropriate for a simple tool, though it sacrifices detail for brevity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (2 parameters, no output schema, no annotations), the description is incomplete. It does not cover parameter meanings, behavioral traits, or output expectations (e.g., review format, error cases). Without annotations or an output schema, the description fails to provide enough context for reliable agent use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 0%, so the description must compensate for undocumented parameters. It mentions 'a specific location' but does not explain the 'locationId' parameter (e.g., format, source) or the optional 'language' parameter (e.g., supported codes, default behavior). This lack of semantic context leaves parameters ambiguous beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Get reviews for a specific location' clearly states the action (get) and resource (reviews for a location), which is adequate. However, it lacks specificity about what 'reviews' entail (e.g., ratings, comments, dates) and does not differentiate from sibling tools like 'get_location_details' or 'get_location_photos', leaving ambiguity about the scope of information returned.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It does not mention prerequisites (e.g., needing a location ID), exclusions, or comparisons to siblings such as 'search_locations' for broader queries. This absence of context makes it harder for an agent to select the correct tool in practice.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search_locationsC

Search for locations (hotels, restaurants, attractions) on Tripadvisor

ParametersJSON Schema
NameRequiredDescriptionDefault
searchQueryYes
languageNoen
categoryNo
phoneNo
addressNo
latLongNo

TDQS

C2.8/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action ('search') but doesn't describe what the search returns (e.g., list of results, pagination), performance characteristics, rate limits, authentication needs, or error conditions. This leaves significant gaps for an agent to understand the tool's behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core purpose without unnecessary words. Every part of the sentence contributes directly to understanding the tool's function.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (6 parameters, no schema descriptions, no output schema, no annotations), the description is inadequate. It doesn't address parameter usage, return values, error handling, or behavioral traits, leaving the agent with insufficient information to use the tool effectively beyond its basic purpose.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 6 parameters with 0% description coverage, and the tool description provides no information about any parameters. It doesn't explain what 'searchQuery' should contain, how 'category' is used, the format of 'latLong', or the purpose of optional fields like 'phone' and 'address'. This fails to compensate for the schema's lack of documentation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('search for') and resource ('locations'), and specifies the domain ('on Tripadvisor') with examples of location types ('hotels, restaurants, attractions'). It doesn't explicitly differentiate from sibling tools like 'search_nearby_locations', but the purpose is unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives like 'search_nearby_locations' or 'get_location_details'. The description implies a general search function but lacks context about prerequisites, limitations, or optimal use cases.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search_nearby_locationsC

Search for locations near a specific latitude/longitude

ParametersJSON Schema
NameRequiredDescriptionDefault
latitudeYes
longitudeYes
languageNoen
categoryNo

TDQS

C2.8/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It states the search action but doesn't describe what 'near' means (distance/radius), result format, pagination, rate limits, authentication needs, or error conditions. For a search tool with zero annotation coverage, this leaves significant behavioral gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero wasted words. It's appropriately sized for a search tool and front-loads the core functionality without unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 4 parameters with 0% schema coverage, no annotations, no output schema, and multiple sibling tools, the description is incomplete. It covers the basic purpose but lacks parameter details, behavioral context, usage differentiation, and return value information that would help an agent use this tool effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate for undocumented parameters. The description mentions latitude/longitude (covering 2 of 4 parameters) but doesn't explain the 'language' or 'category' parameters, their formats, or valid values. It adds some meaning for required parameters but leaves half the parameters unexplained.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose as 'Search for locations near a specific latitude/longitude', which includes a specific verb ('Search') and resource ('locations') with geographic context. However, it doesn't distinguish this tool from its sibling 'search_locations', which might have different functionality.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'search_locations' or when not to use it. There's no mention of prerequisites, limitations, or comparison with sibling tools, leaving the agent without contextual usage information.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 5 tool updates
    • First observedget_location_details
    • First observedget_location_photos
    • First observedget_location_reviews
    • First observedsearch_locations
    • First observedsearch_nearby_locations

TDQS

B3.2/5.0

Scored across 5 tools

Disambiguation5/5

Each tool has a clearly distinct purpose: get_location_details retrieves general information, get_location_photos handles photos, get_location_reviews focuses on reviews, search_locations performs general searches, and search_nearby_locations finds locations based on proximity. There is no overlap or ambiguity between these functions.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern with 'get_' or 'search_' prefixes and descriptive suffixes like 'details', 'photos', 'reviews', 'locations', and 'nearby_locations'. The naming is uniform and predictable throughout the set.

Tool Count5/5

With 5 tools, this server is well-scoped for its Tripadvisor domain, covering key operations like retrieving details, photos, reviews, and performing searches. Each tool serves a unique and necessary function without being excessive or insufficient.

Completeness4/5

The tool set provides strong coverage for core Tripadvisor functionalities, including search and retrieval of location details, photos, and reviews. A minor gap exists in lacking CRUD operations (e.g., creating or updating reviews), but this is reasonable for a read-focused API, and agents can work effectively with the provided tools.

Maintenance

ActivityInactive
ResponsivenessUnresponsive

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers