Time-MCP
时间-MCP
一个最小代理 AI 系统,使用工具增强的 LLM 管道回答与时间相关和一般的问题。
特征
Flask API :提供当前时间戳。
MCP 代理服务器:推理代理,可检测用户意图、调用工具(如时间 API)、工程师提示并通过 OpenRouter(与 OpenAI 兼容的 API)与 LLM 交互。
Streamlit UI :与 AI 代理对话的简单聊天界面。
Related MCP server: MCP: Multi-Agent Control Point
设置
1. 克隆并安装依赖项
pip install -r requirements.txt2.环境变量
设置您的 OpenRouter API 密钥(从https://openrouter.ai获取):
export OPENROUTER_API_KEY=sk-...your-key...3. 运行服务器
打开三个终端(或使用后台进程):
终端 1:Flask Time API
python flask_api.py终端2:MCP代理服务器
python mcp_server.py3号航站楼:Streamlit UI
streamlit run streamlit_ui.pyStreamlit UI 将在您的浏览器中打开(默认值: http://localhost:8501 )
用法
在 Streamlit UI 中向代理询问任何问题。
如果您询问时间(例如,“现在几点了?”),代理将调用 Flask API,获取当前时间,并使用 LLM 制作漂亮、自然的响应。
对于其他问题,代理人将仅使用 LLM 来回答。
建筑学
[Streamlit UI] → [MCP Agent Server] → [Tools (e.g., Time API)]
↓
[LLM via OpenRouter]MCP 代理检测意图,根据需要调用工具,工程师提示,并将其发送给 LLM。
可轻松扩展以添加更多工具(只需添加到 MCPAgent 类)。
定制
添加更多工具:在
MCPAgent中实现新方法并更新self.tools。改进意图检测:扩展
MCPAgent中的detect_intent()。更改 LLM 模型:更新
call_llm()中的model字段。
要求
Python 3.7+
请参阅
requirements.txt了解依赖项。
致谢
使用 Flask、Streamlit、OpenRouter 和 Python 构建。
受到代理 LLM 设计模式的启发。
This 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
- AlicenseBqualityDmaintenanceGiving LLMs Time Awareness Capabilities. Empower your LLMs with time awareness capabilities. Access current time, convert between timezones, and get timestamps effortlessly. Enhance your applications with precise time-related functionalities.61,01469MIT
- Flicense-qualityDmaintenanceA server that routes user questions to specialized agents (date, location, weather) or an LLM expert, with a simple Streamlit web interface for easy interaction.
- Alicense-quality-maintenanceProvides AI agents with precise, locale-aware date and time data across multiple timezones through a Model Context Protocol API built with TypeScript/Node.js.1
- AlicenseBqualityDmaintenanceProvides current time information and timezone conversion capabilities using IANA timezone names with automatic system detection. It enables LLMs to fetch local or global times and convert specific timestamps between different regions.22MIT
Related MCP Connectors
Wall-clock awareness for LLM agents. Two tools: elapsed-time-between-turns + day rollover detection.
A real clock for AI agents: current time, timezone conversion, and DST facts from the IANA tzdb.
Persistent memory and knowledge management for AI agents with semantic search and 50+ tools.
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/suryawanshishantanu6/time-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server