mcpField
T
Time MCP Server

Time MCP Server

ローカル
github.com/okooo5km生産性980 週間前に更新

Time MCP Server について

Time MCP Serverは、現在時刻やタイムゾーンの操作を必要とするLLMやアプリケーション向けのSwift実装です。現地時刻の取得、時刻変換、夏時間の判定、タイムゾーン間の時差計算ができます。

主な機能

  1. 01IANAタイムゾーンの現在時刻取得
  2. 02タイムゾーン間の時刻変換
  3. 03夏時間の状態確認
  4. 04タイムゾーン間の時差計算
  5. 05stdioとSSEのトランスポート

活用シーン

  1. 01複数タイムゾーンにまたがる会議の計画
  2. 02旅行先の現地時刻の確認
  3. 03国際チームの勤務時間の調整
  4. 04グローバルイベントの日時設定

MCP 対応

現在時刻の照会やタイムゾーン間の時刻変換を行うツールをMCPクライアントに提供し、夏時間情報と時差も扱います。stdioとSSEに対応しています。

設定

ローカルサーバーの設定はどのクライアントでも共通です。コピーしてクライアントの MCP 設定ファイルに貼り付けてください。

インストール方法は未掲載です

このサーバーのパッケージやリモートエンドポイントはまだ取得できていません。プロジェクトの README の手順に従ってください。

リポジトリ

ツール

ツール一覧はまだ取得されていません

ローカルサーバーのツールはマシン上で起動して初めて取得できます。メンテナーはまだツール一覧を提供していません。

詳細

Time MCP サーバー

時刻関連の機能を提供する Model Context Protocol サーバーです。このサーバーにより、LLM は現在時刻の情報を取得したり、異なるタイムゾーン間で時刻を変換したりできます。MCP Swift SDK を使用した、Swift による時刻 MCP サーバーの実装です。

Swift Platform License

✨ 機能

  • 現在時刻の取得:任意のタイムゾーンの現在時刻を取得します
  • タイムゾーンの変換:異なるタイムゾーン間で時刻を変換します
  • 夏時間の情報:タイムゾーンが現在夏時間かどうかを確認します
  • 時差の計算:変換時にタイムゾーン間の時差を取得します

利用可能なツール

  • get_current_time - 指定したタイムゾーンの現在時刻を取得します

    • timezone(string、必須):IANA タイムゾーン名(例:'America/New_York'、'Europe/London')。空の場合、または指定されていない場合は、システムのタイムゾーンが使用されます。
  • convert_time - タイムゾーン間で時刻を変換します

    • source_timezone(string、必須):変換元の IANA タイムゾーン名。空の場合、または指定されていない場合は、システムのタイムゾーンが使用されます。
    • time(string、必須):変換する時刻を 24 時間形式(HH:MM)で指定します
    • target_timezone(string、必須):変換先の IANA タイムゾーン名。空の場合、または指定されていない場合は、システムのタイムゾーンが使用されます。

インストール

オプション 1:ビルド済みバイナリをダウンロード

GitHub Releases ページから、ご利用のプラットフォーム向けの最新のビルド済みバイナリをダウンロードしてください。

GitHub Releases ページからご利用のプラットフォーム向けのバイナリをダウンロードし、以下のインストール手順に従ってください。

macOS のインストール
Apple Silicon(M1/M2/M3)搭載の macOS:
# Download the arm64 version
curl -L https://github.com/okooo5km/time-mcp-server/releases/latest/download/time-mcp-server-macos-arm64.zip -o time-mcp-server.zip
unzip time-mcp-server.zip
chmod +x time-mcp-server

# Remove quarantine attribute to avoid security warnings
xattr -d com.apple.quarantine time-mcp-server

# Install to your local bin directory
mkdir -p ~/.local/bin
mv time-mcp-server ~/.local/bin/
rm time-mcp-server.zip
Intel プロセッサ搭載の macOS:
# Download the x86_64 version
curl -L https://github.com/okooo5km/time-mcp-server/releases/latest/download/time-mcp-server-macos-x86_64.zip -o time-mcp-server.zip
unzip time-mcp-server.zip
chmod +x time-mcp-server

# Remove quarantine attribute to avoid security warnings
xattr -d com.apple.quarantine time-mcp-server

