A Model Context Protocol server that provides time-related capabilities. This server enables LLMs to access current time information and convert times between different timezones. This is a Swift implementation of a time MCP server using the MCP Swift SDK.
get_current_time
- Get the current time in a specific timezonetimezone
(string, required): IANA timezone name (e.g., 'America/New_York', 'Europe/London'). If empty or not provided, the system timezone will be used.convert_time
- Convert time between timezonessource_timezone
(string, required): Source IANA timezone name. If empty or not provided, the system timezone will be used.time
(string, required): Time to convert in 24-hour format (HH:MM)target_timezone
(string, required): Target IANA timezone name. If empty or not provided, the system timezone will be used.The easiest way to install is with the one-line installer, which automatically downloads the latest version and installs it to ~/.local/bin
in your home directory:
curl -fsSL https://raw.githubusercontent.com/okooo5km/time-mcp-server/main/install.sh | bash
The installer will:
~/.local/bin
if it doesn't existClone the repository:
shell
git clone https://github.com/okooo5km/time-mcp-server.git
cd time-mcp-server
Build the project:
shell
swift build -c release
Install the binary:
```shell
mkdir -p ~/.local/bin
cp $(swift build -c release --show-bin-path)/time-mcp-server ~/.local/bin/
```
Make sure ~/.local/bin
is in your PATH by adding to your shell configuration file:
shell
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc # or ~/.bashrc
source ~/.zshrc # or source ~/.bashrc
The server supports the following command line arguments:
-h, --help
: Display help information about the server, its usage, and available options-v, --version
: Display the version number of the time-mcp-serverExample usage:
# Display help information
time-mcp-server --help
# Display version information
time-mcp-server --version
Add to your Claude settings:
"mcpServers": {
"RealTime": {
"command": "time-mcp-server"
}
}
Add the following configuration to your Cursor editor's Settings - mcp.json:
{
"mcpServers": {
"RealTime": {
"command": "time-mcp-server"
}
}
}
Add the memory MCP server to your Chatwise Settings - Tools.
You can use the following system prompt to help Claude utilize the time-mcp-server effectively:
You have access to time-related tools through MCP. Use these to help users:
- Get the current time in any timezone
- Convert times between timezones
- Calculate time differences between locations
- Plan meetings across different timezones
Use the following tools appropriately:
- `get_current_time` for checking the current time in a specific timezone
- `convert_time` when the user needs to convert between timezones
Always use proper IANA timezone names (e.g., 'America/New_York', 'Europe/London', 'Asia/Tokyo')
rather than abbreviations or common names.
{
"timezone": "America/New_York"
}
Response:
{
"timezone": "America/New_York",
"datetime": "2024-11-05T14:30:45-05:00",
"is_dst": false
}
{
"source_timezone": "America/Los_Angeles",
"time": "15:30",
"target_timezone": "Asia/Tokyo"
}
Response:
{
"source": {
"timezone": "America/Los_Angeles",
"datetime": "2024-11-05T15:30:00-08:00",
"is_dst": false
},
"target": {
"timezone": "Asia/Tokyo",
"datetime": "2024-11-06T08:30:00+09:00",
"is_dst": false
},
"time_difference": "+17h"
}
See GitHub Releases for version history and changelog.
If you find time-mcp-server helpful, please consider supporting its development:
time-mcp-server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License.
A Swift implementation of a time server for Model Context Protocol (MCP), enabling AI assistants to access current time information and convert between timezones. This project is built using the MCP Swift SDK.
No packages published