Cover image
Try Now
2025-02-09

3 years

Works with Finder

0

Github Watches

1

Github Forks

0

Github Stars

@dandeliongold/mcp-time

An MCP server for getting current time in ISO format (YYYY-MM-DD HH:mm:ss) using JavaScript Date. This server works with the Claude desktop app on both Windows and macOS.

Components

Tools

  1. getCurrentTime

    • Returns the current time in ISO format
    • No input parameters required
    • Returns:
      {
        "time": "2024-02-08 11:04:33",
        "success": true
      }
      

    Example JSON-RPC request:

    {
      "jsonrpc": "2.0",
      "id": 1,
      "method": "getCurrentTime"
    }
    

    Example JSON-RPC response:

    {
      "jsonrpc": "2.0",
      "id": 1,
      "result": {
        "time": "2024-02-08 11:04:33",
        "success": true
      }
    }
    
  2. getTimeDifference

    • Calculates the time difference between a given timestamp and the current time
    • Parameters:
      • timestamp: ISO format timestamp (YYYY-MM-DD HH:mm:ss)
      • interval: 'minutes' (default) or 'seconds'
    • Returns a signed difference value following this convention:
      • Positive values (+) indicate future timestamps ("in X minutes/seconds")
      • Negative values (-) indicate past timestamps ("X minutes/seconds ago")
      • Zero (0) indicates same timestamp

    Example JSON-RPC request:

    {
      "jsonrpc": "2.0",
      "id": 1,
      "method": "getTimeDifference",
      "params": {
        "timestamp": "2024-02-08 12:30:00",
        "interval": "minutes"
      }
    }
    

    Example JSON-RPC responses:

    // For a past timestamp (30 minutes ago)
    {
      "jsonrpc": "2.0",
      "id": 1,
      "result": {
        "difference": -30,
        "interval": "minutes",
        "inputTimestamp": "2024-02-08 12:30:00",
        "currentTime": "2024-02-08 13:00:00"
      }
    }
    
    // For a future timestamp (in 45 minutes)
    {
      "jsonrpc": "2.0",
      "id": 1,
      "result": {
        "difference": 45,
        "interval": "minutes",
        "inputTimestamp": "2024-02-08 13:45:00",
        "currentTime": "2024-02-08 13:00:00"
      }
    }
    

Features

  • Get current time in YYYY-MM-DD HH:mm:ss format
  • Calculate time differences between timestamps and current time
  • Intuitive positive/negative values for future/past times
  • Support for both minutes and seconds intervals
  • Cross-platform support for Windows and macOS
  • Simple JSON-RPC interface
  • Consistent ISO-style date formatting
  • Error handling with detailed error messages

Installation

npm install @dandeliongold/mcp-time

Usage with Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "time": {
      "command": "npx",
      "args": [
        "@dandeliongold/mcp-time"
      ]
    }
  }
}

Development

  1. Clone the repository
  2. Install dependencies
    npm install
    
  3. Run tests
    npm test
    
  4. Start development server
    npm run dev
    

License

MIT License - see LICENSE for details

相关推荐

  • NiKole Maxwell
  • I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

  • Bora Yalcin
  • Evaluator for marketplace product descriptions, checks for relevancy and keyword stuffing.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Callycode Limited
  • A geek-themed horoscope generator blending Bitcoin prices, tech jargon, and astrological whimsy.

  • Alexandru Strujac
  • Efficient thumbnail creator for YouTube videos

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Khalid kalib
  • Write professional emails

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • Beniyam Berhanu
  • Therapist adept at identifying core issues and offering practical advice with images.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • apappascs
  • 发现市场上最全面,最新的MCP服务器集合。该存储库充当集中式枢纽,提供了广泛的开源和专有MCP服务器目录,并提供功能,文档链接和贡献者。

  • ShrimpingIt
  • MCP系列GPIO Expander的基于Micropython I2C的操作,源自ADAFRUIT_MCP230XX

  • OffchainLabs
  • 进行以太坊的实施

  • huahuayu
  • 统一的API网关,用于将多个Etherscan样区块链Explorer API与对AI助手的模型上下文协议(MCP)支持。

  • deemkeen
  • 用电源组合控制您的MBOT2:MQTT+MCP+LLM

    Reviews

    2 (1)
    Avatar
    user_pi7KR5sU
    2025-04-15

    As a dedicated user of MCP applications, I am highly impressed with the 2025-04-02-mcp-server by fern-api. Its seamless integration and robust performance surpass my expectations. The advanced features and reliable functionalities make it an indispensable tool for our team. Highly recommended for anyone needing a dependable server solution! Link: https://mcp.so/server/2025-04-02-mcp-server/fern-api