
A Model Context Protocol (MCP) server implementation that allows LLMs to have time awareness capabilities.
current_time
: Get current time (UTC and local time)
relative_time
: Get relative time
get_timestamp
: Get timestamp for the time
days_in_month
: Get days in month
convert_time
: Convert time between timezones
get_week_year
: Get week and isoWeek of the year
Installation
Installing via Smithery
To install time-mcp for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @yokingma/time-mcp --client claude
Manually install (Optional)
npm install -g time-mcp
using npx
npx -y time-mcp
Running on Cursor
Your mcp.json
file will look like this:
{
"mcpServers": {
"time-mcp": {
"command": "npx",
"args": ["-y", "time-mcp"]
}
}
}
Running on Windsurf
Add this to your ./codeium/windsurf/model_config.json
file:
{
"mcpServers": {
"time-mcp": {
"command": "npx",
"args": ["-y", "time-mcp"]
}
}
}
License
MIT License - see LICENSE file for details.
[
{
"description": "Get the current date and time.",
"inputSchema": {
"properties": {
"format": {
"default": "YYYY-MM-DD HH:mm:ss",
"description": "The format of the time, default is empty string",
"enum": [
"h:mm A",
"h:mm:ss A",
"YYYY-MM-DD HH:mm:ss",
"YYYY-MM-DD",
"YYYY-MM",
"MM/DD/YYYY",
"MM/DD/YY",
"YYYY/MM/DD",
"YYYY/MM"
],
"type": "string"
},
"timezone": {
"description": "The timezone of the time, IANA timezone name, e.g. Asia/Shanghai",
"type": "string"
}
},
"required": [
"format"
],
"type": "object"
},
"name": "current_time"
},
{
"description": "Get the relative time from now.",
"inputSchema": {
"properties": {
"time": {
"description": "The time to get the relative time from now. Format: YYYY-MM-DD HH:mm:ss",
"type": "string"
}
},
"type": "object"
},
"name": "relative_time"
},
{
"description": "Get the number of days in a month.",
"inputSchema": {
"properties": {
"date": {
"description": "The date to get the days in month. Format: YYYY-MM-DD",
"type": "string"
}
},
"type": "object"
},
"name": "days_in_month"
},
{
"description": "Get the timestamp of a time.",
"inputSchema": {
"properties": {
"time": {
"description": "The time to get the timestamp. Format: YYYY-MM-DD HH:mm:ss",
"type": "string"
}
},
"type": "object"
},
"name": "get_timestamp"
},
{
"description": "Convert time between timezones.",
"inputSchema": {
"properties": {
"sourceTimezone": {
"description": "The source timezone. IANA timezone name, e.g. Asia/Shanghai",
"type": "string"
},
"targetTimezone": {
"description": "The target timezone. IANA timezone name, e.g. Europe/London",
"type": "string"
},
"time": {
"description": "Date and time in 24-hour format. e.g. 2025-03-23 12:30:00",
"type": "string"
}
},
"required": [
"sourceTimezone",
"targetTimezone",
"time"
],
"type": "object"
},
"name": "convert_time"
}
]