Datetime MCP Server

local-only server

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

Integrations

  • Mentioned as the source repository location for cloning the project with 'git clone https://github.com/bossjones/datetime-mcp-server.git'

  • Used for various development tasks through Makefile commands like 'make uv-sync-all'

  • Used to launch the MCP Inspector with 'npx @modelcontextprotocol/inspector'

日時MCPサーバー

簡単なメモ管理とともに日時機能も提供する MCP (Model Completions Protocol) サーバー。

概要

このサーバーは MCP プロトコルを実装し、次のようなさまざまな日時関連のツールとリソースを提供します。

  • さまざまな形式での現在の日付と時刻
  • 日付フォーマットユーティリティ
  • イベントスケジュールプロンプト
  • シンプルなメモ管理機能

このサーバーは、任意の MCP クライアントで使用でき、日付と時刻の情報にアクセスしたり、簡単なメモを管理したりできます。

特徴

リソース

サーバーは次のリソースを提供します。

  • datetime://current - 現在の日付と時刻
  • datetime://today - ISO形式での今日の日付
  • datetime://time - 24時間形式の現在の時刻
  • note://internal/{name} - ユーザーが作成したメモ

ツール

サーバーは次のツールを提供します。

  • add-note - 名前と内容を指定して新しいメモを追加する
  • get-current-time - さまざまな形式(ISO、読み取り可能、Unix タイムスタンプ、RFC3339)で現在の時刻を取得します。
  • format-date - 指定されたフォーマットパターンに従って日付文字列をフォーマットします

プロンプト

サーバーは次のプロンプトを提供します。

  • summarize-notes - すべてのメモの要約を作成します
  • schedule-event - 特定の時間にイベントをスケジュールするのに役立ちます

インストール

  1. リポジトリをクローンします。
git clone https://github.com/bossjones/datetime-mcp-server.git cd datetime-mcp-server
  1. 仮想環境を作成します。
uv venv source .venv/bin/activate
  1. 依存関係をインストールします。
uv sync

使用法

サーバーの実行

サーバーを実行するには:

uv run python -m datetime_mcp_server.server

サーバーが起動し、stdin/stdout で MCP プロトコル メッセージをリッスンします。

サーバーへの接続

任意のMCPクライアントを使用してサーバーに接続できます。例えば、MCP CLIを使用する場合:

uv run mcp connect datetime-mcp-server

発達

開発依存関係のインストール

# Install all dependencies including development dependencies uv sync --dev

テストの実行

テストを実行するには:

uv run pytest tests/

ユニットテスト

ユニット テストでは、個々のサーバー機能が正しく動作することを確認します。

uv run pytest tests/acceptance/test_server.py

統合テスト

統合テストでは、サーバーが MCP プロトコルを正しく実装していることを確認します。

uv run pytest tests/acceptance/test_server_integration.py

依存関係管理

# Add a production dependency uv add package_name # Add a development dependency uv add --dev package_name # Sync dependencies from lockfile uv sync --frozen # List outdated packages uv outdated

MCP CLI でサーバーを使用する

利用可能なリソースを一覧表示します。

uv run mcp resources list

日時リソースを読み取ります。

uv run mcp resources read datetime://current

メモを追加:

uv run mcp tools call add-note --arguments '{"name": "meeting", "content": "Team meeting at 3pm"}'

現在の時刻を ISO 形式で取得します。

uv run mcp tools call get-current-time --arguments '{"format": "iso"}'

日付のフォーマット:

uv run mcp tools call format-date --arguments '{"date": "2023-10-15", "format": "%B %d, %Y"}'

Makefileタスク

このプロジェクトには、開発を効率化するための Makefile タスクがいくつか含まれています。

# Sync all dependencies with frozen lockfile make uv-sync-all # Sync only development dependencies make uv-sync-dev # Run tests make test

建築と出版

配布用のパッケージを準備するには:

  1. 依存関係を同期し、ロックファイルを更新します。
uv sync
  1. パッケージディストリビューションをビルドします。
uv build

これにより、 dist/ディレクトリにソースとホイールのディストリビューションが作成されます。

  1. PyPI に公開:
uv publish

注: 環境変数またはコマンド フラグを使用して PyPI 資格情報を設定する必要があります。

  • トークン: --tokenまたはUV_PUBLISH_TOKEN
  • またはユーザー名/パスワード: --username / UV_PUBLISH_USERNAMEおよび--password / UV_PUBLISH_PASSWORD

デバッグ

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

次のコマンドを使用して、 npm経由で MCP Inspector を起動できます。

npx @modelcontextprotocol/inspector uv --directory /Users/malcolm/dev/bossjones/datetime-mcp-server run datetime-mcp-server

起動すると、ブラウザでアクセスしてデバッグを開始できる URL がインスペクタに表示されます。

ライセンス

マサチューセッツ工科大学

貢献

  1. リポジトリをフォークする
  2. 機能ブランチを作成する
  3. 変更を加える
  4. uv run pytestでテストを実行します。
  5. プルリクエストを送信する

You must be authenticated.

A
security – no known vulnerabilities
F
license - not found
A
quality - confirmed to work

このサーバーを使用すると、ユーザーはカスタム URI スキームを使用してメモを保存、管理、要約することができ、新しいメモを追加したり、さまざまな詳細レベルの要約を生成したりすることもできます。

  1. Overview
    1. Features
      1. Resources
      2. Tools
      3. Prompts
    2. Installation
      1. Usage
        1. Running the Server
        2. Connecting to the Server
      2. Development
        1. Installing Development Dependencies
        2. Running Tests
        3. Dependency Management
      3. Examples
        1. Using the Server with MCP CLI
      4. Makefile Tasks
        1. Building and Publishing
          1. Debugging
            1. License
              1. Contributing
                ID: fd8f58oegw