韩国旅游API

通过韩国旅游组织的官方API,使人工智能助手能够获取韩国旅游信息,提供对景点、活动、美食和住宿的全面搜索,并支持多语言。

travel-and-transportationsearch

620 查看 · 2026-07-07 更新

简介

通过韩国旅游组织的官方API,使人工智能助手能够获取韩国旅游信息,提供对景点、活动、美食和住宿的全面搜索,并支持多语言。

简介

通过韩国旅游组织的官方API,使人工智能助手能够获取韩国旅游信息,提供对景点、活动、美食和住宿的全面搜索,并支持多语言。

韩国旅游 API MCP 服务器 ✈️

smithery 徽章 PyPI 版本 许可证: MIT CI 测试

直接在您的 AI 助手中解锁韩国旅游的奇观!该项目提供了一个由韩国旅游组织 (KTO) 官方 API 支持的 Model Context Protocol (MCP) 服务器。为您的 AI 赋予发现韩国各地充满活力的节日、宁静的寺庙、美味的餐厅、舒适的住宿等更多内容的能力。

链接:

✨ 特性

  • 全面搜索: 通过关键词、区域或位置查找旅游景点、文化遗址、活动、美食、住宿和购物。
  • 丰富详情: 访问描述、营业时间、门票费用、照片、地址和联系方式。
  • 基于位置: 发现特定 GPS 坐标附近的景点。
  • 及时信息: 根据日期范围查找节日和活动。
  • 多语言支持: 获取 KTO API 支持的各种语言的信息(包括英语)。
    • 支持的语言:英语、日语、简体中文、繁体中文、俄语、西班牙语、德语、法语
  • 高效且稳健:
    • 响应缓存: 使用生存时间 (TTL) 缓存存储结果,减少冗余 API 调用,提高速度。
    • 速率限制: 尊重 API 使用限制以防止错误。
    • 自动重试: 在遇到临时网络或服务器问题时自动重试请求。
  • MCP 标准: 无缝集成支持 Model Context Protocol 的 AI 助手。

⚠️ 前提条件

在开始之前,您必须韩国旅游组织 (KTO) 数据门户获取一个 API 密钥。

  1. 访问 KTO 数据门户(如果有的话,请访问专门的旅游 API 门户)。
  2. 注册并请求 "TourAPI" 服务的 API 密钥(您可能需要寻找提供诸如 areaBasedListsearchKeyworddetailCommon 等信息的服务)。
  3. 保管好您的服务密钥 (API 密钥)。在安装或运行时将需要它。

您需要为每种语言申请以下 API。

🚀 安装与运行

您可以使用 uv(一个快速的 Python 包安装器和运行器)或 Docker 来运行此 MCP 服务器。

通过 Smithery 安装

要通过 Smithery 自动安装适用于 Claude Desktop 的韩国旅游 API MCP 服务器:

npx -y @smithery/cli install @harimkang/mcp-korea-tourism-api --client claude

选项 1:使用 uv(推荐用于本地开发)

  1. 克隆仓库:

    git clone https://github.com/harimkang/mcp-korea-tourism-api.git cd mcp-korea-tourism-api
  2. 设置 API 密钥环境变量:"YOUR_KTO_API_KEY" 替换为您实际获得的密钥。

    # 在 macOS/Linux 上 export KOREA_TOURISM_API_KEY="YOUR_KTO_API_KEY" # 在 Windows (命令提示符) 上 # set KOREA_TOURISM_API_KEY="YOUR_KTO_API_KEY" # 在 Windows (PowerShell) 上 # $env:KOREA_TOURISM_API_KEY="YOUR_KTO_API_KEY"

    注意:为了持久存储,请将此行添加到您的 shell 配置文件中(例如 .zshrc.bashrc),或使用系统环境变量设置。

  3. 安装依赖并运行服务器: 该命令使用 uv 根据 uv.lock(如果可用)或 pyproject.toml 安装依赖项,然后运行服务器模块。

    uv run -m mcp_tourism.server

    服务器将启动并通过标准输入/输出(stdio)监听 MCP 请求。

