local-time-mcp
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@local-time-mcpWhat's the current time in New York?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Local Time MCP Server (Node.js)
一个用于学习 MCP(Model Context Protocol)的入门级 Server,提供本地时间相关的工具。
📖 MCP 文档:
mcp核心概念.md —— MCP 是什么
mcp端到端流程.md —— MCP 完整流程
mcp从零编写到发布上线.md —— 从零编写 → 发布 npm → 使用的完整实战
这个仓库是做什么的?
MCP(Model Context Protocol)是一种让 AI 助手调用外部工具的协议。本仓库从零实现了一个 Node.js 的 MCP Server,演示了完整的 "编写 → 发布到 npm → 配置到 AI 助手 → 实际使用" 流程,可作为学习和参考的范本。
它只提供 4 个时间相关工具:
工具 | 功能 | 示例调用 |
| 获取当前时间(支持时区) | "现在几点?""东京现在几点?" |
| 格式化指定时间点 | "把 2026-01-01 格式化一下" |
| 计算两个时间点的差值 | "距离春节还有多久?" |
| 列出可用时区 | "有哪些亚洲时区?" |
已发布到 npm:local-time-mcp-server(需 Node.js 18+)。
Related MCP server: Time & Location MCP Server
怎么使用
方式一:配置到 AI 助手(WorkBuddy / CodeBuddy)—— 最推荐
编辑 MCP 配置文件 ~/.workbuddy/mcp.json(不存在则新建),通过 npx 一键运行,无需克隆仓库:
{
"mcpServers": {
"local-time": {
"type": "stdio",
"command": "npx",
"args": ["local-time-mcp-server@latest"]
}
}
}配置完成后,在 AI 助手的连接器管理页面找到 local-time 并点击 Trust(信任),即可在对话中使用。
方式二:npx 一键运行(推荐,无需克隆仓库)
npx local-time-mcp-server@latest或全局安装:
npm install -g local-time-mcp-server
local-time-mcp-server安装之后:
local-time-mcp-server是一个 stdio 类型的 MCP Server,直接运行时会挂起等待标准输入(它本身不提供交互界面)。它的作用是作为子进程被 AI 客户端启动,所以安装后下一步是把它配置到 AI 助手(见下方"方式一"),然后在对话中就能调用时间工具了。
试试看
在 AI 助手中直接问:
"现在本地几点了?"
"纽约现在几点?"
"距离 2026 年 12 月 31 日还有多少天?"
"列出所有亚洲时区"
发布到 npm
本仓库已配置 CI/CD 自动发布:打一个 v* 版本 tag 并推送,即自动测试、改版本号并发布到 npm。
git add . && git commit -m "改动" && git push
git tag v1.0.5 && git push origin v1.0.5详细的发布步骤、2FA 处理、跨平台修复、CI/CD 配置等,见 mcp从零编写到发布上线.md。
项目结构
local-time-mcp/
├── server.js # MCP Server 主程序(npm bin 入口)
├── test_server.js # 工具逻辑测试脚本
├── package.json # 依赖与发布配置(bin/files/engines)
├── mcp_config_example.json # MCP 配置示例
├── .github/workflows/ # CI/CD(测试 + 自动发布)
├── docs/ # MCP 概念与实战文档
├── .gitignore
└── README.mdThis server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityCmaintenanceAn MCP server that allows checking local time on the client machine or current UTC time from an NTP server234MIT
- FlicenseBqualityDmaintenanceAn MCP server that automatically detects and provides current time and location information based on system timezone and IP geolocation.2
- Flicense-qualityDmaintenanceA minimal MCP server that provides current time information with configurable timezone support set on the client side.
- Flicense-qualityCmaintenanceThis MCP server provides the current server time through a basic resource and tool, following the MCP Apps quickstart.
Related MCP Connectors
Time MCP server via HTTP
A very simple remote MCP server that greets you, with a custom icon.
An MCP server for deep research or task groups
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/gouxinjie/local-time-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server