apipost_test_connection
Verify ApiPost MCP server connection status and configuration to ensure service availability for API documentation management and team collaboration.
Instructions
测试ApiPost MCP连接状态和配置信息,验证服务可用性
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| random_string | Yes | Dummy parameter for no-parameter tools |
Implementation Reference
- src/index.ts:836-846 (registration)Tool registration in the ListToolsRequestSchema handler, including name, description, and inputSchema definition.{ name: 'apipost_test_connection', description: '测试ApiPost MCP连接状态和配置信息,验证服务可用性', inputSchema: { type: 'object', properties: { random_string: { type: 'string', description: 'Dummy parameter for no-parameter tools' } }, required: ['random_string'] } },
- src/index.ts:986-1046 (handler)The execution handler for the apipost_test_connection tool. It constructs a detailed connection info object and returns a formatted text response with status, workspace, environment, and available operations.case 'apipost_test_connection': const connectionInfo = { status: '✅ 连接正常', mcp_version: '1.0.0', api_host: APIPOST_HOST, security_mode: APIPOST_SECURITY_MODE, workspace: currentWorkspace ? { team_name: currentWorkspace.teamName, project_name: currentWorkspace.projectName, project_id: currentWorkspace.projectId } : null, environment: { token_configured: !!APIPOST_TOKEN, host_configured: !!APIPOST_HOST, node_version: process.version, platform: process.platform, url_prefix: APIPOST_URL_PREFIX }, available_operations: { create_api: checkSecurityPermission('write'), update_api: checkSecurityPermission('write'), delete_api: checkSecurityPermission('write'), read_api: checkSecurityPermission('read') }, test_time: new Date().toLocaleString('zh-CN', { timeZone: 'Asia/Shanghai' }) }; return { content: [ { type: 'text', text: `🎉 ApiPost MCP 连接测试成功! 📊 连接状态: ${connectionInfo.status} 🔗 MCP版本: ${connectionInfo.mcp_version} 🌐 API地址: ${connectionInfo.api_host} 🔒 安全模式: ${connectionInfo.security_mode} 🏢 当前工作空间: ${connectionInfo.workspace ? `• 团队: ${connectionInfo.workspace.team_name} • 项目: ${connectionInfo.workspace.project_name} • 项目ID: ${connectionInfo.workspace.project_id}` : '• 工作空间未初始化'} 🔧 环境配置: • Token配置: ${connectionInfo.environment.token_configured ? '✅ 已配置' : '❌ 未配置'} • Host配置: ${connectionInfo.environment.host_configured ? '✅ 已配置' : '❌ 未配置'} • URL前缀: ${connectionInfo.environment.url_prefix || '(未配置)'} • Node版本: ${connectionInfo.environment.node_version} • 系统平台: ${connectionInfo.environment.platform} 🛠️ 可用操作: • 创建接口: ${connectionInfo.available_operations.create_api ? '✅ 允许' : '❌ 禁止'} • 更新接口: ${connectionInfo.available_operations.update_api ? '✅ 允许' : '❌ 禁止'} • 删除接口: ${connectionInfo.available_operations.delete_api ? '✅ 允许' : '❌ 禁止'} • 读取接口: ${connectionInfo.available_operations.read_api ? '✅ 允许' : '❌ 禁止'} ⏰ 测试时间: ${connectionInfo.test_time} 🎯 MCP服务器运行正常,可以开始使用其他工具!` } ] };