time-mcp
A minimal agentic AI system that answers time-related and general questions using a tool-augmented LLM pipeline.
Features
- Flask API: Provides the current timestamp.
- MCP Agent Server: Reasoning agent that detects user intent, calls tools (like the time API), engineers prompts, and interacts with an LLM via OpenRouter (OpenAI-compatible API).
- Streamlit UI: Simple chat interface to talk to the AI agent.
Setup
1. Clone and Install Dependencies
pip install -r requirements.txt
2. Environment Variable
Set your OpenRouter API key (get one from https://openrouter.ai):
export OPENROUTER_API_KEY=sk-...your-key...
3. Run the Servers
Open three terminals (or use background processes):
Terminal 1: Flask Time API
python flask_api.py
Terminal 2: MCP Agent Server
python mcp_server.py
Terminal 3: Streamlit UI
streamlit run streamlit_ui.py
The Streamlit UI will open in your browser (default: http://localhost:8501)
Usage
- Ask the agent any question in the Streamlit UI.
- If you ask about the time (e.g., “What is the time?”), the agent will call the Flask API, fetch the current time, and craft a beautiful, natural response using the LLM.
- For other questions, the agent will answer using the LLM only.
Architecture
[Streamlit UI] → [MCP Agent Server] → [Tools (e.g., Time API)]
↓
[LLM via OpenRouter]
- The MCP agent detects intent, calls tools as needed, engineers prompts, and sends them to the LLM.
- Easily extensible to add more tools (just add to the MCPAgent class).
Customization
- Add more tools: Implement new methods in
MCPAgentand updateself.tools. - Improve intent detection: Extend
detect_intent()inMCPAgent. - Change LLM model: Update the
modelfield incall_llm().
Requirements
- Python 3.7+
- See
requirements.txtfor dependencies.
Credits
- Built using Flask, Streamlit, OpenRouter, and Python.
- Inspired by agentic LLM design patterns.
Time Agent Server
Project Details
- suryawanshishantanu6/time-mcp
- Last Updated: 5/8/2025
Recomended MCP Servers
支持查询主流agent框架技术文档的MCP server(支持stdio和sse两种传输协议), 支持 langchain、llama-index、autogen、agno、openai-agents-sdk、mcp-doc、camel-ai 和 crew-ai
MCP web research server (give Claude real-time info from the web)
A powerful Model Context Protocol (MCP) server that provides an access to serverless browser for AI agents and...
A VS Code extension implementing MCP server for WordPress integration
Model Context Protocol (MCP) server for using the Eyevinn Open Source Cloud API
Model Context Protocol (MCP) server that provides a flexible and configurable two-stage reasoning and response generation system
将微信读书划线同步到Notion
Lightweight programs that each expose specific capabilities through the standardized Model Context Protocol
A MCP Task Server
A Model Context Protocol (MCP) server that converts Mermaid diagrams to PNG images





