Skip to main content
Glama

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

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"

Installation

  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

Configuration

For Claude in VSCode

Create an mcp.json file in your project or workspace:

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

Important: Replace /absolute/path/to/time-mcp-server/ with the actual absolute path to your project directory.

Example Configuration

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

Usage

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) ├── package.json ├── tsconfig.json ├── .gitignore └── README.md

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

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

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
-
security - not tested
F
license - not found
-
quality - not tested

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

Provides current time and date information with timezone support and multiple formatting options. Enables AI assistants to answer time-related queries in different timezones with detailed temporal information.

  1. Features
    1. Available Tools
      1. get_current_time
      2. get_time_info
    2. Installation
      1. Configuration
        1. For Claude in VSCode
        2. Example Configuration
      2. Usage
        1. Development
          1. Project Structure
          2. Scripts
          3. Testing
        2. Supported Timezones
          1. Dependencies
            1. License
              1. Contributing
                1. Troubleshooting
                  1. Common Issues
                  2. Debug Mode
                2. Version History

                  Related MCP Servers

                  • A
                    security
                    A
                    license
                    A
                    quality
                    Access the time in any timezone and get the current local time
                    Last updated -
                    1
                    39
                    MIT License
                  • -
                    security
                    A
                    license
                    -
                    quality
                    A Model Context Protocol server that provides the current time in any timezone with customizable formatting, allowing AI assistants to access accurate time information.
                    Last updated -
                    MIT License
                  • -
                    security
                    F
                    license
                    -
                    quality
                    Provides real-time weather information and forecasts, connecting AI assistants with live weather data for current conditions and multi-day forecasts for any location worldwide.
                    Last updated -
                    • Apple
                  • A
                    security
                    A
                    license
                    A
                    quality
                    Provides comprehensive time manipulation capabilities including timezone conversions, date arithmetic, business day calculations, duration calculations, and recurring event handling. Enables natural language time queries with high performance and intelligent caching.
                    Last updated -
                    11
                    1
                    MIT License

                  View all related MCP servers

                  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