Skip to main content
Glama

Python MCP Agent Chatbot

An Agentic AI classroom project built completely in Python. Groq handles model reasoning while a local MCP server supplies tools.

Architecture

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

Related MCP server: mcp-datecalc

Files

  • app.py — FastAPI web backend, Groq agent loop, and MCP client

  • mcp_server.py — Python MCP server containing three tools

  • test_mcp.py — MCP discovery and tool-call test

  • index.html — browser chat interface

  • pyproject.toml — Python dependencies

Run on Windows

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

Open http://127.0.0.1:8000.

MCP ko Groq API call ke baghair test karne ke liye:

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

Try these questions:

  • 25 * 8 + 10 calculate karo

  • Karachi mein abhi kya time hai?

  • Ahmed ki attendance kya hai?

MCP flow

  1. Functions in mcp_server.py are registered with @mcp.tool().

  2. app.py launches that MCP server as a local Python subprocess using stdio.

  3. The MCP client calls list_tools() so Groq can see the available tools.

  4. Groq selects a tool and generates its arguments.

  5. The MCP client calls call_tool() and returns the tool result to Groq.

  6. Groq converts the result into a natural-language answer.

The .env file contains the Groq key and is intentionally excluded from Git.

Available Tools

3 tools
calculateA

Safely calculate basic arithmetic, for example (25 * 4) + 10.

Inputs: expression (required). Returns: result

find_studentA

Find a demo student's course, attendance, and enrollment status by name.

Inputs: name (required). Returns: result

get_current_timeA

Get the current date and time for an IANA timezone such as Asia/Karachi.

Inputs: timezone. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 3 tools

    Disambiguation5/5

    The three tools serve entirely different purposes—arithmetic, time lookup, and student information—with no overlap in functionality. Each tool has a clear, distinct scope that leaves no ambiguity for an agent.

    Naming Consistency5/5

    All tool names follow a consistent verb-first pattern: 'calculate', 'get_current_time', and 'find_student' each start with an imperative verb and use snake_case. This makes the naming predictable and uniform across the set.

    Tool Count4/5

    With only three tools, the count is on the low end but still within the acceptable range for a utility-focused server. Each tool is self-contained and earns its place, though the server feels sparse for a general-purpose name like 'mcp_server'.

    Completeness3/5

    Each tool provides a complete single operation for its own small domain (e.g., calculate handles arithmetic, get_current_time handles timezone queries), but there are no supporting or related operations. The lack of a cohesive theme makes it unclear if coverage is adequate, and there are potential gaps like missing timezone listing or student CRUD beyond find.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      D
      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
      MIT
    • 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.
      97 npm
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables LLMs to fetch real-time weather data for any city and perform basic arithmetic operations like addition.
      MIT