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

时间-MCP

一个最小代理 AI 系统,使用工具增强的 LLM 管道回答与时间相关和一般的问题。

特征

  • Flask API :提供当前时间戳。
  • MCP 代理服务器:推理代理,可检测用户意图、调用工具(如时间 API)、工程师提示并通过 OpenRouter(与 OpenAI 兼容的 API)与 LLM 交互。
  • Streamlit UI :与 AI 代理对话的简单聊天界面。

设置

1. 克隆并安装依赖项

pip install -r requirements.txt

2.环境变量

设置您的 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.py
3号航站楼:Streamlit UI
streamlit run streamlit_ui.py

Streamlit 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 设计模式的启发。
-
security - not tested
F
license - not found
-
quality - not tested

一种代理 AI 系统,通过调用时间 API 工具来回答与时间相关的问题,并使用 LLM 来回答一般问题,可通过简单的聊天界面访问。

  1. 特征
    1. 设置
      1. 1. 克隆并安装依赖项
      2. 2.环境变量
      3. 3. 运行服务器
    2. 用法
      1. 建筑学
        1. 定制
          1. 要求
            1. 致谢

              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