Tripadvisor Mcp 服务器
一个用于Tripadvisor内容API的模型上下文协议(MCP)服务器。它通过标准化的MCP接口提供对Tripadvisor位置数据、评论和照片的访问,使AI助手能够搜索旅行目的地和体验。
概览
什么是Tripadvisor MCP?
Tripadvisor MCP(模型上下文协议)是一个服务器,旨在提供对Tripadvisor内容API的访问。这个创新平台允许开发者和AI助手通过标准化的MCP接口检索Tripadvisor的位置信息、评论和照片。通过利用Tripadvisor MCP,用户可以高效地搜索旅行目的地和体验,使其成为旅行相关应用程序的重要工具。
Tripadvisor MCP的特点
- 访问丰富内容:用户可以访问大量信息,包括Tripadvisor的位置信息、用户评论和高质量照片。
- 标准化接口:MCP接口提供了一种一致的方式与Tripadvisor数据进行交互,简化了开发者的集成过程。
- AI兼容性:Tripadvisor MCP专为AI助手设计,允许无缝集成到各种应用程序中,提升旅行规划的用户体验。
- 公开存储库:该项目是公开可用的,鼓励全球开发者的合作和贡献。
如何使用Tripadvisor MCP
- 设置您的环境:确保您拥有与Tripadvisor内容API交互所需的工具和库。
- 访问API:利用标准化的MCP接口连接到Tripadvisor数据。这可能涉及身份验证和设置API密钥。
- 查询数据:使用提供的端点搜索旅行目的地,检索评论和访问照片。
- 集成到您的应用程序中:将检索到的数据整合到您的应用程序中,无论是旅行规划工具、聊天机器人还是其他任何AI驱动的服务。
常见问题解答
问:我可以通过Tripadvisor MCP访问什么类型的数据?
答:您可以访问与各种旅行目的地相关的位置信息、用户评论和照片。
问:Tripadvisor MCP是免费使用的吗?
答:是的,Tripadvisor MCP是一个公开存储库,允许开发者免费使用。
问:我可以为Tripadvisor MCP项目做贡献吗?
答:当然可以!欢迎贡献,您可以与其他开发者合作以增强该项目。
问:我如何报告问题或请求功能?
答:您可以通过在项目的GitHub存储库中创建问题来报告问题或请求新功能。
问:是否有Tripadvisor MCP的文档可用?
答:是的,通常在存储库中提供全面的文档,详细说明如何使用API及其功能。
详情
Tripadvisor MCP Server
A Model Context Protocol (MCP) server for Tripadvisor Content API.
This provides access to Tripadvisor location data, reviews, and photos through standardized MCP interfaces, allowing AI assistants to search for travel destinations and experiences.
Features
-
Search for locations (hotels, restaurants, attractions) on Tripadvisor
-
Get detailed information about specific locations
-
Retrieve reviews and photos for locations
-
Search for nearby locations based on coordinates
-
API Key authentication
-
Docker containerization support
-
Provide interactive tools for AI assistants
The list of tools is configurable, so you can choose which tools you want to make available to the MCP client.
Usage
-
Get your Tripadvisor Content API key from the Tripadvisor Developer Portal.
-
Configure the environment variables for your Tripadvisor Content API, either through a
.env
file or system environment variables:
### Required: Tripadvisor Content API configuration
TRIPADVISOR_API_KEY=your_api_key_here
- Add the server configuration to your client configuration file. For example, for 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"
}
}
}
}
Note: if you see
Error: spawn uv ENOENT
in Claude Desktop, you may need to specify the full path touv
or set the environment variableNO_UV=1
in the configuration.
Docker Usage
This project includes Docker support for easy deployment and isolation.
Building the Docker Image
Build the Docker image using:
docker build -t tripadvisor-mcp-server .
Running with Docker
You can run the server using Docker in several ways:
Using docker run directly:
docker run -it --rm \
-e TRIPADVISOR_API_KEY=your_api_key_here \
tripadvisor-mcp-server
Using docker-compose:
Create a .env
file with your Tripadvisor API key and then run:
docker-compose up
Running with Docker in Claude Desktop
To use the containerized server with Claude Desktop, update the configuration to use Docker with the environment variables:
{
"mcpServers": {
"tripadvisor": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"-e", "TRIPADVISOR_API_KEY",
"tripadvisor-mcp-server"
],
"env": {
"TRIPADVISOR_API_KEY": "your_api_key_here"
}
}
}
}
This configuration passes the environment variables from Claude Desktop to the Docker container by using the -e
flag with just the variable name, and providing the actual values in the env
object.
Development
Contributions are welcome! Please open an issue or submit a pull request if you have any suggestions or improvements.
This project uses uv
to manage dependencies. Install uv
following the instructions for your platform:
curl -LsSf https://astral.sh/uv/install.sh | sh
You can then create a virtual environment and install the dependencies with:
uv venv
source .venv/bin/activate # On Unix/macOS
.venv\Scripts\activate # On Windows
uv pip install -e .
Project Structure
The project has been organized with a src
directory structure:
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
Testing
The project includes a test suite that ensures functionality and helps prevent regressions.
Run the tests with pytest:
### Install development dependencies
uv pip install -e ".[dev]"
### Run the tests
pytest
### Run with coverage report
pytest --cov=src --cov-report=term-missing
Tools
| Tool | Category | Description |
| | | |
| search_locations
| Search | Search for locations by query text, category, and other filters |
| search_nearby_locations
| Search | Find locations near specific coordinates |
| get_location_details
| Retrieval | Get detailed information about a location |
| get_location_reviews
| Retrieval | Retrieve reviews for a location |
| get_location_photos
| Retrieval | Get photos for a location |
License
MIT
Server配置
{
"mcpServers": {
"tripadvisor-mcp": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"ghcr.io/metorial/mcp-container--pab1it0--tripadvisor-mcp--tripadvisor-mcp",
"tripadvisor-mcp"
],
"env": {
"TRIPADVISOR_API_KEY": "tripadvisor-api-key"
}
}
}
}