Supports testing the NTP time service via HTTP requests in SSE mode, allowing clients to retrieve accurate time information by specifying NTP servers through request headers.
Provides access to NTP (Network Time Protocol) services through Python, allowing large language models to retrieve accurate network time information with details like timestamps, formatted time strings, and time offsets.
MCP-NTP 时间服务
这是一个基于MCP(Model Context Protocol)的NTP时间服务,为大模型提供准确的网络时间获取功能。
功能特性
- 从NTP服务器获取准确的网络时间
- 支持stdio和sse两种传输模式
- 提供
get_current_time
工具,方便大模型获取当前时间 - 支持环境变量和请求头两种配置NTP服务器的方式
- 返回详细的时间信息和NTP协议数据
安装
配置
环境变量配置(stdio模式)
设置NTP_DOMAIN_URL
环境变量:
请求头配置(sse模式)
在请求头中包含ntp_url
字段:
使用方法
stdio模式
sse模式
工具说明
get_current_time
获取当前NTP服务器时间。
参数:
ntp_server
(可选): NTP服务器地址,如果不提供则使用环境变量或请求头中的配置
返回数据:
调试
可以使用提供的测试NTP服务器进行调试:
开发
项目结构
添加新的NTP服务器
在client.py
中的get_current_time
函数可以轻松扩展支持更多NTP服务器配置。
许可证
MIT License
This server cannot be installed
A Model Context Protocol server that provides accurate network time services for large language models, supporting both stdio and SSE transport modes.
Related MCP Servers
- -securityFlicense-qualityA Model Context Protocol server that enables Large Language Models to access and interact with database connections, including viewing schemas and performing CRUD operations on connected databases.Last updated -
- AsecurityAlicenseAqualityA Model Context Protocol server for time manipulation tasks, enabling AI models to get the current date/time and calculate duration between timestamps.Last updated -2TypeScriptMIT License
- -securityAlicense-qualityA high-performance Model Context Protocol (MCP) server designed for large language models, enabling real-time communication between AI models and applications with support for session management and intelligent tool registration.Last updated -2PythonMIT License
- -securityFlicense-qualityA Model Context Protocol server that enables real-time communication using Server-Sent Events (SSE), providing standardized model management and resource templating capabilities.Last updated -TypeScript