mcp-datetime

MIT License
7
  • Apple

local-only server

The server can only run on the client’s local machine because it depends on local resources.

mcp-datetime

英語 |日本語

Claudeデスクトップアプリケーション用のMCPサーバーとして実装された日時フォーマットサービス。様々な形式の日時文字列の生成をサポートします。

注意:このパッケージはmacOSでのみテストされています。Windowsとの互換性は検証されていません。

前提条件

mcp-datetime を使用する前に、次のツールがインストールされていることを確認してください。

  • Python 3.12以降
  • uv (Python パッケージインストーラー)
  • uvx (Python パッケージ ランナー)

特徴

  • ✨ さまざまな日付時刻形式をサポート
  • 🇯🇵日本語サポート
  • 📁 ファイル名生成のための最適化された形式
  • 🌏 正確なタイムゾーン処理
  • 🔧 Claudeデスクトップアプリとのシームレスな統合

MCP サーバー コンポーネント

ツール

サーバーは 1 つのツールを実装します。

  • get_datetime : 現在の日付と時刻をさまざまな形式で取得する
    • 必須の文字列引数として「format」を取ります
    • 指定された形式に基づいてフォーマットされた日付時刻文字列を返します。
    • 標準、日本語、ISO形式を含む複数の形式をサポート

Claudeデスクトップアプリでの使用

設定ファイルに次の内容を追加します。

設定ファイルの場所 (macOS): ~/Library/Application Support/Claude/claude_desktop_config.json

{ "mcpServers": { "mcp-datetime": { "command": "uvx", "args": ["mcp-datetime"] } } }

インストールについて

パッケージを直接インストールする必要がある場合 (開発やソースコード検査など)、次のいずれかの方法を使用できます。

  • PyPIからインストール
    pip install mcp-datetime
  • GitHubソースからインストール
    git clone https://github.com/ZeparHyfar/mcp-datetime.git cd mcp-datetime pip install -e .
  • 手動インストール用のclaude_desktop_config.json
    { "mcpServers": { "mcp-datetime": { "command": "python", "args": ["-m", "mcp_datetime"], "env": { "PYTHON": "/path/to/your/python" } } } }
    「/path/to/your/python」を実際のPythonインタープリタのパスに置き換えます。

    例: "/usr/local/bin/python3" または "/Users/username/.pyenv/versions/3.12.0/bin/python3"

基本的な例

  • コマンド形式
    # Standard datetime format call datetime-service.get_datetime {"format": "datetime"} # Result: 2024-12-10 00:54:01 # Japanese format call datetime-service.get_datetime {"format": "datetime_jp"} # Result: 2024年12月10日 00時54分01秒 # Filename format call datetime-service.get_datetime {"format": "filename_md"} # Result: 20241210005401.md
  • Claude デスクトップ アプリのプロンプト例
    • ユーザー
      Please tell me the current time in date_slash format
    • クロード
      I'll get the current date in date_slash format. The current date is 2024/12/12

サポートされている形式

フォーマット名説明
日付2024年12月10日標準的な日付形式
日付スラッシュ2024年12月10日スラッシュ付き日付
日付_jp2024年12月10日日本の日付形式
日時2024年12月10日 00:54:01標準日時
日付時刻_jp2024年12月10日 00時54分01秒日本の日付時刻
日付時刻t2024年12月10日00:54:01T 区切りの DateTime
コンパクト20241210005401IDのコンパクトなフォーマット
コンパクト日付20241210コンパクト日付のみ
コンパクトタイム005401コンパクトタイムのみ
ファイル名_md20241210005401.mdマークダウンファイル名
ファイル名_txt20241210005401.txtテキストファイル名
ファイル名_log20241210005401.logログファイル名
アイソ2024-12-10T00:54:01+0900ISO 8601形式
iso_basic20241210T005401+0900基本的なISOフォーマット
ログ2024-12-10 00:54:01.123456マイクロ秒単位のログ形式
ログコンパクト20241210_005401コンパクトログ形式
時間00:54:01時間のみ
時間_jp00時54分01秒日本の時刻形式

デバッグ

MCPサーバーはstdio経由で実行されるため、デバッグが困難になる場合があります。MCP Inspectorの使用をお勧めします。

  • PyPIパッケージの使用
    npx @modelcontextprotocol/inspector uvx mcp-datetime
  • GitHubからダウンロードしたソースコードを使用する
    git clone https://github.com/ZeparHyfar/mcp-datetime.git npx @modelcontextprotocol/inspector uvx --directory ./mcp-datetime run mcp-datetime

ライセンス

このプロジェクトは MIT ライセンスに基づいてライセンスされています - 詳細についてはLICENSEファイルを参照してください。

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

Claudeデスクトップアプリケーション用のMCPサーバーとして実装された日時フォーマットサービス。様々な形式の日時文字列の生成をサポートします。

  1. Prerequisites
    1. Features
      1. MCP Server Components
        1. Tools
      2. Usage with Claude Desktop App
        1. About Installation
          1. Basic Examples
            1. Supported Formats
              1. Debugging
                1. License
                  ID: y4oh57n2vq