The MCP DateTime server provides date and time formatting capabilities that integrate with the Claude Desktop Application. It offers various datetime formats, including standard formats, Japanese language support, and optimized formats for filenames.
Before using the MCP DateTime server, ensure you have:
You can install the package using one of these methods:
From PyPI:
pip install mcp-datetime
From GitHub Source:
git clone https://github.com/ZeparHyfar/mcp-datetime.git
cd mcp-datetime
pip install -e .
To integrate with the Claude Desktop App, add the following to your configuration file:
Config file location (macOS):
~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"mcp-datetime": {
"command": "uvx",
"args": ["mcp-datetime"]
}
}
}
For manual installation, you can use the following configuration:
{
"mcpServers": {
"mcp-datetime": {
"command": "python",
"args": ["-m", "mcp_datetime"],
"env": {
"PYTHON": "/path/to/your/python"
}
}
}
}
Replace "/path/to/your/python" with your actual Python interpreter path (e.g., "/usr/local/bin/python3").
Command Format:
# Standard datetime format
call datetime-service.get_datetime {"format": "datetime"}
# Result: 2024-12-10 00:54:01
# Japanese format
call datetime-service.get_datetime {"format": "datetime_jp"}
# Result: 2024年12月10日 00時54分01秒
# Filename format
call datetime-service.get_datetime {"format": "filename_md"}
# Result: 20241210005401.md
Claude Desktop App Prompt Example:
User:
Please tell me the current time in date_slash format
Claude:
I'll get the current date in date_slash format.
The current date is 2024/12/12
Format Name | Example | Description |
---|---|---|
date | 2024-12-10 | Standard date format |
date_slash | 2024/12/10 | Date with slashes |
date_jp | 2024年12月10日 | Japanese date format |
datetime | 2024-12-10 00:54:01 | Standard datetime |
datetime_jp | 2024年12月10日 00時54分01秒 | Japanese datetime |
datetime_t | 2024-12-10T00:54:01 | DateTime with T separator |
compact | 20241210005401 | Compact format for IDs |
compact_date | 20241210 | Compact date only |
compact_time | 005401 | Compact time only |
filename_md | 20241210005401.md | Markdown filename |
filename_txt | 20241210005401.txt | Text filename |
filename_log | 20241210005401.log | Log filename |
iso | 2024-12-10T00:54:01+0900 | ISO 8601 format |
iso_basic | 20241210T005401+0900 | Basic ISO format |
log | 2024-12-10 00:54:01.123456 | Log format with microseconds |
log_compact | 20241210_005401 | Compact log format |
time | 00:54:01 | Time only |
time_jp | 00時54分01秒 | Japanese time format |
Since MCP servers run over stdio, you can use the MCP Inspector for debugging:
npx @modelcontextprotocol/inspector uvx mcp-datetime
Or with downloaded source code:
git clone https://github.com/ZeparHyfar/mcp-datetime.git
npx @modelcontextprotocol/inspector uvx --directory ./mcp-datetime run mcp-datetime
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.