NTNU Courses (unofficial)

io.github.MartinSA04由 GitHub 帳號 MartinSA04 發布v0.4.0更新於 Oct 25, 2026

Unofficial NTNU course data: search, timetables, grades, course info, and exam logistics.

已驗證Streamable HTTP可網頁執行位置與生活資料與分析

概覽

AI 產生的概覽

非官方的 NTNU 課程資料遠端 MCP 伺服器:可搜尋課程與學程,查看課表、成績分布、課程資訊與考試安排。

可以做什麼
搜尋 NTNU 課程目錄與學程,依學程與入學年度取得官方修課計畫,並查詢 DBH 版本課程代碼與學期清單(含教學週與考試期間)。取得課程詳情:學分、層級、校區、先修要求、必修活動、學習成果與聯絡人。查看教學日程與每週重複課表,含星期、時間、ISO 週範圍與教室。查詢歷年各學期成績分布,以及考試日期、時長、允許輔助工具與考場等考試安排。並排比較課程,並檢查一組課程是否有上課時間衝突與考試日期衝突。
適用情境
適合規劃 NTNU 課業的學生與輔導人員:查找課程代碼、確認課程與考試的時間地點、比較課程、查看成績統計,或在選課前檢查課程組合是否衝突。
執行需求
遠端端點,無需安裝、帳號或 API 金鑰。將支援 MCP 的用戶端連線到該伺服器的 MCP 位址即可,需要網路存取。
安裝前請注意
唯讀且無需驗證,提供公開課程資料。它是非官方社群伺服器,與 NTNU 無隸屬關係,資料可能落後或與官方來源不同;註冊與考試相關決定應以 NTNU 官方系統為準。小樣本成績可能因隱私而遮蔽。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 NTNU Courses (unofficial),將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。

交給代理程式安裝

把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。

閱讀 https://sourceweft.com/mcp/io.github.MartinSA04%2Fntnu-mcp/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。

檢視代理程式所依據的安裝指南

其他 MCP 客戶端

把它新增到你客戶端的 mcpServers 設定中。

{
  "mcpServers": {
    "ntnu-courses-unofficial": {
      "type": "http",
      "url": "https://ntnu-mcp.martinsundal.no/mcp"
    }
  }
}

README

ntnu-mcp

A remote MCP server that exposes NTNU (Norwegian University of Science and Technology) course data to LLM assistants; course catalog search, teaching schedules, weekly timetables, grade statistics, course descriptions, exam logistics, and study programs with their official study plans, plus comparison tools for students choosing between courses. Runs as a Cloudflare Worker; no installation required on the client side.

Tools

Twelve tools, all read-only:

  • search_courses — free-text search of NTNU's course catalog for a given year; returns codes, names, campus, and exam dates.
  • get_course_schedule — every dated teaching activity (lectures, labs) for a course in a year, with Oslo-local times and rooms.
  • get_weekly_timetable — the recurring weekly timetable grid for a course: weekday, times, ISO-week ranges, and rooms.
  • get_grade_distribution — historical grade distribution for a course, per year and semester, with counts and percentages.
  • get_course_versions — the DBH-versioned course codes (e.g. TDT4100-1) behind a bare course code, useful when grade lookups come back empty.
  • get_semesters — NTNU's terms with ids like 26h/26v, teaching weeks, exam-period dates, and which term is current.
  • get_course_info — everything about a course except exam logistics: credits, level, campus, prerequisites, mandatory activities, content/learning outcomes, credit reductions, the study programs the teaching is planned for, contacts, and alert notices. English by default, language: "nb" for Norwegian.
  • get_exam_info — exam logistics for up to 10 courses in one call: every occasion (ordinary/re-sit) with date, start time, duration, permitted-aids code ("hjelpemiddelkode") with its meaning, exam system, and assigned rooms.
  • search_study_programs — search NTNU's ~400 study programs by text, level, and city; returns program codes for get_study_plan.
  • get_study_plan — the official plan for a program and cohort intake year: courses (codes, credits, mandatory/elective) per semester, with specialization choice points — the bridge from "I study X" to concrete course codes.
  • compare_courses — side-by-side comparison of several courses: name, campus, exam dates, weekly teaching hours, and latest grade distribution.
  • check_timetable_conflicts — pairwise check for weekly-schedule clashes and exam-date collisions across a set of courses, before registering for them.

Connecting

Paste the server's MCP URL into Claude's or ChatGPT's custom connector settings:

https://ntnu-mcp.martinsundal.no/mcp

The server requires no authentication, since it only serves public, read-only NTNU course data.

The server is also listed in the official MCP registry as io.github.MartinSA04/ntnu-mcp (see server.json); clients that browse the registry can discover it there. It is an unofficial community server, not affiliated with NTNU. Registry updates are tag-driven: npm version <patch|minor|major> && git push --follow-tags — the version script keeps server.json in sync, and the release workflow runs the check suite, deploys the Worker, re-publishes the registry entry (GitHub OIDC), and creates the GitHub Release.

Architecture

All NTNU upstream knowledge — endpoints, retry policy, parsing of the Liferay catalog, DBH grade statistics, and TP semester data — lives in the ntnu-api TypeScript client library, which this repo depends on as an npm package. Upstream fixes and new data sources land in ntnu-api, not here. This repo's only job is to call that typed client and shape its output for LLM consumption: English names with Norwegian fallback, Oslo-local timestamps, grade rows collapsed into per-term distribution tables, and guidance notes on empty results. This layering is set out in ntnu-api's TypeScript migration spec.

