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
Connection Info
You Might Also Like
everything-claude-code
Complete Claude Code configuration collection - agents, skills, hooks,...
markitdown
MarkItDown-MCP is a lightweight server for converting URIs to Markdown.
firecrawl
Firecrawl MCP Server enables web scraping, crawling, and content extraction.
cc-switch
All-in-One Assistant for Claude Code, Codex & Gemini CLI across platforms.
servers
Model Context Protocol Servers
servers
Model Context Protocol Servers