UNPKG

yszl-mcp

Version:

Scenic Area Tourist Flow Query Server with official MCP SDK

32 lines (27 loc) 878 B
#!/usr/bin/env node /** * 测试脚本,用于直接测试TouristFlowTool的API调用 */ import dotenv from 'dotenv'; import { TouristFlowTool } from './src/tools/touristFlowTool.js'; // 加载环境变量 dotenv.config(); // 创建工具实例 const touristFlowTool = new TouristFlowTool(); // 打印环境变量情况 console.log('环境变量情况:'); console.log('API_URL:', process.env.API_URL); console.log('ACCOUNT:', process.env.ACCOUNT); console.log('TOKEN 是否存在:', !!process.env.TOKEN); // 执行查询 async function testQuery() { try { console.log('正在查询景区F51018268的实时客流...'); const result = await touristFlowTool.execute({ scId: 'F51018268' }); console.log('查询结果:', JSON.stringify(result, null, 2)); } catch (error) { console.error('查询失败:', error.message); } } // 运行测试 testQuery();