Integrations

  • Provides a time API endpoint that returns the current timestamp, which the MCP agent can query when handling time-related questions

  • Connects to OpenRouter (an OpenAI-compatible API) to access language models for generating responses to user queries

  • Offers a chat interface for users to interact with the MCP agent, allowing them to ask time-related and general questions

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 MCPAgent and update self.tools.
  • Improve intent detection: Extend detect_intent() in MCPAgent.
  • Change LLM model: Update the model field in call_llm().

Requirements

  • Python 3.7+
  • See requirements.txt for dependencies.

Credits

  • Built using Flask, Streamlit, OpenRouter, and Python.
  • Inspired by agentic LLM design patterns.
-
security - not tested
F
license - not found
-
quality - not tested

An agentic AI system that answers time-related questions by calling a time API tool and general questions using an LLM, accessible through a simple chat interface.

  1. Features
    1. Setup
      1. 1. Clone and Install Dependencies
      2. 2. Environment Variable
      3. 3. Run the Servers
    2. Usage
      1. Architecture
        1. Customization
          1. Requirements
            1. Credits

              Related MCP Servers

              • -
                security
                F
                license
                -
                quality
                Provides AI agents with comprehensive Twitter functionality through the Model Context Protocol standard, enabling reading tweets, posting content, managing interactions, and accessing timeline data with robust error handling.
                Last updated -
                4
                1
                JavaScript
                • Apple
              • -
                security
                A
                license
                -
                quality
                A lightweight, modular API service that provides useful tools like weather, date/time, calculator, search, email, and task management through a RESTful interface, designed for integration with AI agents and automated workflows.
                Last updated -
                Python
                MIT License
              • A
                security
                A
                license
                A
                quality
                Integrates with Harvest time tracking API, enabling AI assistants to manage time entries, projects, clients, and tasks through natural language commands.
                Last updated -
                11
                2
                Python
                MIT License
                • Apple
              • -
                security
                A
                license
                -
                quality
                An MCP server implementation that integrates AI assistants with Langfuse workspaces, allowing models to query LLM metrics by time range.
                Last updated -
                9
                JavaScript
                Apache 2.0

              View all related MCP servers

              ID: jxwei6bez4