Datetime MCP Server
日期时间 MCP 服务器
MCP(模型完成协议)服务器提供日期时间功能以及简单的注释管理。
概述
该服务器实现了 MCP 协议并提供各种与日期时间相关的工具和资源,包括:
不同格式的当前日期和时间
日期格式化实用程序
活动安排提示
简单的笔记管理功能
任何 MCP 客户端都可以使用该服务器来访问日期和时间信息并管理简单的笔记。
Related MCP server: mcp-discord-chat MCP server
特征
资源
服务器提供以下资源:
datetime://current- 当前日期和时间datetime://today- ISO 格式的今日日期datetime://time- 24 小时格式的当前时间note://internal/{name}- 用户创建的注释
工具
该服务器提供以下工具:
add-note- 添加带有名称和内容的新注释get-current-time- 以各种格式获取当前时间(ISO、可读、Unix 时间戳、RFC3339)format-date- 根据指定的格式模式格式化日期字符串
提示
服务器给出如下提示:
summarize-notes- 创建所有笔记的摘要schedule-event- 帮助在特定时间安排事件
安装
克隆存储库:
git clone https://github.com/bossjones/datetime-mcp-server.git
cd datetime-mcp-server创建虚拟环境:
uv venv
source .venv/bin/activate安装依赖项:
uv sync用法
运行服务器
运行服务器:
uv run python -m datetime_mcp_server.server服务器将启动并在 stdin/stdout 上监听 MCP 协议消息。
连接到服务器
您可以使用任何 MCP 客户端连接到服务器。例如,使用 MCP CLI:
uv run mcp connect datetime-mcp-server发展
安装开发依赖项
# Install all dependencies including development dependencies
uv sync --dev运行测试
运行测试:
uv run pytest tests/单元测试
单元测试验证各个服务器功能是否正常工作:
uv run pytest tests/acceptance/test_server.py集成测试
集成测试验证服务器是否正确实现了 MCP 协议:
uv run pytest tests/acceptance/test_server_integration.py依赖管理
# Add a production dependency
uv add package_name
# Add a development dependency
uv add --dev package_name
# Sync dependencies from lockfile
uv sync --frozen
# List outdated packages
uv outdated示例
使用 MCP CLI 的服务器
列出可用资源:
uv run mcp resources list读取日期时间资源:
uv run mcp resources read datetime://current添加注释:
uv run mcp tools call add-note --arguments '{"name": "meeting", "content": "Team meeting at 3pm"}'获取 ISO 格式的当前时间:
uv run mcp tools call get-current-time --arguments '{"format": "iso"}'格式化日期:
uv run mcp tools call format-date --arguments '{"date": "2023-10-15", "format": "%B %d, %Y"}'Makefile 任务
该项目包括几个 Makefile 任务来简化开发:
# Sync all dependencies with frozen lockfile
make uv-sync-all
# Sync only development dependencies
make uv-sync-dev
# Run tests
make test构建和发布
准备分发包:
同步依赖项并更新锁文件:
uv sync构建软件包分发版:
uv build这将在dist/目录中创建源和轮子分布。
发布到 PyPI:
uv publish注意:您需要通过环境变量或命令标志设置 PyPI 凭据:
令牌:
--token或UV_PUBLISH_TOKEN或用户名/密码:
--username/UV_PUBLISH_USERNAME和--password/UV_PUBLISH_PASSWORD
调试
由于 MCP 服务器通过 stdio 运行,调试起来可能比较困难。为了获得最佳调试体验,我们强烈建议使用MCP Inspector 。
您可以使用以下命令通过npm启动 MCP Inspector:
npx @modelcontextprotocol/inspector uv --directory /Users/malcolm/dev/bossjones/datetime-mcp-server run datetime-mcp-server启动后,检查器将显示一个 URL,您可以在浏览器中访问该 URL 以开始调试。
执照
麻省理工学院
贡献
分叉存储库
创建功能分支
进行更改
使用
uv run pytest运行测试提交拉取请求
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/bossjones/datetime-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server