campus-course
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@campus-course张老师教哪些课程?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
campus-course 课程信息 MCP Server
封装课程信息 MCP Server。使用 Python SQLite 存储课程/教师/作业数据, 通过 MCP Python SDK 2.x 将查询函数封装为 MCP Tools,接入 Codex 智能体, 支持自然语言查询课程信息。
目录结构
mcp-course-demo/
├── .venv/ # uv 虚拟环境(Python 3.12 + mcp 2.x)
├── courses.db # SQLite 数据库(由 init_db.py 生成)
├── pyproject.toml / uv.lock # uv 项目配置与锁文件
├── screenshots/ # 功能运行截图(Inspector / Codex)
└── src/mcp_course_demo/
├── init_db.py # 建库脚本:teachers/courses/assignments 三表 + 种子数据
├── db.py # SQLite 参数化查询层(sqlite3 标准库)
└── server.py # MCP Server 入口(MCPServer,stdio 传输)Related MCP server: Canvas Assignment Assistant MCP Server
数据表
teachers(教师):teacher_id、name、title、department、emailcourses(课程):course_id、name、teacher_id(FK)、weekday、time、location、creditsassignments(作业):assignment_id、course_id(FK)、title、due_date、description
MCP Tools
工具名 | 功能 |
| 按课程名/课程号/教师姓名模糊搜索课程 |
| 按课程号(如 CS101)查课程详情(含教师信息) |
| 查某天课程表(支持“周一/星期一/Mon/1”) |
| 查教师信息及所授课程列表 |
| 查作业及截止日期(可按课程过滤) |
环境复现与运行
# 1. (可选)重建数据库
uv run python -m mcp_course_demo.init_db
# 2. 启动 MCP Server(stdio,供 MCP 客户端连接)
uv run campus-course
# 等价于:uv run python -m mcp_course_demo.server
# 3. MCP Inspector 可视化调试
npx @modelcontextprotocol/inspector uv run campus-courseCodex 接入
在 ~/.codex/config.toml 追加:
[mcp_servers.campus-course]
command = 'C:\Users\dell\.local\bin\uv.exe'
args = ["run", "--directory", '<项目绝对路径>\mcp-course-demo', "campus-course"]
startup_timeout_sec = 120
tool_timeout_sec = 60
default_tools_approval_mode = "approve" # 非交互/自动批准工具调用,避免 "user cancelled MCP tool call"
[mcp_servers.campus-course.env]
PYTHONIOENCODING = "utf-8"接入后在 Codex 中自然语言提问即可,例如:
“张老师教哪些课程?”
“CS101 有哪些作业?截止日期是什么时候?”
“周三有什么课?”
Available Tools
5 toolsget_courseA
按课程编号精确查询某一门课程的详细信息(含任课教师信息)。
course_id 形如 CS101、AI201。返回课程名、星期、节次时间、地点、
学分,以及教师姓名、职称、院系、邮箱。
| Name | Required | Description | Default |
|---|---|---|---|
| course_id | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It does this well: it discloses exact-match lookup semantics, that results include instructor data, and it enumerates the complete return payload (课程名、星期、节次时间、地点、学分、教师姓名、职称、院系、邮箱). The only unstated behavior is the not-found case, which is a minor gap.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two tightly packed paragraphs: the first states the purpose, the second covers parameter format and return fields. There is no filler, no restating of schema facts, and the core purpose is front-loaded in the first clause.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a low-complexity tool (one required parameter, no output schema, no annotations), the description is complete: it documents the input format, the exact-match semantics, and the full return payload — necessary because no output schema exists to carry that information. An agent has everything required to call it correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must compensate — and it does, defining course_id semantically as a course number and giving concrete format examples (CS101、AI201). This meaningfully exceeds the schema, which only declares 'type: string' and the parameter name.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description opens with '按课程编号精确查询某一门课程的详细信息(含任课教师信息)' — a specific verb (查询), resource (课程), and exact-match scope (精确, 某一门). The '精确' qualifier and the by-course-number key distinguish this from sibling tools like search_courses and list_courses_by_weekday without needing to inspect their schemas.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description conveys a clear usage context: invoke this when you hold an exact course_id, reinforced by the format examples ('course_id 形如 CS101、AI201'). However, it does not explicitly name alternatives or state when not to use this tool (e.g., fuzzy name search belongs to search_courses), so it stops short of full exclusion guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_teacherA
按教师姓名(如“李老师”)或工号(如 T002)查询教师信息。
返回教师职称、院系、邮箱,以及该教师本学期所授全部课程列表。
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the behavioral burden and does disclose that this is a lookup operation and exactly what is returned, including the current-semester course list. It omits edge cases like not-found or duplicate-name behavior, but these are minor for a simple read tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two concise sentences front-load the lookup method and then state the returned data. No filler or repetition of schema data.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a one-parameter query tool with no output schema, the description covers both input semantics and return values. It could add handling for ambiguous names or missing teachers, but nothing essential is absent.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 0% and the parameter is merely named 'name'. The description compensates fully by specifying that it accepts either a teacher name ('李老师') or employee ID ('T002') and gives concrete examples.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description names the exact action (查询) and resource (教师信息), explicitly lists accepted lookup keys (name or employee ID), and enumerates the returned fields. This makes it clearly distinct from course- and assignment-focused siblings.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The intended use is inferred: query teacher info by name or ID. However, there is no explicit comparison with sibling tools such as get_course or search_courses, and no when-not-to-use guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_assignmentsA
查询课程作业列表及截止日期;不传 course_id 时返回全部课程的作业。
course_id 形如 CS101。每条作业包含课程编号、课程名、作业标题、
截止日期和作业要求说明,按截止日期排序;查不到作业时返回提示信息。
| Name | Required | Description | Default |
|---|---|---|---|
| course_id | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the burden and does well: it discloses the output shape, sorting order by deadline, handling of missing data with a prompt message, and the all-courses fallback behavior. It does not discuss edge cases like pagination or authentication, but for a simple read tool the disclosure is strong.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three compact sentences cover the core behavior, the optional parameter semantics, output fields, sorting, and empty-result behavior. There is no redundant or filler content.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool is simple with one optional parameter, and the description covers input semantics, output contents, ordering, and the no-result case. Since an output schema exists, return value details do not need further elaboration.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must compensate. It fully explains the only parameter: course_id is optional, has a format example (CS101), and omitting it returns all courses' assignments. This is more than the schema provides.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb and resource: querying course assignment lists with deadlines. It distinguishes itself from sibling course-related tools by clearly targeting assignments, and it explains the optional course_id behavior upfront.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description clearly explains when to pass course_id and what happens when it is omitted, which is clear usage context. It does not explicitly name alternative tools or exclusions, but the naming and purpose make the intended use unambiguous.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_courses_by_weekdayA
查询星期几有哪些课(当天课程表)。
weekday 支持“周一”“星期一”“Mon”“1”等常见写法,按上课时间排序返回 课程编号、名称、教师、节次时间、地点与学分;当天没课时返回提示信息。
| Name | Required | Description | Default |
|---|---|---|---|
| weekday | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden and does it well: it discloses accepted weekday input forms (周一/星期一/Mon/1), returns sorted by class time, specifies the exact returned fields (course number, name, teacher, period time, location, credits), and states the empty-day behavior with a prompt message. This is substantial behavioral context beyond the raw schema.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two compact sentences with zero filler: the purpose is front-loaded in a parenthetical, and the second sentence packs parameter flexibility, ordering, return fields, and the empty case. Every clause earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple one-parameter tool with an output schema, the description is nearly complete: it covers purpose, accepted input formats, output contents, ordering, and the empty result case. The only gaps are lack of sibling differentiation and unspecified behavior for invalid/unsupported weekday strings, both minor for a query tool of this simplicity.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must compensate, and it does: it explains that weekday accepts common representations such as 周一, 星期一, Mon, and 1, giving an agent concrete calling guidance the schema alone cannot. It loses a point for the open-ended '等常见写法' and no statement of what happens with unsupported input.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb and resource: 查询星期几有哪些课 (query which courses fall on a given weekday), clarifying it is the schedule-by-day tool. This is clearly distinct from siblings like get_course or get_teacher, though it doesn't explicitly name or contrast them, so it stops short of a 5.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Usage is implied: when an agent needs a given day's timetable, this tool fits. However, there is no explicit guidance about when to prefer it over search_courses or list_assignments, and no exclusions or routing among the four sibling tools.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
search_coursesA
根据课程名称、课程编号或教师姓名搜索课程,关键词支持模糊匹配。
例如:关键词“张”可找出张老师的所有课程;关键词“python”可找出 Python 程序设计课程。返回匹配课程的编号、名称、教师、上课时间、 地点与学分列表;无匹配时返回提示信息。
| Name | Required | Description | Default |
|---|---|---|---|
| keyword | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full behavioral burden. It discloses the searchable fields, fuzzy matching, returned fields (number, name, teacher, time, location, credits), and the no-match fallback. It does not explicitly state that the operation is read-only, but the word 'search' and the list-return behavior strongly imply it.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is compact and front-loaded with the core purpose, followed by illustrative examples and a summary of the return value. Every sentence contributes useful information, and there is no redundant filler.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a one-parameter search tool, the description is largely complete: it covers the input semantics, expected output fields, and the no-match case. An output schema exists, so return-value details need not be repeated. It only omits minor constraints like exact matching rules or edge-case behavior, which is acceptable given the low complexity.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema provides only a required 'keyword' string with no description (0% coverage). The description fully compensates by explaining that the keyword can be a course name, course number, or teacher name and supports fuzzy matching. This gives the agent precise semantic understanding of the single parameter.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool searches courses by course name, course number, or teacher name with fuzzy matching. The examples ('张' finding all courses by a teacher, 'python' finding Python programming) make the behavior concrete and distinguish it from sibling tools like get_course or list_courses_by_weekday.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description gives strong context for when to use this tool: when the caller has a partial keyword for a course name, code, or teacher. It does not explicitly name alternatives or say when not to use it, but the sibling tool names and examples make the intended usage clear enough.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
5 tool updates
v0.1.0- First observed
get_course - First observed
get_teacher - First observed
list_assignments - First observed
list_courses_by_weekday - First observed
search_courses
TDQS
每个工具面向明确的资源与动作:课程搜索、课程详情、按天查课表、教师信息、作业列表。search_courses和list_courses_by_weekday虽然都返回课程列表,但一个按关键词模糊匹配,一个按星期筛选,描述足以消除歧义。
所有工具均采用动词_名词的清晰模式(search/get/list),命名风格统一,动词准确反映操作类型,没有混合大小写或混乱命名。
5个工具覆盖课程查询场景的核心需求,数量精炼,每个工具都有独立用途,没有冗余或明显缺失。
覆盖了课程搜索、详情、按星期课表、教师信息及作业列表,足以支撑常见查询场景。但缺少一个无筛选的“列出全部课程”工具,可能需依赖search_courses或list_courses_by_weekday迂回实现。
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Unofficial NTNU course data: search, timetables, grades, course info, and exam logistics.
Explore, query, and inspect SQLite databases with ease. List tables, preview results, and view det…
Query and audit AppSheet apps in natural language via Knotrik's pre-scanned definitions.
Ask data questions in natural language. Get SQL, insights, and charts from your databases.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables interaction with SQLite databases through natural language, supporting SQL queries, CSV imports, and schema exploration.10-
- AlicenseNot gradedqualityDmaintenanceEnables interaction with Canvas courses and assignments through natural language, allowing retrieval, search, and summarization of course and assignment information.15910MIT
- FlicenseNot gradedqualityCmaintenanceProvides intelligent access to a university course catalog with full-text search, prerequisite tracking, instructor lookups, and course comparison prompts.-
- FlicenseNot gradedqualityCmaintenanceProvides tools for querying student academic data such as subjects, marks, performance reports, timetable, exams, fees, events, holidays, and assignments via natural language.-
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/MEIQI-Lee/mcp-course'
If you have feedback or need assistance with the MCP directory API, please join our Discord server