DateTime MCP Server

DateTime MCP Server

Provides the current date and time in the user's timezone through a simple tool with no parameters required.

Category
Visit Server

README

DateTime MCP Server

A Model Context Protocol (MCP) server that provides date and time utilities

Features

  • Get current date and time in user's timezone
  • Get day of the week for any date
  • Calculate difference between two dates

Installation

  1. Clone or download this repository
  2. Install dependencies:
npm install
  1. Build the server:
npm run build

Testing and Debugging

1. MCP Inspector (Recommended)

The easiest way to test your MCP server interactively:

npm run inspector

This will open a web interface where you can:

  • See all available tools
  • Test the datetime, day_of_week, and date_diff tools
  • Inspect requests and responses

2. VSCode Debugging

Use the built-in VSCode debugger with the provided launch configurations:

  • Press F5 or go to Run → Start Debugging
  • Choose "Debug MCP with Inspector" to debug with the web interface
  • Choose "Debug MCP Server" to debug the server directly
  • Set breakpoints in your code to step through execution

3. Manual Testing

Run the test script:

node test-server.js

4. Development Mode

Build automatically on file changes:

npm run watch

In another terminal, run the inspector:

npm run inspector

Common Issues

  • Exit Code 1: Make sure to run npm run build first
  • Port in use: Close other inspector instances
  • Module errors: Verify "type": "module" is in package.json

Configuration

Add the server to your MCP configuration:

For VSCode (Claude Dev Extension):

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

For Claude Desktop:

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

Usage

The server provides the following tools:

1. datetime

Get the current date and time in the user's local timezone.

Parameters: None

Example usage:

use_mcp_tool({
  server_name: "datetime",
  tool_name: "datetime",
})

Example response:

{
  "content": [
    {
      "type": "text",
      "text": "Fri Dec 13 2025 10:30:45 GMT-0500 (Eastern Standard Time)"
    }
  ]
}

2. day_of_week

Get the day of the week for a given date in English.

Parameters:

  • date (string, required): Date in ISO format (YYYY-MM-DD) or DD/MM/YYYY format

Example usage:

use_mcp_tool({
  server_name: "datetime",
  tool_name: "day_of_week",
  arguments: {
    date: "2026-01-05"  // or "5/1/2026"
  }
})

Example response:

{
  "content": [
    {
      "type": "text",
      "text": "Monday"
    }
  ]
}

3. date_diff

Calculate the difference between two dates. Returns days, weeks, months, and years.

Parameters:

  • start_date (string, required): Start date in ISO format (YYYY-MM-DD) or DD/MM/YYYY format
  • end_date (string, optional): End date in ISO format (YYYY-MM-DD) or DD/MM/YYYY format. If omitted, uses current date.

Example usage:

use_mcp_tool({
  server_name: "datetime",
  tool_name: "date_diff",
  arguments: {
    start_date: "2025-01-01",
    end_date: "2026-01-01"
  }
})

Example response:

{
  "content": [
    {
      "type": "text",
      "text": "{\n  \"days\": 365,\n  \"weeks\": 52,\n  \"months\": 12,\n  \"years\": 1,\n  \"start_date\": \"2025-01-01\",\n  \"end_date\": \"2026-01-01\"\n}"
    }
  ]
}

Contributing

Feel free to submit issues and enhancement requests!

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured