Skip to main content
Glama
tinytelly

Time MCP Server

by tinytelly

Time MCP Server

A Model Context Protocol (MCP) server that provides time and date information for AI assistants like Claude in VSCode.

Features

  • Current Time: Get the current time in various formats

  • Timezone Support: Query time in different timezones

  • Detailed Info: Get comprehensive time information including day of week, timestamp, etc.

  • Multiple Formats: Support for 12-hour, 24-hour, and ISO formats

Related MCP server: Timezone MCP Server

Available Tools

get_current_time

Get the current date and time with formatting options.

Parameters:

  • timezone (optional): Timezone identifier (e.g., "America/New_York", "Europe/London", "Asia/Tokyo")

  • format (optional): Time format - "12hour" (default), "24hour", or "iso"

Examples:

  • "What time is it?"

  • "Get current time in Tokyo"

  • "Show me the time in 24-hour format"

get_time_info

Get detailed time information including timezone data, day of week, and timestamps.

Parameters:

  • timezone (optional): Timezone identifier

Examples:

  • "Give me detailed time information"

  • "Show time info for London timezone"

Prerequisites

Installation

Local Development

  1. Clone or create the project:

    mkdir time-mcp-server
    cd time-mcp-server
  2. Install dependencies:

    npm install
  3. Build the project:

    npm run build

Docker Deployment

Prerequisites: Ensure Docker Desktop is running

# Check Docker is running
docker ps

# If not running, start Docker Desktop
open -a Docker  # or open -a "Docker Desktop"
  1. Build and run with Docker Compose:

    docker-compose up -d
  2. Or build manually:

    docker build -t time-mcp-server .
    docker run -d --name time-mcp-server time-mcp-server
  3. View logs:

    docker-compose logs -f time-mcp-server

Configuration

Configuration

Local Development - Claude in VSCode

For local Node.js execution:

{
  "servers": {
    "time-server": {
      "command": "node",
      "args": ["dist/index.js"],
      "env": {},
      "cwd": "."
    }
  }
}

Docker Deployment - Claude in VSCode

For a running Docker container:

{
  "servers": {
    "time-server": {
      "command": "docker",
      "args": ["exec", "-i", "time-mcp-server", "node", "dist/index.js"],
      "env": {}
    }
  }
}

Option 2: Docker Run (Creates new container each time)

{
  "servers": {
    "time-server": {
      "command": "docker",
      "args": ["run", "--rm", "-i", "time-mcp-server"],
      "env": {}
    }
  }
}

Combined Configuration (Both Docker and Local)

Use this configuration to have both options available simultaneously:

{
  "servers": {
    "time-server-docker": {
      "command": "docker",
      "args": ["exec", "-i", "time-mcp-server", "node", "dist/index.js"],
      "env": {}
    },
    "time-server-local": {
      "command": "node",
      "args": ["dist/index.js"],
      "env": {},
      "cwd": "."
    }
  }
}

Benefits of combined configuration:

  • Fallback options - If Docker is down, local still works

  • Performance testing - Compare Docker vs local performance

  • Development flexibility - Switch between deployment methods

  • Redundancy - Multiple servers provide the same functionality

Note: Place your mcp.json file in the project root directory (same level as package.json) for relative paths to work correctly.

Configuration Steps

For Docker Setup:

  1. Start your Docker container:

    docker-compose up -d
  2. Verify container is running:

    docker ps | grep time-mcp-server
  3. Update mcp.json with Docker configuration

For Local Setup:

  1. Build the project:

    npm run build
    # or
    ./ci.sh
  2. Place mcp.json in project root (same directory as package.json)

  3. Test it works:

    npm test

For Combined Setup:

  1. Ensure both are working (Docker container running + local build exists)

  2. Place the mcp.json in your project root directory

  3. Use the combined mcp.json configuration above

Testing Your Configuration

Test Docker version:

echo '{"jsonrpc": "2.0", "id": 1, "method": "tools/list"}' | docker exec -i time-mcp-server node dist/index.js

Test local version:

echo '{"jsonrpc": "2.0", "id": 1, "method": "tools/list"}' | node dist/index.js

Check logs:

# Docker logs
docker-compose logs -f time-mcp-server

# Local logs appear in terminal when running

Quick Start Guide

  1. Build everything with CI script:

    chmod +x ci.sh
    ./ci.sh
  2. For Docker deployment:

    # Ensure Docker Desktop is running
    docker ps
    
    # Build with Docker
    BUILD_TYPE=docker ./ci.sh
    
    # Start the container
    docker-compose up -d
  3. Configure Claude in VSCode with appropriate mcp.json

Usage Examples

Once configured with Claude in VSCode, you can ask natural language questions:

  • "What time is it?" → Returns current time

  • "What time is it in New York?" → Returns time in EST/EDT

  • "Show me the time in 24-hour format" → Returns time in 24-hour format

  • "Get detailed time information" → Returns comprehensive time data

  • "What day is today?" → Uses detailed info to show current day

Development

Project Structure

time-mcp-server/
├── src/
│   └── index.ts          # Main server code
├── dist/                 # Built JavaScript (generated)
├── ci.sh                 # CI/CD build script
├── Dockerfile            # Docker image definition
├── docker-compose.yml    # Docker orchestration
├── .dockerignore         # Docker build exclusions
├── package.json
├── tsconfig.json
├── .gitignore
└── README.md

Local Development Scripts

  • npm run build - Build TypeScript to JavaScript

  • npm run dev - Build and run the server (for MCP clients)

  • npm start - Run the built server (for MCP clients)

  • npm test - Quick test to verify server is working

CI/CD Build Script

Use the included ci.sh script for automated building and testing:

# Make executable (first time only)
chmod +x ci.sh

# Basic build and test
./ci.sh

# Docker build only
BUILD_TYPE=docker ./ci.sh

# Full build (local + Docker)
BUILD_TYPE=all ./ci.sh

# Skip tests
RUN_TESTS=false ./ci.sh

# Custom Docker tag
BUILD_TYPE=docker DOCKER_TAG=v1.0.0 ./ci.sh

# CI environment
CI=true ./ci.sh

CI Script Features:

  • ✅ Prerequisite checking (Node.js, Docker)

  • ✅ Automated building (TypeScript + Docker)

  • ✅ Comprehensive testing (tool listing, function calls)

  • ✅ Cross-platform compatibility (macOS/Linux)

  • ✅ Color-coded output and error handling

  • ✅ Build artifact generation

Testing

Quick Test:

npm test

Manual Testing:

# Test tool listing
echo '{"jsonrpc": "2.0", "id": 1, "method": "tools/list"}' | node dist/index.js

# Test getting current time
echo '{"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "get_current_time", "arguments": {}}}' | node dist/index.js

Note: npm start and npm run dev will appear to "hang" - this is normal! The server is waiting for MCP protocol messages on stdin. Use the test commands above or configure with Claude to interact with it.

Supported Timezones

The server supports any valid IANA timezone identifier, including:

  • America/New_York

  • Europe/London

  • Asia/Tokyo

  • Australia/Sydney

  • UTC

Dependencies

  • @modelcontextprotocol/sdk - Official MCP SDK

  • typescript - TypeScript compiler

  • @types/node - Node.js type definitions

License

MIT

Contributing

  1. Fork the repository

  2. Create a feature branch

  3. Make your changes

  4. Build and test: npm run build

  5. Submit a pull request

Troubleshooting

Common Issues

"No inputs were found" error:

  • Ensure the src/index.ts file exists

  • Run npm run build after creating the file

Docker not working:

  • Ensure Docker Desktop is installed and running: brew install --cask docker

  • Start Docker Desktop: open -a Docker (wait for whale icon in menu bar)

  • Verify with: docker ps (should not show connection errors)

  • Docker Desktop takes 30-60 seconds to fully start after launching

Server appears to hang:

  • This is normal behavior! The server waits for MCP protocol messages on stdin

  • Use npm test for quick verification, or configure with Claude for actual usage

  • The server only responds when it receives proper JSON-RPC messages

TypeScript errors:

  • Make sure all dependencies are installed: npm install

  • Check TypeScript version compatibility

Debug Mode

Add console logging by setting environment variables:

{
  "servers": {
    "time-server": {
      "command": "node",
      "args": ["/path/to/dist/index.js"],
      "env": {
        "DEBUG": "true"
      }
    }
  }
}

Version History

  • 0.1.0 - Initial release with basic time functionality

Available Tools

2 tools
get_current_timeB

Get the current date and time

ParametersJSON Schema
NameRequiredDescriptionDefault
timezoneNoTimezone (optional, defaults to system timezone)system
formatNoTime format: "12hour", "24hour", or "iso" (default: 12hour)12hour

