Skip to main content
Glama
IshaanShivalli

college-tools-mcp

College Management AI Assistant (v5)

基于 Google Gemini 和模型上下文协议(Model Context Protocol,MCP)构建的智能高校行政助手。该助手通过结构化的 FastMCP 工具与关系型 SQLite 数据库交互,用来回答有关学生、教师、课程、选课以及学业成绩的问题。


架构概览

+-------------------------------------------------------------+
|                      User / Client                          |
+-------------------------------------------------------------+
                              |
                              v
+-------------------------------------------------------------+
|                   Gemini LLM Assistant                      |
|                         (bot.py)                            |
+-------------------------------------------------------------+
                              |
                     MCP Protocol (stdio)
                              |
                              v
+-------------------------------------------------------------+
|                     FastMCP Server                          |
|                      (tooling.py)                           |
+-------------------------------------------------------------+
                              |
                        SQLite Queries
                              |
                              v
+-------------------------------------------------------------+
|                   College SQLite Database                   |
|                        (college.db)                         |
|   - persons (students, faculty, staff)                      |
|   - courses                                                 |
|   - student_enrollments                                     |
+-------------------------------------------------------------+

Related MCP server: College Scorecard MCP Server

功能特性

  • 合成数据生成:使用 Faker 创建真实完整的高校数据,包括学生、教师、课程以及成绩记录。

  • FastMCP 工具:提供健壮、依据 schema 规范的 MCP 工具,用于查询学术记录、课程、院系和选课统计信息。

  • 交互式多轮对话机器人:基于 Google GenAI SDK(google-genai)的聊天气泡,并通过 MCP 自动编排工具调用。

  • 安全配置:基于环境变量的密钥管理,支持 .env 文件。


项目结构

.
├── bot.py                   # Interactive Gemini chatbot integrating MCP tools via stdio
├── tooling.py               # FastMCP Server exposing database querying tools
├── create_data.py           # SQLite database schema initializer & synthetic data generator
├── college.db               # SQLite database file (generated by create_data.py)
├── system_prompt.txt        # System instruction prompt for the AI assistant
├── prompt.txt               # Context and initial project design prompts
├── mcp_config.example.json  # Example configuration for MCP client registration
├── requirements.txt         # Python package dependencies
├── .env                     # Environment variables (GEMINI_API_KEY)
└── .gitignore               # Git ignore file for Python, SQLite, and secrets

数据库结构

SQLite 数据库(college.db)包含以下关系表:

  1. persons:存储学生、教师和职员的用户档案(ID, name, email, phone, DOB, gender, address, role)。

  2. courses:存储课程信息(course ID, code, course name, department, credits, assigned instructor)。

  3. student_enrollments:存储选课记录(enrollment ID, student ID, course ID, date, grade, semester)。


可用的 MCP 工具(tooling.py

  • get_student_info(student_id_or_name):按 ID、姓名或 email 查找学生档案。

  • get_course_details(course_code_or_name):获取课程详细信息以及授课教师。

  • get_student_enrollments(student_id_or_name):列出某学生的所有课程和成绩。

  • get_students_by_course(course_code_or_name):列出选修某门课程的所有学生。

  • list_courses_by_department(department):列出某个院系的所有全部课程。

  • get_courses_taught_by_faculty(faculty_id_or_name):列出某位教师所教授的所有课程。

  • search_persons(query, role):跨角色(学生、教师、教职工)搜索人员信息。

  • get_course_statistics(course_code_or_name):给出汇总统计(总选课人数、成绩分布)。

  • list_all_courses():提供所有大学课程的完整目录。

  • execute_custom_sql_query(query):供复杂聚合查询的只读 SQL 执行。


设置与安装

1. 前置条件

2. 安装依赖

pip install -r requirements.txt

3. 配置环境变量

在项目的根目录下创建或编辑你的 .env 文件:

GEMINI_API_KEY=your_actual_gemini_api_key_here

4. 生成合成数据

用合成数据初始化数据库:

python create_data.py

使用说明

运行交互式 AI 对话

python bot.py

输入你的学术或行政相关问题(例如,“列出计算机科学系的所有课程”“John Doe 的 ID 是多少?”),输入 exitquit 即可结束会话。

作为 MCP 服务器连接(例如 IDE / Claude Desktop / Antigravity)

可参考 mcp_config.example.json 在 MCP 客户端配置中注册 tooling.py

{
  "mcpServers": {
    "college-tools-mcp": {
      "command": "python",
      "args": [
        "-Wignore",
        "<FULL_PATH_TO>/tooling.py"
      ]
    }
  }
}
F
license - not found
Not graded
quality - not tested
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

View all related MCP servers

Related MCP Connectors

  • Read-only MCP server for ClassQuill, a tutoring-business-management platform.

  • Official Microsoft MCP Server to query Microsoft Entra data using natural language

  • Academic research MCP server for paper search, citation checks, graphs, and deep research.

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/IshaanShivalli/MCP-tools_for-collegeDB'

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