Skip to main content
Glama

Python MCP Agent Chatbot

一个完全用 Python 构建的 Agentic AI 课堂项目。Groq 负责模型推理,本地 MCP 服务器提供工具。

架构

Browser -> FastAPI (Python) -> Groq -> MCP Client -> MCP Server (Python) -> Tool

Related MCP server: mcp-datecalc

文件

  • app.py — FastAPI Web 后端、Groq 代理循环和 MCP 客户端

  • mcp_server.py — 包含三个工具的 Python MCP 服务器

  • test_mcp.py — MCP 发现和工具调用测试

  • index.html — 浏览器聊天界面

  • pyproject.toml — Python 依赖

在 Windows 上运行

uv sync --cache-dir .uv-cache
uv run --cache-dir .uv-cache uvicorn app:app --reload

打开 http://127.0.0.1:8000

要在不调用 Groq API 的情况下测试 MCP:

uv run --cache-dir .uv-cache python test_mcp.py

试试这些问题:

  • 25 * 8 + 10 calculate karo

  • Karachi mein abhi kya time hai?

  • Ahmed ki attendance kya hai?

MCP 流程

  1. mcp_server.py 中的函数通过 @mcp.tool() 注册。

  2. app.py 使用 stdio 将该 MCP 服务器作为本地 Python 子进程启动。

  3. MCP 客户端调用 list_tools(),以便 Groq 能看到可用的工具。

  4. Groq 选择一个工具并生成其参数。

  5. MCP 客户端调用 call_tool() 并将工具结果返回给 Groq。

  6. Groq 将结果转换为自然语言回答。

.env 文件包含 Groq 密钥,并有意从 Git 中排除。

Install Server
F
license - not found
A
quality
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

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

  • F
    license
    B
    quality
    C
    maintenance
    Provides computational tools for systematic reasoning, including boolean evaluation, date arithmetic, object counting, state tracking, and format validation, to enhance agent capabilities and eliminate calculation errors in reasoning tasks.
    7
    4
  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables users to perform date arithmetic, compute differences, add durations, and retrieve calendar facts via natural language or direct tool calls.
    9
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables LLMs to fetch real-time weather data for any city and perform basic arithmetic operations like addition.
    MIT

View all related MCP servers

Related MCP Connectors

  • Wall-clock awareness for LLM agents. Two tools: elapsed-time-between-turns + day rollover detection.

  • Gateway between LLM agents and world data through eight tools and a bundled endpoint catalog.

  • 500+ deterministic tools for AI agents: math, conversion, validation, hashing, encoding, date/time.

View all MCP Connectors

Latest Blog Posts

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/massssssssssna/MCP-tested'

If you have feedback or need assistance with the MCP directory API, please join our Discord server