What is IoEHub MCP Time Server?
IoEHub MCP Time Server is a robust server that provides the current Unix timestamp using the Model Context Protocol (MCP). It is designed for AI models that require time information but do not have direct access to the current time.
How to use IoEHub MCP Time Server?
To use the server, you can start it using one of the following methods:
- Batch file (Recommended for Windows):
start-mcp-server.bat
- Direct node command:
node ioehub-time.js
- Using npm:
npm install
followed bynpm start
Key features of IoEHub MCP Time Server?
- Extreme reliability, designed to run independently.
- Comprehensive logging for troubleshooting.
- Self-healing capabilities to maintain availability.
- Provides time data in multiple formats.
- Fully compliant with MCP protocol for integration with AI platforms.
Use cases of IoEHub MCP Time Server?
- Providing current time information to AI models like Claude and Cursor.
- Supporting applications that require accurate timestamps for logging or event tracking.
- Enhancing AI-assisted coding environments with real-time time data.
FAQ from IoEHub MCP Time Server?
- What is the MCP protocol?
The Model Context Protocol (MCP) is a protocol designed for AI models to communicate and access contextual information, including time data.
- Can I run this server on any operating system?
Yes, the server can be run on Windows, Unix, Linux, and macOS with appropriate commands.
- How does the server handle errors?
The server logs errors to both stderr and a log file, making it easier to troubleshoot issues.
IoEHub MCP Time Server
A robust MCP (Model Context Protocol) Time Server that provides the current Unix timestamp. This server implements the MCP protocol to provide time information for AI models that don't have access to the current time.
Features
- Extreme Reliability: Designed to stay running even when stdin/stdout connections are closed
- Comprehensive Logging: Logs to both stderr and file for troubleshooting
- Self-Healing: Resists termination attempts and maintains availability
- Rich Time Information: Provides time data in multiple formats
- MCP Protocol Compliant: Fully compatible with Claude, Cursor and other MCP clients
Installation and Usage
There are several ways to start the server:
Method 1: Using the batch file (Recommended for Windows)
start-mcp-server.bat
This will start the server in background mode, allowing it to run independently.
Method 2: Direct node command
node ioehub-time.js
Method 3: Using npm
npm install
npm start
Protocol Support
This server implements the Model Context Protocol (MCP) and supports the following methods:
initialize
: Initialize the server with capabilitiesgetTime
: Get the current time in various formatsshutdown
: Gracefully shut down the server (server actually stays running)
Time Response Format
The server provides time information in the following formats:
{
"unix_time": 1713258180,
"unix_ms": 1713258180123,
"human_readable": "2024-04-16T09:36:20.000Z",
"formatted": "4/16/2024, 5:36:20 PM",
"utc": "Tue, 16 Apr 2024 09:36:20 GMT",
"date_only": "Tue Apr 16 2024",
"time_only": "09:36:20 GMT+0000 (Coordinated Universal Time)"
}
Logging
Logs are written to both stderr and to a log file in the logs
directory. Each server instance creates a new log file with a timestamp, making it easy to troubleshoot issues.
Integration with AI Platforms
MCP Configuration
Add the time server to your MCP configuration using the following JSON format:
{
"mcpServers": {
"IoEHubMcpTimeServer": {
"command": "cmd",
"args": [
"/c",
"C:\\path\\to\\your\\ioehub-mcp-time-server\\start-mcp-server.bat"
]
}
}
}
For Unix/Linux/macOS environments:
{
"mcpServers": {
"IoEHubMcpTimeServer": {
"command": "node",
"args": [
"/path/to/your/ioehub-mcp-time-server/ioehub-time.js"
]
}
}
}
Using with Claude
Claude AI doesn't have direct access to the current time. To integrate the IoEHub MCP Time Server with Claude:
- Set up the IoEHub MCP Time Server in your MCP configuration:
{
"mcpServers": {
"IoEHubMcpTimeServer": {
"command": "cmd",
"args": [
"/c",
"C:\\path\\to\\your\\ioehub-mcp-time-server\\start-mcp-server.bat"
]
}
}
}
- Claude will automatically gain access to the time server via the MCP protocol. You can access time information directly through function calls:
I need to get the current time.
Using with Cursor
Cursor IDE can benefit from the IoEHub MCP Time Server when working with AI-assisted coding that requires timestamps:
- Configure the IoEHub MCP Time Server in your project settings:
{
"mcpServers": {
"IoEHubMcpTimeServer": {
"command": "cmd",
"args": [
"/c",
"C:\\path\\to\\your\\ioehub-mcp-time-server\\start-mcp-server.bat"
]
}
}
}
- Cursor will automatically have access to the current time information through the MCP protocol.
Troubleshooting
If you encounter issues:
- Check the log files in the
logs
directory - Ensure no other Node.js processes are running that might conflict
- Make sure your MCP configuration points to the correct file paths
