游览MCP服务器
提供韩国观光公社KorService 2 API作为MCP工具的服务器
首选参数
# .env 파일 생성
cp .env.example .env
# .env 편집
vi .env.env内容:
KORSERVICE_URL=https://apis.data.go.kr/B551011/KorService2
TOUR_API_KEY=your_api_key_here
PORT=8000运行(DIGITS)
依赖性安装
cd tour-mcp-server
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt启动前台
source venv/bin/activate
python server.py后台运行
source venv/bin/activate
nohup python server.py > mcp.log 2>&1 &
echo $! > mcp.pid退出(DIGITS)
退出到PID文件
kill $(cat mcp.pid)
rm mcp.pid找到并终止进程
# 프로세스 확인
ps aux | grep server.py
# 종료
kill
# 또는 포트로 찾아서 종료
lsof -ti:8000 | xargs kill -9API端点
| 方法 | Path | 说明 |
|---|---|---|
| 得到 | /health | 检查服务器状态 |
| 得到 | /api/tools | 可用工具列表 |
| 职位 | /api/call_tool | 调用工具 |
工具调用示例
# 키워드 검색
curl -X POST http://localhost:8000/api/call_tool \
-H "Content-Type: application/json" \
-d '{
"name": "search_by_keyword",
"arguments": {"keyword": "강릉", "content_type_id": "39"}
}'
# 지역 기반 검색
curl -X POST http://localhost:8000/api/call_tool \
-H "Content-Type: application/json" \
-d '{
"name": "search_by_area",
"arguments": {"area_code": "32", "content_type_id": "39"}
}'可用工具
| 工具名 | 说明 |
|---|---|
get_area_codes | 查询地区代码/市郡代码 |
get_category_codes | 查询服务分类代码 |
search_by_area | 搜索基于地区的旅游信息 |
search_by_location | 基于GPS位置的搜索 |
search_by_keyword | 关键字搜索 |
search_festivals | 节日/活动搜索 |
search_stays | 住宿搜索 |
get_detail_common | 详细信息(通用) |
get_detail_intro | 详细信息(简介) |
get_detail_info | 详细信息(重复) |
get_detail_images | 图像列表 |
get_pet_tour_info | 宠物旅游信息 |
检查日志
tail -f mcp.log