Python MCP server for versatile datetime formatting in Claude Desktop Application
mcp-datetime is an MCP (Model Context Protocol) server designed to provide a datetime formatting service for applications like Claude Desktop. This server supports generating datetime strings in various formats and ensures accurate timezone handling, making it a crucial tool for applications needing date and time data formatted specifically for use cases such as logging, filenames, or user prompts.
mcp-datetime offers core support for datetime generation that is compliant with Model Context Protocol (MCP). Here are some of its key features:
mcp-datetime implements one tool:
get_datetime
: This tool retrieves the current date and time in various formats based on the input provided by MCP clients. It accepts "format" as a required string argument and returns a formatted datetime string accordingly.Thearchitecture of mcp-datetime aligns with the Model Context Protocol (MCP) specifications, ensuring seamless interaction with compatible clients. The server adheres to MCP's stdio-based data exchange protocol, allowing for efficient and reliable communication between the client and server endpoints.
mcp-datetime implements one tool that allows clients to request datetimes in various formats:
format
(string)2024-12-10 00:54:01
2024年12月10日 00時54分01秒
20241210005401.md
To get started with mcp-datetime, you need to install the package and configure it for integration with your application. Follow these steps:
pip install mcp-datetime
Clone the repository:
git clone https://github.com/ZeparHyfar/mcp-datetime.git
cd mcp-datetime
Install the package in editable mode:
pip install -e .
claude_desktop_config.json
for Manual InstallationHere is an example configuration snippet to add mcp-datetime to your Claude Desktop config file:
{
"mcpServers": {
"mcp-datetime": {
"command": "uvx",
"args": ["mcp-datetime"]
}
}
}
Save this configuration in the appropriate location:
~/Library/Application Support/Claude/claude_desktop_config.json
In a logging system, accurate datetimes are crucial for tracking events and operations. mcp-datetime can be used to generate timestamps that conform to the application's requirements. For example:
get_datetime
and provides the current datetime in ISO format.For user prompts or notifications, mcp-datetime can generate human-readable datetimes that are formatted based on locale settings. This ensures that user experiences are consistent across different regions:
get_datetime
and provides the current datetime in Japanese format, 2024年12月10日 00時54分01秒
.mcp-datetime is compatible with several MCP clients, including but not limited to:
MCP Client | Resources | Tools | Prompts | Status |
---|---|---|---|---|
Claude Desktop | ✅ | ✅ | ✅ | Full Support |
Continue | ✅ | ✅ | ✅ | Full Support |
Cursor | ❌ | ✅ | ❌ | Tools Only |
This compatibility matrix indicates that mcp-datetime integrates fully with Claude Desktop and Continuation APIs, making it a robust choice for a wide range of applications.
mcp-datetime is optimized to handle high-volume traffic while maintaining accuracy. It adheres to MCP standards to ensure compatibility across different environments.
graph TD
A[AI Application] -->|MCP Client| B[MCP Protocol]
B --> C[MCP Server]
C --> D[Data Source/Tool]
style A fill:#e1f5fe
style C fill:#f3e5f5
style D fill:#e8f5e8
graph TD
A["MCP Client"]
B[MCP Server]
C[Data Source/Tool]
D[MCP Bus]
A -->|Request| B
B -->|Response| C
style A fill:#f0e4cc
style B fill:#cfe2f3
style C fill:#f6faeb
Here is an example of how to configure mcp-datetime within the Model Context Unit (MCU):
{
"mcpServers": {
"mcp_dtime": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-dtime"],
"env": {
"API_KEY": "your-api-key"
}
}
}
}
This example assumes the usage of an npm package for running MCP servers, which can be replaced based on the environment setup.
If you want to contribute to the development of mcp-datetime, follow these steps:
RuinedFooocus is a local AI image generator and chatbot image server for seamless creative control
Connect your AI with your Bee data for seamless conversations facts and reminders
Learn to connect to MCP servers over HTTP with Python SDK using SSE for efficient protocol communication
Analyze search intent with MCP API for SEO insights and keyword categorization
Simplify MySQL queries with Java-based MysqlMcpServer for easy standard input-output communication
Learn how to use MCProto Ruby gem to create and chain MCP servers for custom solutions