MCP Current Datetime Server

by ks217

176 downloads
Not rated
GitHub

About

It is an MCP (Model Context Protocol) server that provides the current datetime in ISO 8601 format via a single tool called get-current-datetime. It supports both stdio and HTTP transport layers, making it suitable for integration with MCP-compatible clients like Claude Desktop…

Details

Author
ks217
Downloads
176
Categories
Other

- Tool get-current-datetime returns the current datetime as an ISO 8601 string.
- Supports stdio (default) and HTTP transport modes.
- HTTP mode includes CORS enabled for all origins.
- No parameters required for the tool.
- Easy to install and run with Node.js.

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name MCP Current Datetime Server
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Install Node.js v16 or higher, then run npm install and npm run build to build the project. Start the server with node build/index.js for default stdio mode, or add --http to run an HTTP server on port 3000 that accepts JSON‑RPC 2.0 POST requests at / or /mcp. Integration examples for Claude Desktop and VS Code Copilot are provided in the README.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "mcp current datetime server": {
            "mcp-current-datetime": {
                "command": "node",
                "args": [
                    "build/index.js"
                ]
            }
        }
    }
}

McpServers

{
    "mcp-current-datetime": {
        "command": "node",
        "args": [
            "build/index.js"
        ]
    }
}

MCP Current Datetime Server

This project implements a Model Context Protocol (MCP) server that provides the current datetime in ISO 8601 format. It supports communication over standard input/output (stdio) and HTTP.

✨ Features

- Tool: get-current-datetime — Returns the current datetime as a string in ISO format.
- Transport Modes: You can run the MCP server as stdio or http transport layer using arguments:
- --stdio: Communicate over stdin/stdout (default).
- --http: Start an HTTP server that listens for JSON-RPC 2.0 requests.

🚀 Getting Started

Prerequisites

- Node.js (v16 or higher recommended)
- npm (Node package manager)

Installation

npm install

Building the Project

npm run build

🏁 Running the Server

STDIO Mode (default)

node build/index.js

HTTP Mode

node build/index.js --http

The HTTP server will listen on port 3000 by default and accept MCP requests via POST on / or /mcp.

🛠️ Tool: get-current-datetime

- Description: Returns the current datetime in ISO 8601 format.
- Parameters: None
- Response Format:

{
  "content": [
    {
      "type": "text",
      "text": "2025-06-01T12:34:56.789Z"
    }
  ]
}

⚙️ Integration Examples

Claude Desktop App Config (STDIO)

"currentDatetime": {
  "command": "node",
  "args": [
    "<FULL-PATH-TO-PROJECT>/build/index.js"
  ]
}

VS Code Copilot Config (STDIO)

{
  "mcp": {
    "servers": {
      "currentDatetime": {
        "type": "stdio",
        "command": "node",
        "args": [
          "<FULL-PATH-TO-PROJECT>/build/index.js"
        ]
      }
    }
  }
}

HTTP Integration (for Web or Localhost Clients)

Send a POST request to http://localhost:3000/ or /mcp with a valid MCP JSON-RPC request.

🔒 CORS

CORS is enabled for all origins in HTTP mode to simplify local testing and cross-origin integration.

📄 License

See LICENSE for details.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.