home / mcp / beijing time mcp server

Beijing Time MCP Server

Beijing Time MCP Server - A Model Context Protocol server for Beijing timezone information

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "archerlliu-time-mcp": {
      "command": "beijing-time-mcp",
      "args": [],
      "env": {
        "PYTHONPATH": "<PYTHONPATH>"
      }
    }
  }
}

Beijing Time MCP Server provides a straightforward way to query the current Beijing time, format it in various ways, and receive timezone and ISO timestamp information through the MCP (Model Context Protocol) interface. This is useful for apps and assistants that need consistent, locale-specific time data.

How to use

Run the MCP server locally to start serving Beijing time data. Then connect your MCP client to request the current time in your preferred format. You can retrieve the formatted time, the timezone, the Unix timestamp, and an ISO 8601 representation in a single response.

How to install

Prerequisites: Python and Pip must be available on your system.

From PyPI install the package with a single command.

pip install beijing-time-mcp

If you prefer to install from source, clone the repository, install dependencies, and install in editable mode.

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

Additional notes

You can run the MCP server directly to start serving time data.

beijing-time-mcp

If you want to configure a client (for example, a desktop configuration) to use this MCP server, you can point the client to the running command as shown in the example configuration.

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

Time formats and output details

The server supports multiple output formats for the current Beijing time. Common options include, but are not limited to:

  • Standard: %Y-%m-%d %H:%M:%S (e.g., 2024-01-15 14:30:25)
  • Date only: %Y-%m-%d (e.g., 2024-01-15)
  • Time only: %H:%M:%S (e.g., 14:30:25)
  • Chinese format: %Y年%m月%d日 %H时%M分%S秒 (e.g., 2024年01月15日 14时30分25秒)

Development and contributing

Developers can install development dependencies, run tests, format code, and perform type checks to help ensure the project stays robust.

pip install -e ".[dev]"
pytest
black .
isort .
mypy beijing_time_mcp

Available tools

get_beijing_time

Fetches the current Beijing time and returns formatted time, timezone, timestamp, and ISO format. Supports multiple formats including standard, date-only, time-only, and Chinese representations.