Skip to main content
Glama

Beijing Time MCP Server

by archerlliu
MIT License
publish.sh3.77 kB
#!/bin/bash # 发布北京时间MCP到PyPI的脚本 set -e echo "🚀 开始发布北京时间MCP到PyPI..." # 检查是否安装了构建工具 echo "📦 检查构建工具..." if ! command -v twine &> /dev/null; then echo "安装twine..." pip install twine build fi if ! command -v python -m build &> /dev/null; then echo "安装build..." pip install build fi # 清理之前的构建 echo "🧹 清理之前的构建文件..." rm -rf dist/ build/ *.egg-info/ # 运行测试 echo "🧪 运行测试..." python test_quick.py # 检查代码风格(可选) echo "🔍 检查代码风格..." if command -v black &> /dev/null; then echo "运行black格式检查..." black --check beijing_time_mcp/ || echo "⚠️ 代码格式检查失败,请运行 black ." fi if command -v isort &> /dev/null; then echo "运行isort导入检查..." isort --check-only beijing_time_mcp/ || echo "⚠️ 导入排序检查失败,请运行 isort ." fi # 构建包 echo "🔨 构建Python包..." python -m build # 检查包 echo "🔍 检查包完整性..." twine check dist/* # 检查API密钥环境变量 if [ -z "$TWINE_PASSWORD" ]; then echo "⚠️ 未设置TWINE_PASSWORD环境变量" echo "请设置PyPI API令牌作为环境变量:" echo "export TWINE_PASSWORD=your_pypi_api_token" echo "export TWINE_USERNAME=__token__" echo "" read -p "是否现在输入API令牌? (y/N): " -n 1 -r echo if [[ ! $REPLY =~ ^[Yy]$ ]]; then echo "❌ 发布取消" exit 1 fi read -p "请输入PyPI API令牌: " -s token_input echo export TWINE_PASSWORD="$token_input" export TWINE_USERNAME=__token__ fi # 询问发布目标 echo "" echo "选择发布目标:" echo "1) 测试PyPI" echo "2) 正式PyPI" echo "3) 两者都发布" read -p "请选择 (1/2/3): " -n 1 -r echo case $REPLY in 1) echo "🧪 发布到测试PyPI..." read -p "请输入测试PyPI API令牌 (留空跳过): " -s test_token echo if [ -n "$test_token" ]; then export TWINE_USERNAME=__token__ export TWINE_PASSWORD="$test_token" twine upload --repository testpypi dist/* echo "✅ 已发布到测试PyPI!" echo "安装测试版本: pip install --index-url https://test.pypi.org/simple/ beijing-time-mcp" else echo "⏭️ 跳过测试PyPI发布" fi ;; 2) echo "🚀 发布到正式PyPI..." twine upload dist/* echo "✅ 已发布到PyPI!" echo "安装命令: pip install beijing-time-mcp" ;; 3) echo "🧪 先发布到测试PyPI..." read -p "请输入测试PyPI API令牌 (留空跳过): " -s test_token echo if [ -n "$test_token" ]; then export TWINE_USERNAME=__token__ export TWINE_PASSWORD="$test_token" twine upload --repository testpypi dist/* echo "✅ 已发布到测试PyPI!" else echo "⏭️ 跳过测试PyPI发布" fi # 恢复正式PyPI令牌 if [ -n "$token_input" ]; then export TWINE_PASSWORD="$token_input" fi echo "🚀 发布到正式PyPI..." twine upload dist/* echo "✅ 已发布到PyPI!" echo "安装命令: pip install beijing-time-mcp" ;; *) echo "❌ 无效选择,发布取消" exit 1 ;; esac echo "" echo "🎉 发布流程完成!" echo "" echo "📝 使用说明:" echo "1. 安装: pip install beijing-time-mcp" echo "2. 运行: beijing-time-mcp" echo "3. 在Claude Desktop配置中添加:" echo ' {"mcpServers": {"beijing-time": {"command": "beijing-time-mcp"}}}'

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/archerlliu/time-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server