TDQS

B3.1/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool gets the current date and time, implying a read-only operation, but doesn't mention any behavioral traits like performance, caching, rate limits, or error handling. For a tool with no annotations, this leaves significant gaps in understanding how it behaves.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without any unnecessary words. It's front-loaded and appropriately sized, making it easy to parse and understand quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (2 optional parameters, no output schema, no annotations), the description is minimally adequate. It covers the basic purpose but lacks details on usage guidelines, behavioral traits, and output format, which could help the agent use it more effectively in context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, with clear documentation for both parameters (timezone and format), including defaults and enum values. The description adds no additional parameter information beyond what the schema provides, so it meets the baseline score of 3 for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with a specific verb ('Get') and resource ('current date and time'), making it easy to understand what the tool does. However, it doesn't distinguish this tool from its sibling 'get_time_info', which might have overlapping functionality, so it doesn't reach the highest score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus its sibling 'get_time_info' or any alternatives. It lacks context about specific use cases, prerequisites, or exclusions, leaving the agent without direction on tool selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_time_infoC

Get detailed time information including timezone, day of week, etc.

ParametersJSON Schema
NameRequiredDescriptionDefault
timezoneNoTimezone (optional, defaults to system timezone)system

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It mentions what information is returned but does not disclose behavioral traits such as whether it's a read-only operation, error handling, or performance characteristics. The description is minimal and lacks critical context for a tool with no annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It is appropriately sized and front-loaded, with every part contributing to clarity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of annotations and output schema, the description is incomplete. It does not explain what 'detailed time information' includes beyond examples, nor does it cover return values or potential errors. For a tool with no structured support, more context is needed to be fully helpful.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, with the single parameter 'timezone' well-documented in the schema. The description does not add any parameter-specific details beyond what the schema provides, so it meets the baseline for high schema coverage without compensating with extra semantics.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Get' and the resource 'detailed time information', specifying what information is included (timezone, day of week, etc.). It distinguishes itself from the sibling 'get_current_time' by implying more comprehensive data, though not explicitly contrasting them.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus the sibling 'get_current_time', nor does it mention any prerequisites or exclusions. Usage is implied by the name and description but not explicitly stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 2 tool updates
    • First observedget_current_time
    • First observedget_time_info

TDQS

C2.9/5.0
Disambiguation2/5

The two tools have overlapping purposes: both retrieve time-related information, with 'get_current_time' focusing on basic date/time and 'get_time_info' adding details like timezone and day of week. This creates ambiguity as an agent might struggle to choose between them for general time queries, since their boundaries are unclear and they could be confused for similar tasks.

Naming Consistency5/5

The tool names follow a consistent verb_noun pattern with 'get_' prefix and snake_case formatting throughout. Both tools start with 'get_' followed by descriptive nouns ('current_time', 'time_info'), making the naming predictable and readable without any deviations or mixed conventions.

Tool Count2/5

With only 2 tools, the server feels too thin for a time-related domain, as it lacks basic operations like time conversion, timezone handling, or scheduling functions. This minimal set limits functionality and suggests an incomplete scope, making it borderline inadequate for typical time management tasks.

Completeness2/5

The tool surface is significantly incomplete for a time server domain. It only provides retrieval functions without essential operations such as time conversion between zones, date arithmetic, scheduling, or alarm setting. These gaps will likely cause agent failures when trying to perform common time-related workflows beyond simple queries.

Maintenance

ActivityInactive
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

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

Related MCP Connectors

Related MCP Servers

  • A
    license
    B
    quality
    D
    maintenance
    Gives large language models time awareness capabilities through various time-related functions including current time retrieval, timezone conversion, and relative time calculations.
    6
    1,823
    MIT
  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables LLMs to get current time information for any timezone worldwide, including available regions, cities, and ISO 8601 formatted timestamps with timezone offsets.
    8
    -
  • A
    license
    A
    quality
    C
    maintenance
    Provides LLMs with current date and time information across any timezone, with configurable defaults and support for IANA timezone identifiers.
    1
    30
    3
    Apache 2.0
  • A
    license
    A
    quality
    Not graded
    maintenance
    Provides AI assistants with real-time date, time, and timezone information, enabling them to access current temporal data, format dates, calculate day of week, and work with different timezones.
    4
    7
    -

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/tinytelly/mcp-time'

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