Provides timezone-aware current time via MCP on Cloudflare Workers with a default timezone override.
Configuration
View docs{
"mcpServers": {
"kiyo-e-time-mcp": {
"url": "https://your-worker.your-subdomain.workers.dev",
"headers": {
"DEFAULT_TIMEZONE": "Asia/Tokyo"
}
}
}
}You deploy a Cloudflare Workers MCP server that serves time information with timezone awareness. It responds in ISO 8601 format and lets AI agents request the current time in any IANA timezone, making it easy to build time-aware workflows and ensure consistent timestamps across agents and services.
You access the time service as an MCP endpoint from your MCP clients. Call the get_time tool to obtain the current date and time for a specific timezone. If you do not specify a timezone, the service uses a default timezone you configure. The response is a timestamp in ISO 8601 format with the UTC offset, suitable for logging, scheduling, and agent reasoning.
Prerequisites you need before installation are Node.js 18 or later and a Cloudflare account to deploy Workers. Install the Wrangler CLI to interact with Cloudflare Workers.
Step 1: Install dependencies for the project.
npm installStep 2: Start the local development server to test MCP interactions.
npm run devStep 3: Deploy to Cloudflare Workers.
npm run deployOptional: Override the default timezone during deployment to your preferred value.
wrangler deploy --var DEFAULT_TIMEZONE:America/New_YorkConfiguration uses an environment variable to set the default timezone when no explicit timezone is provided. The default is Asia/Tokyo unless overridden.
You can verify the runtime runs on Cloudflare’s edge network and that the time returned adheres to ISO 8601 with the correct offset.
HTTP MCP connection (remote endpoint) is supported. Use the provided URL to connect your MCP client to the time service.
Example MCP client connection (remote) shows how to add the time server to your client configuration.
{
"mcpServers": {
"time": {
"url": "https://your-worker.your-subdomain.workers.dev",
"params": {}
}
}
}Keep your deployment secrets and environment variables secure. Only expose necessary endpoints to MCP clients and follow standard Cloudflare security practices for Workers.
If you encounter timezone issues, verify the DEFAULT_TIMEZONE value and confirm that the timezone you request is a valid IANA identifier. For development issues, ensure dependencies are installed and that the local dev server is running.
Returns the current date and time in a specified timezone. If no timezone is provided, it uses DEFAULT_TIMEZONE. The final fallback is Asia/Tokyo. The response is in ISO 8601 format with UTC offset.