# Install to your local bin directory
mkdir -p ~/.local/bin
mv time-mcp-server ~/.local/bin/
rm time-mcp-server.zip
macOS ユニバーサルバイナリ(Apple Silicon と Intel の両方で動作):
# Download the universal version
curl -L https://github.com/okooo5km/time-mcp-server/releases/latest/download/time-mcp-server-macos-universal.zip -o time-mcp-server.zip
unzip time-mcp-server.zip
chmod +x time-mcp-server

# Remove quarantine attribute to avoid security warnings
xattr -d com.apple.quarantine time-mcp-server

# Install to your local bin directory
mkdir -p ~/.local/bin
mv time-mcp-server ~/.local/bin/
rm time-mcp-server.zip
Linux のインストール
x86_64 版 Linux(最も一般的):
# Download the amd64 version
curl -L https://github.com/okooo5km/time-mcp-server/releases/latest/download/time-mcp-server-linux-amd64.tar.gz -o time-mcp-server.tar.gz
tar -xzf time-mcp-server.tar.gz
chmod +x time-mcp-server

# Install to your local bin directory
mkdir -p ~/.local/bin
mv time-mcp-server ~/.local/bin/
rm time-mcp-server.tar.gz
ARM64 版 Linux(例:Raspberry Pi 4、AWS Graviton):
# Download the arm64 version
curl -L https://github.com/okooo5km/time-mcp-server/releases/latest/download/time-mcp-server-linux-arm64.tar.gz -o time-mcp-server.tar.gz
tar -xzf time-mcp-server.tar.gz
chmod +x time-mcp-server

# Install to your local bin directory
mkdir -p ~/.local/bin
mv time-mcp-server ~/.local/bin/
rm time-mcp-server.tar.gz
Windows のインストール
x86_64 版 Windows(最も一般的):
  • Windows AMD64 版をダウンロードします
  • ZIP ファイルを展開します
  • time-mcp-server.exe を PATH 上の場所に移動します
ARM64 版 Windows(例:Windows on ARM デバイス):
  • Windows ARM64 版をダウンロードします
  • ZIP ファイルを展開します
  • time-mcp-server.exe を PATH 上の場所に移動します

インストール先のディレクトリが PATH に含まれていることを確認してください。

  • macOS/Linux:シェル設定ファイル(.bashrc、.zshrc など)に export PATH="$HOME/.local/bin:$PATH" を追加します
  • Windows:システムのプロパティ > 環境変数ダイアログから、ディレクトリをシステム PATH に追加します
オプション 2:ソースからビルド
  1. リポジトリをクローンします:

    git clone https://github.com/okooo5km/time-mcp-server.git
    cd time-mcp-server
    
  2. プロジェクトをビルドします:

    Make を使用(推奨):

    # Build for your current platform
    make
    
    # Or build for a specific platform
    make build-darwin-universal    # macOS Universal Binary
    make build-darwin-arm64        # macOS Apple Silicon
    make build-darwin-amd64        # macOS Intel
    make build-linux-amd64         # Linux x86_64
    make build-linux-arm64         # Linux ARM64
    make build-windows-amd64       # Windows x86_64
    
    # Or build for all platforms at once
    make build-all
    
    # Create distribution packages for all platforms
    make dist
    

    バイナリは .build ディレクトリに配置されます。

    Swift を直接使用:

    swift build -c release
    
  3. バイナリをインストールします:

    # Install to user directory (recommended, no sudo required)
    mkdir -p ~/.local/bin
    cp time-mcp-server ~/.local/bin/
    

    シェル設定ファイルに以下を追加して、~/.local/bin が PATH に含まれていることを確認してください:

    echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc  # or ~/.bashrc
    source ~/.zshrc  # or source ~/.bashrc
    

コマンドライン引数

サーバーでは、次のコマンドライン引数を使用できます。

  • -h, --help: サーバーのヘルプ情報、使用方法、利用可能なオプションを表示します
  • -v, --version: time-mcp-server のバージョン番号を表示します
  • -t, --transport <string>: 使用するトランスポートの種類(デフォルト:「stdio」)
    • stdio: LLM と直接連携するための標準入出力モード
    • sse: ウェブベースの接続向けの Server-Sent Events モード
  • -p, --port <int>: SSE モードで実行する際に使用するポート(デフォルト:8080)
  • -l, --local-timezone <string>: 自動検出されたローカルタイムゾーンを、指定した IANA タイムゾーン名で上書きします

使用例:

