Skip to main content

MCP server for querying Beijing time

Project description

Beijing Time MCP Server

一个用于查询北京时间的MCP(Model Context Protocol)服务器。

mcp-name: io.github.archerlliu/server-name

功能

  • 获取当前北京时间
  • 格式化时间输出
  • 支持多种时间格式
  • 提供时区信息

安装

从 PyPI 安装

pip install beijing-time-mcp

从源码安装

git clone https://github.com/archerliu/beijing-time-mcp.git
cd beijing-time-mcp
pip install -e .

使用方法

作为 MCP 服务器运行

beijing-time-mcp

在 Claude Desktop 中使用

在 Claude Desktop 的配置文件中添加:

{
  "mcpServers": {
    "beijing-time": {
      "command": "beijing-time-mcp"
    }
  }
}

可用工具

get_beijing_time

获取当前北京时间。

参数:

  • format (可选): 时间格式,默认为 "%Y-%m-%d %H:%M:%S"
    • "%Y-%m-%d %H:%M:%S" - 标准格式 (如: 2024-01-15 14:30:25)
    • "%Y-%m-%d" - 日期格式 (如: 2024-01-15)
    • "%H:%M:%S" - 时间格式 (如: 14:30:25)
    • "%Y年%m月%d日 %H时%M分%S秒" - 中文格式 (如: 2024年01月15日 14时30分25秒)

返回:

  • time: 格式化后的北京时间字符串
  • timezone: 时区信息
  • timestamp: Unix时间戳
  • iso_format: ISO 8601格式的时间

开发

安装开发依赖

pip install -e ".[dev]"

运行测试

pytest

代码格式化

black .
isort .

类型检查

mypy beijing_time_mcp

许可证

MIT License

贡献

欢迎提交 Issue 和 Pull Request!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

beijing_time_mcp-0.1.0.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

beijing_time_mcp-0.1.0-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file beijing_time_mcp-0.1.0.tar.gz.

File metadata

  • Download URL: beijing_time_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for beijing_time_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8d622c29f1c7c5e5894b975cc0319a21c1453671c62cd292948a5a2ded2071d1
MD5 9f9ac9a56a28d2c082029e02e5c040eb
BLAKE2b-256 993ba71c67d38a7a17aefb2d616998ddd73d91e67d59ee60ee2b61c3e8704fe8

See more details on using hashes here.

File details

Details for the file beijing_time_mcp-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for beijing_time_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 beef41c807950ec7f2c8092fd0b7af96322f1e72f511da1cd9a9cb460d3ac835
MD5 17e202091ad205bf74bb74c3d9320b37
BLAKE2b-256 14c63c2f23f263d03885c0a19b00d8bb5a91d631f8f68d1ea66c2b37aa5cf34c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page