mcp-time
by lyzetam
README.md
# mcp-time
[](https://www.python.org/downloads/)
[](https://opensource.org/licenses/MIT)
MCP server and LangChain tools for time and timezone operations. Stateless, zero-config, no external dependencies.
## Features
5 tools for time operations:
| Tool | Description |
|------|-------------|
| `get_current_time` | Get current time in any IANA timezone (ISO format) |
| `get_current_timestamp` | Get current Unix timestamp in seconds |
| `convert_timezone` | Convert time between timezones |
| `get_time_difference` | Calculate difference between two timestamps |
| `format_time` | Format ISO time with Python strftime patterns |
## Installation
```bash
# Core library (no dependencies)
pip install .
# With MCP server support
pip install ".[mcp]"
# With LangChain tools
pip install ".[langchain]"
# Everything
pip install ".[all]"
```
## Configuration
No configuration required. This server is stateless and uses only Python's built-in `datetime` and `zoneinfo` modules.
## Quick Start
### As MCP Server
```bash
# Run via stdio (for Claude Desktop/Code)
mcp-time
```
Add to Claude Code (`~/.claude.json`):
```json
{
"mcpServers": {
"time": {
"type": "stdio",
"command": "mcp-time"
}
}
}
```
### As LangChain Tools
```python
from mcp_time.langchain_tools import TOOLS, time_now, time_convert
# Use all 5 tools with an agent
agent = create_react_agent(llm, TOOLS)
# Or use individual tools
print(time_now.invoke({"timezone_name": "America/New_York"}))
print(time_convert.invoke({
"time_str": "2024-01-12 14:00:00",
"from_tz": "America/New_York",
"to_tz": "Asia/Tokyo",
}))
```
### As Python Library
```python
from mcp_time.operations import time_ops
time_ops.get_current_time("Europe/London")
time_ops.convert_timezone("2024-01-12 14:00:00", "US/Eastern", "Asia/Tokyo")
time_ops.get_time_difference("2024-01-12T10:00:00", "2024-01-12T14:30:00")
time_ops.format_time("2024-01-12T14:30:00", "%B %d, %Y at %I:%M %p")
```
## License
MIT
This server cannot be deployed
Maintenance
ActivityInactive
ResponsivenessNo recent community issues