Date Operations MCP

Date Operations MCP

Enables date and time operations including formatting, arithmetic, comparisons, and duration calculations using date-fns library. Provides tools for getting current time, adding/subtracting durations, finding differences between dates, and comparing dates.

Category
Visit Server

README

Date Operations MCP

Lightweight Model Context Protocol (MCP) server exposing common date/time operations powered by date-fns. Built on fastmcp with an HTTP stream transport.

Features

  • now: Current timestamp in ISO 8601
  • format: Format a date using Unicode tokens (UTS #35)
  • add / subtract: Add or subtract a duration from a date
  • difference: Compute difference between two dates in a chosen unit
  • check: Compare two dates (after, before, equal)

Requirements

  • Node.js 18+ (or 20+ recommended)

Install

npm install

Run (dev)

npm run dev
# Server listens on http://localhost:3000 (HTTP stream)

Build & Run (prod)

npm run build
npm start
# Outputs to dist/ and runs Node on dist/index.js

Client integration (MCP over HTTP stream)

This server uses fastmcp with transportType: "httpStream" on port 3000. Point your MCP-capable client at http://localhost:3000.

  • Claude Desktop / Cursor: Configure an MCP HTTP server pointing to http://localhost:3000. Refer to your client's MCP HTTP configuration docs and set the URL accordingly.

Note: The server exposes an HTTP stream suitable for MCP-aware clients. It is not a conventional REST API.

Tools

now

  • Description: Get the current date/time.
  • Parameters: none
  • Returns: ISO 8601 string

Example result:

"2025-01-01T12:34:56.789Z"

format

  • Description: Format a date.
  • Parameters:
    • date (string, ISO 8601)
    • format (string, Unicode tokens per date-fns v4)
  • Returns: formatted string

Example call payload (conceptual):

{
  "date": "2025-01-01T00:00:00.000Z",
  "format": "yyyy-MM-dd'T'HH:mm:ssXXX"
}

add

  • Description: Add a duration to a date.
  • Parameters:
    • date (string, ISO 8601)
    • duration (object) — all numeric fields are required; pass 0 if unused
      • years, months, weeks, days, hours, minutes, seconds
  • Returns: ISO 8601 string (result date)

Example:

{
  "date": "2025-01-01T00:00:00.000Z",
  "duration": {
    "years": 0,
    "months": 1,
    "weeks": 0,
    "days": 2,
    "hours": 0,
    "minutes": 30,
    "seconds": 0
  }
}

subtract

  • Description: Subtract a duration from a date.
  • Parameters: same shape as add
  • Returns: ISO 8601 string (result date)

difference

  • Description: Difference between two dates in a given unit.
  • Parameters:
    • dateFrom (string, ISO 8601)
    • dateTo (string, ISO 8601)
    • unit (enum): seconds | minutes | hours | days | weeks | months | years
  • Returns: human-readable string with the numeric difference and unit

Example:

{
  "dateFrom": "2025-01-01T00:00:00.000Z",
  "dateTo": "2025-02-01T00:00:00.000Z",
  "unit": "days"
}

check

  • Description: Compare two dates.
  • Parameters:
    • firstDate (string, ISO 8601)
    • secondDate (string, ISO 8601)
    • operator (enum): after | before | equal
  • Returns: human-readable string indicating the boolean result

Example:

{
  "firstDate": "2025-01-02T00:00:00.000Z",
  "secondDate": "2025-01-01T00:00:00.000Z",
  "operator": "after"
}

Notes and assumptions

  • Dates are expected as ISO 8601 strings (UTC recommended).
  • format uses Unicode tokens (UTS #35) as in date-fns v4.
  • For add/subtract, provide all duration fields; use 0 when not needed.

Project scripts

  • dev: tsx index.ts
  • build: tsc → emits dist/
  • start: node dist/index.js
  • test: vitest --coverage

License

MIT © Denny Pradipta

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
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
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
E2B

E2B

Using MCP to run code via e2b.

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
Qdrant Server

Qdrant Server

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

Official
Featured