To keep load on NTNU's servers minimal, every upstream call is cached in two tiers (per-isolate memory in front of a shared Workers KV namespace), so each resource is fetched roughly once per TTL globally: catalog searches, timetables, and schedules for 1 hour; grade statistics and the semester list for 24 hours. KV failures degrade to memory-only caching, never to tool errors. In tests the cache runs memory-only.

Local development

Requires Node 22 (pinned via mise).

sh
mise install     # installs the pinned Node versionnpm install

Common tasks, available both as mise tasks and npm scripts:

sh
mise run dev          # npm run dev       — wrangler dev, local worker with hot reloadmise run test          # npm test          — vitest, over captured fixtures (no live network)mise run typecheck     # npm run typecheck — tsc --noEmitmise run lint          # npm run lint      — biome checkmise run fmt           # npm run fmt       — biome check --writemise run check         # lint + typecheck + test

Tests run under plain Node (not the Workers pool) with vitest, driving the tool functions directly against fetch fixtures captured verbatim from ntnu-api's test suite — no calls to real NTNU services are made in CI or locally.

Deploy

Pushes to main deploy automatically (the repo is connected to Cloudflare Workers Builds). For a manual deploy from a checkout:

sh
npm run deploy   # wrangler deploy

Runs on Cloudflare's free plan: the MCP session state is backed by a Durable Object using SQLite storage, which is available on the free tier (no Workers Paid subscription required unless per-request CPU limits are hit at scale).

License

MIT — see LICENSE.

來源:README.md,提交 62ccc4c

工具

12

search_courses

Search NTNU's course catalog for a given year (server-side free-text search over course names and codes; Norwegian terms often match best, e.g. 'maskinlæring' rather than 'machine learning'). Call this first when you don't know the exact course code. Returns course codes, Norwegian names, campus, and exam dates.

輸入參數pageyear必填query

get_course_schedule

Every dated teaching activity (lectures, labs) for a course in a year, with Oslo-local times and rooms. Long output for large courses — prefer get_weekly_timetable for a compact recurring-week overview.

輸入參數year必填course_code必填

get_weekly_timetable

The recurring weekly timetable grid for a course in a year: weekday, times, ISO-week ranges, rooms, and a classified 'kind' per slot (lecture / exercise / lab / seminar / unknown). The compact way to answer 'when are the lectures for X' — filter on kind == 'lecture', since NTNU's own activity titles are free-form Norwegian text.

輸入參數year必填course_code必填

get_grade_distribution

Historical grade distribution for an NTNU course (per year and semester, with counts and percentages; grades A-F, or pass/fail codes). Accepts bare codes like 'TDT4100'. Omit years to get all recorded years. Small counts may be privacy-masked. Data comes from Norway's official DBH statistics.

輸入參數yearscourse_code必填

get_course_versions

The DBH-versioned course codes (like 'TDT4100-1') that exist for a bare NTNU course code. Useful when grade lookups come back empty.

輸入參數course_code必填

get_semesters

NTNU's terms (semesters) with ids like '26h' (autumn 2026) / '26v' (spring), teaching weeks, exam-period dates, and which term is current.

無需輸入參數。

get_course_info

Everything about an NTNU course except exam logistics: credits, level, campus, language of instruction, prerequisites, mandatory activities, course content / learning outcomes, credit reductions ('studiepoengreduksjon'), which study programs the teaching is planned for, contacts, and any alert notices (e.g. 'no longer taught'). English text by default; pass language 'nb' for Norwegian. Omit year for the current study year. For exam dates, times, aid codes, and rooms use get_exam_info.

輸入參數yearlanguagecourse_code必填

get_exam_info

Exam logistics for one or more NTNU courses in a single call: every exam occasion (ordinary / re-sit) with date, start time, duration, permitted-aids code ('hjelpemiddelkode') with its meaning, exam system, and assigned rooms. The way to answer 'when and where are my exams and what can I bring' for a whole semester at once. Rooms are only published days before the exam; unpublished fields are null. Omit year for the current study year.

輸入參數yearlanguagecourse_codes必填

search_study_programs

Search NTNU's study-program catalog (~400 programs) by free text (name, code, keywords), study level (e.g. 'bachelor', 'master', 'ph.d'), and/or city (Trondheim, Gjøvik, Ålesund). Returns program codes like 'MTDT' — the input for get_study_plan. Call this first when you only know a program's name.

輸入參數citylevelquery

get_study_plan

The official study plan for an NTNU program and cohort intake year: which courses (codes, credits, mandatory/elective) belong to each semester, and the specialization choice points with their course groups. The bridge from 'I study X' to concrete course codes — feed them to get_weekly_timetable, check_timetable_conflicts, or get_exam_info. cohort_year is the year the student STARTED (defaults to the current cohort); students in their Nth year started N-1 years ago.

輸入參數cohort_yearprogram_code必填

compare_courses

Side-by-side comparison of NTNU courses for a given year — campus, exam dates, weekly teaching hours, and latest grade distribution — to help choose between courses. Accepts bare course codes.

輸入參數year必填course_codes必填

check_timetable_conflicts

Checks a set of NTNU courses for the same year for clashing lecture/lab times and colliding exam dates — a clash check to run before registering for courses. Accepts bare course codes. Each side of a conflict carries its activity 'kind': a lecture-vs-lecture clash is unavoidable, while one involving an exercise or lab often has alternative groups. Exam dates come from the catalog, which does not mark deferred (utsatt/kont) sittings.

輸入參數year必填course_codes必填

版本歷史

1
  1. v0.4.0最新Sep 16, 2026

評分

已滿足適用檢查項的 100%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通必需25 分
  • 已宣告認證方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分