Time-MCP

Time-MCP

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.

Category
Visit Server

README

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.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured