Time MCP
A Model Context Protocol (MCP) server that provides time-related tools for LLM applications.
Features
Get current UTC time in ISO 8601 format
Get Unix timestamp
Support for timezone queries (optional extension)
Requirements
Node.js 18+
pnpm
Docker Deployment
🐳 Docker 部署: 查看 DOCKER.md 了解如何使用 Docker 和 Docker Compose 部署 Time MCP 服务器。
快速开始:
Installation
Development
Transport Modes
This server supports two transport modes:
Stdio Mode (Default)
The server communicates via standard input/output streams. This is the default mode and is suitable for local process communication.
HTTP Mode
The server runs as an HTTP server and can be accessed remotely. Suitable for remote deployment and network communication.
Environment Variables for HTTP Mode:
TRANSPORT: Transport type (stdio|http), default:stdioPORT: HTTP port (HTTP mode), default:3000HOST: HTTP listen address (HTTP mode), default:0.0.0.0MCP_PATHorAPI_PATH: HTTP API path (HTTP mode), default:/mcpLOG_LEVEL: Log level (DEBUG|INFO|WARN|ERROR), default:INFO
Logging
The server includes comprehensive logging for troubleshooting. Logs are output to stderr (following MCP protocol conventions).
Log Levels:
DEBUG: Detailed debug information (most verbose)INFO: General informational messages (default)WARN: Warning messagesERROR: Error messages only (least verbose)
Setting Log Level:
What Gets Logged:
Server startup and shutdown
Transport creation and connection
HTTP request/response details (method, path, duration)
Tool calls (name, arguments, results)
Errors with stack traces
Usage
📖 详细使用文档: 查看 USAGE.md 了解如何在其他 LLM 应用中集成和使用 time-mcp,包括在 OpenAI JS SDK Response API 中的完整示例。
This MCP server provides the following tools:
getCurrentTime
Returns the current UTC time in ISO 8601 format along with Unix timestamp.
Parameters: None
Returns:
License
ISC