MCP DateTime is a TypeScript server that implements the Model Context Protocol, providing datetime and timezone information to AI agents and chat interfaces. It allows AI systems to obtain current time in different timezones, list available timezones, and access timezone data through URI resources.
npm install -g mcp-datetime
git clone https://github.com/odgrmi/mcp-datetime.git
cd mcp-datetime
npm install
npm run build
MCP DateTime can be run in two operating modes:
This mode integrates with AI systems that support the MCP protocol through standard input/output:
mcp-datetime
This mode starts an HTTP server providing SSE transport for the MCP protocol:
mcp-datetime --sse
You can specify a custom port and URI prefix:
mcp-datetime --sse --port=8080 --prefix=/api/datetime
PORT
: Sets the port for SSE mode (default: 3000)URI_PREFIX
: Sets the URI prefix for SSE mode (default: none)Returns the current time in the system's local timezone.
Returns the current system timezone.
Returns the current time in a specified timezone.
Parameters:
timezone
: The timezone to get the current time for (e.g., "America/New_York")Returns a list of all available timezones.
MCP DateTime provides access to timezone information through resource URIs:
Returns the current time in the specified timezone.
Example: datetime://America/New_York
Returns a list of all available timezones.
The following common timezones are always available:
When running in SSE mode, the following endpoints are available:
/sse
: SSE connection endpoint/message
: Message endpoint for client-to-server communication/info
: Basic server informationIf a URI prefix is specified, it will be prepended to all endpoints.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.