Token导航 LogoToken导航TokenDH.com
Kite MCP Server Time logo
AI代理stdio官方级别未说明来源级核验

Kite MCP Server Time

MCP Server

一个基于TypeScript的MCP时间服务器,提供时区转换和时间计算功能,支持多种传输协议和容器化部署。

工具数

2

提示词数

0

GitHub Stars

1

资源数

0
时间服务容器化部署TypeScriptDocker

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

kitemcp

提供方

kitemcp

最后核验

2026/5/17 20:22

运行时

Docker

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

docker run --name mcp-time-stdio mcp-time-server

详细介绍

TypeScript中的MCP时间服务器

MCP(模型上下文协议)服务器的TypeScript实现,提供与时间相关的工具。

特性

  • 获取当前时间:获取指定时区的当前时间
  • 转换时间:使用时差计算在不同时区之间转换时间
  • 模块化架构:将服务器创建和传输绑定分开,以实现灵活性
  • 多种运输方式:支持stdio和HTTP传输
  • Docker支持:易于集装箱化部署

需求

  • Node.js 18+
  • npm或纱线
  • Docker(可选,用于容器化部署)

安装

# Clone the repository
git clone 
cd mcp-time-server

# Install dependencies
npm install

运行服务器

使用stdio传输(默认)

# Build the project
npm run build

# Start with stdio transport
npm start

使用HTTP传输

# Build the project
npm run build

# Start with HTTP transport on default port 3000
node dist/index.js --transport=http

# Start with HTTP transport on custom port
node dist/index.js --transport=http --port=8080

发展模式

npm run dev

Docker部署

使用Docker构建和运行

# Build the Docker image
docker build -t mcp-time-server .

# Run with stdio transport (default)
docker run --name mcp-time-stdio mcp-time-server

# Run with HTTP transport
docker run --name mcp-time-http -p 3000:3000 mcp-time-server node dist/index.js --transport=http

使用Docker Compose

# Start the HTTP version
docker-compose up mcp-time-http

# Start the stdio version
docker-compose up mcp-time-stdio

# Start both services
docker-compose up

HTTP传输端点

使用HTTP传输时,以下端点可用:

  • POST/mcp:主MCP协议端点
  • GET/状态:返回服务器状态信息

要测试HTTP传输:

  1. 使用启动服务器 --transport=http
  2. 使用配置为连接到的MCP客户端 http://localhost:3000/mcp

项目结构

该项目遵循模块化架构,关注点明确分离:

src/
├── index.ts               # Entry point and command-line handling
├── server.ts              # MCP server creation and configuration
├── timeService.ts         # Time-related utilities and calculations
├── types.ts               # Shared types and interfaces
└── transports/
    ├── index.ts           # Transport exports and utilities
    ├── stdio.ts           # Standard I/O transport implementation
    └── http.ts            # HTTP transport implementation

模块

  1. timeService.ts:时间操作的核心业务逻辑
  2. server.ts:使用工具创建和配置MCP服务器
  3. 运输工具/:包含不同的传输实现
  4. types.ts:共享类型定义
  5. index.ts:主要应用程序入口点

这种模块化设计使代码库更易于维护,并有助于:

  • 添加新的运输类型
  • 对单个组件进行单元测试
  • 使用新的时间相关工具扩展功能

工具

1. get_current_time

获取指定时区的当前时间。

输入架构:

{
  "timezone": "IANA timezone name (e.g., 'America/New_York', 'Europe/London')"
}

结果:

{
  "timezone": "America/New_York",
  "datetime": "2023-06-01T12:34:56-04:00", 
  "is_dst": true
}

2. convert_time

在不同时区之间转换时间。

输入架构:

{
  "source_timezone": "IANA timezone name (e.g., 'America/New_York')",
  "time": "14:30", 
  "target_timezone": "IANA timezone name (e.g., 'Asia/Tokyo')"
}

结果:

{
  "source": {
    "timezone": "America/New_York",
    "datetime": "2023-06-01T14:30:00-04:00",
    "is_dst": true
  },
  "target": {
    "timezone": "Asia/Tokyo",
    "datetime": "2023-06-02T03:30:00+09:00", 
    "is_dst": false
  },
  "time_difference": "+13.0h"
}

实现细节

此服务器是使用以下方式构建的:

  • TypeScript
  • MCP TypeScript SDK
  • 用于HTTP传输的Express
  • Luxon用于时区处理
  • Zod用于模式验证

许可证

国际协调委员会

目录标签

目录标签

时间服务容器化部署TypeScriptDocker本地部署时区转换MCP协议

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

none

运行时(runtime,运行环境)

Docker

工具数量(toolCount,工具数)

2

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdionone部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP