Skip to main content
Glama
chrishayuk

MCP Time Server

by chrishayuk

MCP タイムサーバー

概要

MCPタイムサーバーは、異なるタイムゾーン間で高度な時間関連ユーティリティを提供するために設計された、洗練されたPythonベースのマイクロサービスです。現在の時刻の取得や、様々なグローバルタイムゾーン間の時刻変換を行うための堅牢な機能を提供します。

Related MCP server: Time MCP Server

プロジェクトの詳細

  • バージョン: 0.1.1

  • Python 互換性: Python 3.11+

特徴

  • 現在の時刻の取得: 任意の IANA タイムゾーンの現在の時刻を取得します

  • タイムゾーン変換: 異なるタイムゾーン間の時刻を変換します

  • 包括的な検証:Pydanticモデルを使用した堅牢な入力検証

  • 非同期サーバーアーキテクチャ: 効率的なパフォーマンスのために asyncio で構築

  • 柔軟な構成:環境変数と構成ファイルを通じて構成可能

依存関係

コア依存関係:

  • mcp (>=1.6.0)

  • ピダンティック (>=2.11.2)

  • PyYAML (>=6.0.2)

  • pyz (>=0.4.3)

開発依存関係:

  • pytest (>=8.3.5)

インストール

前提条件

  • Python 3.11以上

  • ピップ

  • (オプション)仮想環境を推奨

PyPIからインストール

pip install chuk-mcp-time-server

ソースからインストール

  1. リポジトリをクローンします。

git clone <repository-url>
cd chuk-mcp-time-server
  1. 仮想環境を作成します。

python -m venv venv
source venv/bin/activate  # On Windows, use `venv\Scripts\activate`
  1. パッケージをインストールします。

pip install .  # Installs the package in editable mode

開発インストール

開発用に設定するには:

pip install .[dev]  # Installs package with development dependencies

サーバーの実行

コマンドラインインターフェース

chuk-mcp-time-server

プログラムによる使用

from chuk_mcp_time_server.main import main

if __name__ == "__main__":
    main()

環境変数

  • NO_BOOTSTRAP : コンポーネントのブートストラップを無効にするように設定します

  • その他の設定オプションは設定ファイルで設定できます

利用可能なツール

1. 現在の時刻を取得する

入力:

  • timezone : IANAタイムゾーン名(例: 'America/New_York')

例:

get_current_time('Europe/London')

戻り値:

  • 指定されたタイムゾーンの現在の時刻

  • タイムゾーンの詳細

  • 夏時間(DST)のステータス

2. 時間を変換する

入力:

  • source_timezone : ソースタイムゾーン(IANA形式)

  • time : HH:MM (24時間)形式の時刻

  • target_timezone : ターゲットタイムゾーン(IANA形式)

例:

convert_time('America/New_York', '14:30', 'Europe/Paris')

戻り値:

  • ソース時間の詳細

  • 目標時間の詳細

  • ゾーン間の時差

発達

コードのフォーマット

  • 黒はコードのフォーマットに使用されます

  • isortはインポートソートに使用されます

  • 行の長さは88文字に設定されています

テストの実行

pytest

貢献

  1. リポジトリをフォークする

  2. 機能ブランチを作成します( git checkout -b feature/AmazingFeature )

  3. コードがフォーマットとテストに合格することを確認する

  4. 変更をコミットします( git commit -m 'Add some AmazingFeature' )

  5. ブランチにプッシュする ( git push origin feature/AmazingFeature )

  6. プルリクエストを開く

ライセンス

MITライセンス

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    An MCP server providing timezone conversions and time-related operations via RESTful API endpoints, featuring comprehensive error handling and timezone database integration.
    -
  • A
    license
    B
    quality
    D
    maintenance
    Provides time and timezone functionality for LLMs, enabling them to get current time information across different timezones and convert times between zones.
    2
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Provides time zone management utilities including retrieving current time in any global time zone and converting time between different time zones with automatic daylight saving time handling.
    125 npm
    MIT