Content
# MCP Time Server
A time service tool based on the Model Context Protocol (MCP).
## Features
- Provides a tool to get the current time
- Supports timezone conversion
- Written in TypeScript
- Based on the MCP protocol, can be integrated with LLM applications
## Installation
```bash
# Clone the project
git clone <repository-url>
cd mcp-time-server
# Install dependencies
npm install
# Build the project
npm run build
```
## Usage
Start the server:
```bash
npm start
```
The server runs on port 3000 by default, which can be modified using the environment variable `PORT`.
## API Endpoints
- `GET /` - Server homepage and documentation
- `POST /mcp` - MCP message handling endpoint
- `GET /mcp` - SSE server events
- `DELETE /mcp` - Session termination
## MCP Tool Description
### 1. getCurrentTime
Get the current time, with an optional timezone specification.
Parameters:
- `timezone` (optional): Timezone identifier (e.g., 'Asia/Shanghai', 'America/New_York')
### 2. convertTimezone
Convert time between different timezones.
Parameters:
- `datetime` (optional): ISO 8601 formatted date-time string; if not provided, the current time will be used
- `sourceTimezone`: Source timezone, defaults to 'UTC'
- `targetTimezone`: Target timezone, defaults to 'UTC'
## Configure as MCP Service
You can configure it as an MCP service as follows:
```json
"mcpServers": {
"time-server-local": {
"type": "sse",
"url": "http://localhost:3000/mcp"
}
}
```
## Development
```bash
# Start development mode
npm run dev
```
## License
MIT
You Might Also Like
Ollama
Ollama enables easy access to large language models on various platforms.

n8n
n8n is a secure workflow automation platform for technical teams with 400+...
OpenWebUI
Open WebUI is an extensible web interface for customizable applications.

Dify
Dify is a platform for AI workflows, enabling file uploads and self-hosting.

Zed
Zed is a high-performance multiplayer code editor from the creators of Atom.
MarkItDown MCP
markitdown-mcp is a lightweight MCP server for converting various URIs to Markdown.