# Display help information
time-mcp-server --help

# Display version information
time-mcp-server --version

# Start server with default settings (stdio mode)
time-mcp-server

# Start server in SSE mode on the default port (8080)
time-mcp-server --transport sse

# Start server in SSE mode on a custom port
time-mcp-server --transport sse --port 9090

# Start server with a specific local timezone
time-mcp-server --local-timezone Europe/London

SSE モードで実行すると、指定したポートでサーバーに HTTP 経由でアクセスでき、ウェブベースのクライアントが接続できます。デフォルトの stdio モードでは、サーバーは標準入出力を通じて通信します。このモードは、LLM アプリケーションとの直接連携に適しています。

Claude.app の設定

Claude の設定に追加します。

"mcpServers": {
  "RealTime": {
    "command": "time-mcp-server",
    "args": ["-l", "Asia/Shanghai"]
  }
}
Cursor の設定

次の設定を Cursor エディターの Settings - mcp.json に追加します。

{
  "mcpServers": {
    "RealTime": {
      "command": "time-mcp-server",
      "args": ["-l", "Asia/Shanghai"]
    }
  }
}
ChatWise の設定

ChatWise の Settings - Tools に memory MCP サーバーを追加します。

chatwise-settings-tools

システムプロンプトの例

Claude が time-mcp-server を効果的に活用できるよう、次のシステムプロンプトを使用できます。

You have access to time-related tools through MCP. Use these to help users:

- Get the current time in any timezone
- Convert times between timezones
- Calculate time differences between locations
- Plan meetings across different timezones

Use the following tools appropriately:
- `get_current_time` for checking the current time in a specific timezone
- `convert_time` when the user needs to convert between timezones

Always use proper IANA timezone names (e.g., 'America/New_York', 'Europe/London', 'Asia/Tokyo')
rather than abbreviations or common names.

開発要件

  • Swift 6.0 以降
  • macOS 14.0 以降
  • MCP Swift SDK 0.2.0 以降

使用例

現在時刻の取得
{
  "timezone": "America/New_York"
}

応答:

{
  "timezone": "America/New_York",
  "datetime": "2024-11-05T14:30:45-05:00",
  "is_dst": false
}
時刻の変換
{
  "source_timezone": "America/Los_Angeles",
  "time": "15:30",
  "target_timezone": "Asia/Tokyo"
}

応答:

{
  "source": {
    "timezone": "America/Los_Angeles",
    "datetime": "2024-11-05T15:30:00-08:00",
    "is_dst": false
  },
  "target": {
    "timezone": "Asia/Tokyo",
    "datetime": "2024-11-06T08:30:00+09:00",
    "is_dst": false
  },
  "time_difference": "+17h"
}

ユースケース

  • 国際会議の計画:異なるタイムゾーン間で会議を設定します
  • 旅行の計画:旅行先の現地時刻を確認します
  • リモートワークの調整:海外のチームと勤務時間を調整します
  • イベントのスケジュール設定:現地時刻を正しく設定して、グローバルなイベントを開催します
  • 時間に敏感な業務:業務が正しい現地時刻に行われるようにします

バージョン履歴

バージョン履歴と変更履歴については、GitHub Releases をご覧ください。

☕️ プロジェクトを支援する

time-mcp-server が役に立った場合は、開発へのご支援をご検討ください。

  • ⭐️ GitHub でプロジェクトにスターを付ける
  • 🐛 バグを報告する、または機能を提案する
  • 💝 次の方法で支援する:

README の画像

ライセンス

time-mcp-server は MIT License のもとでライセンスされています。MIT License の利用規約に従う限り、ソフトウェアを自由に使用、変更、配布できます。

概要

Model Context Protocol(MCP)向けの時刻サーバーを Swift で実装したもので、AI アシスタントが現在時刻を取得し、タイムゾーン間で時刻を変換できるようにします。このプロジェクトは MCP Swift SDK を使用して構築されています。

コメント

MCP は初めてですか?

プロトコルの概要から最初のサーバーの導入まで、よくある疑問にまとめて答えます。

AI アプリケーションが外部のツールやデータソースに統一的な方法で接続するためのオープンなプロトコルです。クライアントはモデルとの対話を担い、MCP サーバーはツール・リソース・プロンプトテンプレートを提供します。標準メッセージでやり取りするため、1 つのサーバーを複数のクライアントで再利用できます。