选项 2:使用 Docker(推荐用于隔离环境/部署)

  1. Clone the repository:

    git clone https://github.com/harimkang/mcp-korea-tourism-api.git cd mcp-korea-tourism-api
  2. Build the Docker Image: Replace "YOUR_KTO_API_KEY" with the actual key you obtained. This command builds the image using the provided Dockerfile, passing the API key securely as a build argument.

    >>> docker build -t mcp-korea-tourism-api . [+] Building 2.7s (13/13) FINISHED docker:desktop-linux => [internal] load build definition from Dockerfile 0.0s => => transferring dockerfile: 1.46kB 0.0s => resolve image config for docker-image://docker.io/docker/dockerfile:1 0.9s => CACHED docker-image://docker.io/docker/dockerfile:1@sha256:4c68376a702446fc3c79af22de146a148b 0.0s => [internal] load metadata for docker.io/library/python:3.12-slim 0.7s => [internal] load .dockerignore 0.0s => => transferring context: 864B 0.0s => [1/6] FROM docker.io/library/python:3.12-slim@sha256:85824326bc4ae27a1abb5bc0dd9e08847aa5fe73 0.0s => [internal] load build context 0.0s => => transferring context: 7.06kB 0.0s => CACHED [2/6] RUN pip install --no-cache-dir uv 0.0s => CACHED [3/6] WORKDIR /app 0.0s => CACHED [4/6] COPY pyproject.toml uv.lock ./ 0.0s => [5/6] RUN uv sync --frozen 0.8s => [6/6] COPY . . 0.0s => exporting to image 0.1s => => exporting layers 0.1s => => writing image sha256:d7d074e85a66a257d00bad4043ea0f5ba8acf6b7c6ef26560c6904bf3ec4d5ff 0.0s => => naming to docker.io/library/mcp-korea-tourism 0.0s >>> docker images REPOSITORY TAG IMAGE ID CREATED SIZE mcp-korea-tourism latest d7d074e85a66 12 seconds ago 215MB
    • -t mcp-korea-tourism-api: Tags the built image with the name mcp-korea-tourism-api.
    • .: Specifies the current directory as the build context.
  3. Run the Docker Container: You can run the container in interactive mode for testing or detached mode for background operation.

    • Interactive Mode (for manual testing):

      docker run --rm -it -e KOREA_TOURISM_API_KEY="YOUR_KTO_API_KEY" mcp-korea-tourism-api
      • --rm: Automatically removes the container when it exits.
      • -it: Runs in interactive mode, attaching your terminal to the container's stdio.
      • -e KOREA_TOURISM_API_KEY=...: Sets the API key environment variable at runtime (alternative to build-arg).
    • Detached Mode (for background):

      docker run --name tourism-mcp -d -e KOREA_TOURISM_API_KEY="YOUR_KTO_API_KEY" mcp-korea-tourism-api
      • --name tourism-mcp: Assigns a name to the container.
      • -d: Runs the container in detached (background) mode.
      • You can view logs using docker logs tourism-mcp.

🛠️ 与 Cursor 集成

要在 Cursor 中使用此 MCP 服务器:

  1. 确保 Docker 容器可运行: 按照上面的 Docker 安装步骤构建镜像(mcp-korea-tourism-api)。您不需要手动运行容器;Cursor 会为您完成这一步。

  2. 找到您的 mcp.json 文件: 此文件为 Cursor 配置 MCP 工具。通常可以通过 Cursor 的设置中找到它,或者在类似 ~/.cursor/mcp.json 的路径下找到。

  3. 添加或更新 MCP 配置: 在您的 mcp.json 文件中的列表里添加以下 JSON 对象。如果您已经为此工具配置了条目,请更新其 command。将 "YOUR_KTO_API_KEY" 替换为您的实际密钥。 cursor_integrations

    { "mcpServers": { "korea-tourism": { "command": "docker", "args": [ "run", "--rm", "-i", "-e", "KOREA_TOURISM_API_KEY=YOUR_KTO_API_KEY", "mcp-korea-tourism-api" ] } } }

    或者 使用 uv [本地目录]

    { "mcpServers": { "korea-tourism": { "command": "uv", "args": [ "--directory", "{LOCAL_PATH}/mcp-korea-tourism-api", "run", "-m", "mcp_tourism.server" ], "env": { "KOREA_TOURISM_API_KEY": "YOUR_KTO_API_KEY" } } } }
  4. 保存 mcp.json

  5. 重启 Cursor 或重新加载 MCP 工具: Cursor 现在应该能够检测到该工具,并在需要时使用 Docker 运行它。

🛠️ 提供的 MCP 工具

此服务器为 AI 助手提供了以下工具:

  1. search_tourism_by_keyword: 使用关键词(例如:"景福宫", "拌饭")搜索旅游信息。按内容类型、地区代码过滤。 search_tourism_by_keyword
  2. get_tourism_by_area: 按地理区域代码(例如,首尔='1')浏览旅游信息。按内容类型、区代码过滤。 get_tourism_by_area
  3. find_nearby_attractions: 发现特定GPS坐标(经度、纬度)附近的旅游景点。按半径和内容类型过滤。 find_nearby_attractions
  4. search_festivals_by_date: 查找在指定日期范围(YYYYMMDD格式)内发生的节日。按地区代码过滤。 search_festivals_by_date
  5. find_accommodations: 搜索酒店、民宿等住宿信息。按地区和区代码过滤。 find_accommodations
  6. get_detailed_information: 使用内容ID获取特定项目的详细信息(概述、使用时间、停车场等)。按内容类型过滤。 get_detailed_information
  7. get_tourism_images: 使用内容ID获取与特定旅游项目相关的图片URL。 get_tourism_images
  8. get_area_codes: 获取地区代码(城市/省份),并可选择性地获取子区域(区)代码。 get_area_codes

⚙️ 要求(针对uv方法)

  • Python 3.12+
  • 安装了uv (pip install uv)

示例用法

集成了此MCP的人工智能助手可以处理如下查询:

  • “查找明洞站附近的餐厅。”
  • “给我看佛国寺的照片。”
  • “下个月釜山有什么节日吗?”
  • “告诉我更多关于景福宫的信息,内容ID为264337。”

服务配置

[{'mcpServers': {'korea-tourism': {'args': ['--directory', '{LOCAL_PATH}/mcp-korea-tourism-api', 'run', '-m', 'mcp_tourism.server'], 'command': 'uv', 'env': {'KOREA_TOURISM_API_KEY': 'YOUR_KTO_API_KEY'}}}}]

来源