Skip to main content
Glama
gnokit

MCP DateTime Server

by gnokit

MCP Current Time Server

A minimal Model Context Protocol (MCP) server that provides current local datetime information. This server serves as a blueprint for building simple, single-purpose MCP servers.

Features

  • current-time: Get current local datetime in a simple single-line format

Related MCP server: MCP Time Server

Quick Start

Prerequisites

Installation

# Clone and navigate to project
git clone <repository-url>
cd mcp-datetime

# Install dependencies
bun install

# Make executable
chmod +x src/index.ts

Run Server

bun run src/index.ts

Configuration

Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%/Claude/claude_desktop_config.json (Windows):

{
  "mcpServers": {
    "datetime": {
      "command": "bun",
      "args": ["/absolute/path/to/mcp-datetime/src/index.ts"]
    }
  }
}

VS Code MCP Extension

{
  "mcp": {
    "servers": {
      "datetime": {
        "command": "bun",
        "args": ["/absolute/path/to/mcp-datetime/src/index.ts"]
      }
    }
  }
}

Usage Example

{
  "tool": "current-time",
  "parameters": {
    "timezone": "America/New_York"
  }
}

Response:

Monday, January 15, 2024 at 2:30:45 PM EST

Development

Scripts

# Run server
bun run src/index.ts

# Run tests
bun test

# Build for production
bun build src/index.ts --outdir=dist

Project Structure

src/
├── index.ts              # Main entry point
├── server/
│   └── datetime-server.ts # MCP server configuration
├── tools/
│   ├── current-time.ts    # Current time tool
│   └── current-time.test.ts # Unit tests
├── utils/
│   └── datetime-utils.ts  # Shared utilities
└── types/
    └── datetime.types.ts  # Type definitions

Extending This Blueprint

This minimal server is designed to be easily extended:

  1. Add new tools: Create src/tools/new-tool.ts and register in datetime-server.ts

  2. Add resources: Create src/resources/new-resource.ts and register in datetime-server.ts

  3. Add validation: Use Zod schemas for input validation

  4. Add tests: Create .test.ts files alongside your tools

Testing

Run the test suite:

bun test

Troubleshooting

Common Issues

  1. Permission Denied: Make sure src/index.ts is executable

    chmod +x src/index.ts
  2. Timezone Issues: Ensure valid IANA timezone identifiers are used

License

MIT License - see LICENSE file for details.

A
license - permissive license
-
quality - not tested
D
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • F
    license
    -
    quality
    D
    maintenance
    A minimal MCP server that provides current time information with configurable timezone support set on the client side.
    Last updated
  • A
    license
    -
    quality
    D
    maintenance
    MCP server providing various date/time functions including current time, timezone conversion, and relative time calculations. Supports both local stdio and remote HTTP access via Cloudflare Workers.
    Last updated
    370
    2
    MIT
  • A
    license
    -
    quality
    D
    maintenance
    A simple MCP server that exposes datetime information to agentic systems and chat REPLs
    Last updated
    MIT
  • F
    license
    A
    quality
    C
    maintenance
    A simple MCP server that returns the current date and time with timezone information in ISO 8601, Unix timestamp, and human-readable formats.
    Last updated
    1

View all related MCP servers

Related MCP Connectors

  • Timezone MCP — wraps WorldTimeAPI (free, no auth)

  • A time server that keeps your AI honest about time. Real clock + drift guard, zero dependencies.

  • Time MCP server via HTTP

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/gnokit/mcp-datetime'

If you have feedback or need assistance with the MCP directory API, please join our Discord server