metu-sais-mcp
METU SAIS API & MCP Server
Middle East Technical University (METU / ODTÜ) Student Affairs Information System (SAIS / student.metu.edu.tr) 向けの、モダンな Model Context Protocol (MCP) サーバーおよび FastAPI サービスです。
実際の認証と構造化データ解析により、AI アシスタント(OpenCode、Claude Desktop、Cursor など)を METU SAIS に直接接続します。
機能
SSO 認証: 実際の METU SSO ログインフロー(
/sso/backend/request/user/signin)とセッショントークンの検証を処理します。プロキシスクレイパー & HTML パーサー: 認証済みプロキシセッション(
/proxy/Student_Information/)を自動的に確立し、学生レコードを構造化 JSON にパースします。MCP サーバー(MCP 2.x SDK): 標準入出力(stdio)で型付きツールを公開します。
FastAPI REST サービス: 統合のための代替 HTTP REST バックエンド。
プライバシーとセキュリティ: 認証情報のログ記録や漏えいは一切ありません。認証情報は git 管理外の
.envファイル内にローカルのみ保持されます。
Related MCP server: SABIS MCP Server
利用可能な MCP ツール
ツール | 説明 |
| 学生ID、氏名、学部・学科、学期、GPA/CGPA、在籍状況、指導教員を取得します。 |
| 週間の授業スケジュール(曜日、時間、授業コード、授業名、教室、担当教員)を取得します。 |
| 全学期にわたる成績証明書(科目、単位、成績、学期ごとのGPA統計)を取得します。 |
| 現在有効なポータルのお知らせを取得します。 |
| インメモリの接続レコードを作成します。 |
| 保存済みの接続レコードをすべて一覧表示します。 |
インストールとセットアップ
1. 前提条件
Python >= 3.11
uv (推奨) または
pip
2. 依存関係のインストール
# Using uv (recommended)
uv sync
# Or using pip
pip install -e .3. 認証情報の設定
.env.example を .env にコピーし、METU の認証情報を入力してください:
cp .env.example .env.env を編集してください:
SAIS_USERNAME=your_metu_username
SAIS_PASSWORD=your_metu_password
LOCALE=tr
PORT=8300[!NOTE]
.envは.gitignoreに含まれており、コミットされることはありません。
OpenCode での使用
このリポジトリには、opencode.json がすでに含まれています。
プロジェクトレベルでの使用
このリポジトリ内で OpenCode を起動すると:
opencodeOpenCode は自動的に metu-sais MCP サーバーに接続します。
グローバル使用(任意のディレクトリ)
OpenCode のすべてのプロジェクトで METU SAIS ツールを使用するには、サーバーを ~/.config/opencode/opencode.jsonc に追加してください:
{
"mcp": {
"metu-sais": {
"type": "local",
"command": [
"uv",
"--directory",
"/absolute/path/to/metu-sais-mcp",
"run",
"metu-sais-mcp"
],
"enabled": true
}
}
}接続の確認
opencode mcp list次のように表示されます:
● ✓ metu-sais connectedMCP サーバーの単独実行
MCP サーバーは標準入出力で直接実行できます:
uv run metu-sais-mcpREST API の実行
FastAPI サーバーを起動するには:
uv run uvicorn api.main:app --port 8300 --reloadインタラクティブな API ドキュメントは以下で利用できます:
Swagger UI: http://localhost:8300/docs
ヘルスチェック: http://localhost:8300/healthz
REST エンドポイント
GET /api/sais/info— 学生情報GET /api/sais/schedule— 授業スケジュールGET /api/sais/transcript— 成績証明書履歴GET /api/sais/announcements— ポータルのお知らせGET|POST|PUT|DELETE /api/connections— 接続管理 CRUD
テスト
pytest で自動テストスイートを実行します:
uv run pytest -vテストスイートには以下が含まれます:
HTML パーサー(
parse_student_info、parse_schedule、parse_transcript、parse_announcements)の単体テスト。MCP ツール登録とツール呼び出しのテスト。
FastAPI REST エンドポイントのテスト。
認証情報が設定されている場合、METU SAIS に対するライブ統合テスト。
プロジェクト構造
├── sais/
│ ├── connector.py # Core SAIS authentication, proxy scraping, and HTML parsers
│ └── connections.py # Shared in-memory connection store
├── sais_mcp/
│ └── server.py # MCP stdio server definition and tool registrations
├── api/
│ └── main.py # FastAPI REST API wrapper
├── tests/
│ ├── test_connector.py # Scraper and HTML parser tests
│ ├── test_mcp_server.py# MCP server tests
│ └── test_api.py # FastAPI tests
├── .env.example # Environment variable template
├── opencode.json # OpenCode MCP configuration
├── pyproject.toml # Package dependencies and CLI entrypoints
└── README.md # Project documentationライセンス
MIT License.
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 Servers
- FlicenseBqualityDmaintenanceAn MCP server that enables AI agents to authenticate with and interact with Open eClass platform instances, supporting UoA's SSO authentication system for retrieving course information and performing basic platform operations.48
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to securely retrieve academic grades and course information from Sakarya University's SABIS student information system through automated web scraping.2ISC
- FlicenseNot gradedqualityDmaintenanceConnects AI assistants to the FAST-NUCES Flex Student Portal, enabling students to query their academic data including attendance, marks, transcript, and fee reports through natural language conversations.5
- FlicenseNot gradedqualityDmaintenanceEnables students to securely access and manage their academic data from Isparta University's OBS system, including grades, transcripts, announcements, and course information through natural language queries.1
Related MCP Connectors
Self-hosted MCP gateway: turn any API, database or MCP server into AI connectors — no code.
Connect e-commerce and marketing data to AI assistants via MCP.
Your memory, everywhere AI goes. Build knowledge once, access it via MCP anywhere.
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/atesahmet0/metu-sais-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server