DateTime MCP server

Provides datetime tools for retrieving current time in various timezones, listing available timezones, and accessing datetime resources through URIs, enabling accurate and flexible time-related functionalities across different geographical regions.
Back to servers
Provider
odgrim
Release date
Mar 04, 2025
Language
TypeScript
Stats
2 stars

MCP DateTime is a TypeScript server that implements the Model Context Protocol, providing datetime and timezone information to AI agents and chat interfaces. It allows AI systems to obtain current time in different timezones, list available timezones, and access timezone data through URI resources.

Installation

From npm

npm install -g mcp-datetime

From source

git clone https://github.com/odgrmi/mcp-datetime.git
cd mcp-datetime
npm install
npm run build

Usage

Command Line Options

MCP DateTime can be run in two operating modes:

Standard I/O Mode (Default)

This mode integrates with AI systems that support the MCP protocol through standard input/output:

mcp-datetime

Server-Sent Events (SSE) Mode

This mode starts an HTTP server providing SSE transport for the MCP protocol:

mcp-datetime --sse

You can specify a custom port and URI prefix:

mcp-datetime --sse --port=8080 --prefix=/api/datetime

Environment Variables

  • PORT: Sets the port for SSE mode (default: 3000)
  • URI_PREFIX: Sets the URI prefix for SSE mode (default: none)

Available Tools

get-current-time

Returns the current time in the system's local timezone.

get-current-timezone

Returns the current system timezone.

get-time-in-timezone

Returns the current time in a specified timezone.

Parameters:

  • timezone: The timezone to get the current time for (e.g., "America/New_York")

list-timezones

Returns a list of all available timezones.

Resource URIs

MCP DateTime provides access to timezone information through resource URIs:

datetime://{timezone}

Returns the current time in the specified timezone.

Example: datetime://America/New_York

datetime://list

Returns a list of all available timezones.

Common Timezones

The following common timezones are always available:

  • UTC
  • Europe/London
  • Europe/Paris
  • Europe/Berlin
  • America/New_York
  • America/Chicago
  • America/Denver
  • America/Los_Angeles
  • Asia/Tokyo
  • Asia/Shanghai
  • Asia/Kolkata
  • Australia/Sydney
  • Pacific/Auckland

SSE Endpoints

When running in SSE mode, the following endpoints are available:

  • /sse: SSE connection endpoint
  • /message: Message endpoint for client-to-server communication
  • /info: Basic server information

If a URI prefix is specified, it will be prepended to all endpoints.

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later