Horizon
An MCP server that connects AI assistants to university D2L Brightspace and Piazza, enabling query of courses, grades, assignments, deadlines, files, and Piazza posts.
README
Horizon
An MCP server that connects AI assistants to your university's D2L Brightspace and Piazza. Sign up once at horizon.hamzaammar.ca/onboard, then use Claude, ChatGPT, or any MCP-compatible client to query your courses, grades, assignments, deadlines, files, and Piazza posts — all from your AI assistant.
Horizon is a tool for organizing and accessing your own academic data. Use in accordance with your institution's academic integrity policies.
Hosted version
The easiest way to use Horizon is the hosted instance at https://horizon.hamzaammar.ca/onboard:
- Go to https://horizon.hamzaammar.ca/onboard and create an account
- Connect your D2L account via the browser login flow (Duo MFA supported)
- Optionally connect Piazza
- Copy your API key and MCP server URL from the dashboard
- Add Horizon to your AI client (see below)
No infrastructure required.
Connecting to your AI client
Claude Desktop
- Open Claude Desktop → Settings (gear icon) → Developer → Edit Config
- Paste the following and save, then restart Claude Desktop:
{
"mcpServers": {
"horizon": {
"command": "npx",
"args": [
"mcp-remote",
"https://horizon.hamzaammar.ca/mcp",
"--header",
"x-api-key: YOUR_API_KEY"
]
}
}
}
Claude Code (CLI)
claude mcp add horizon -- npx mcp-remote https://horizon.hamzaammar.ca/mcp --header "x-api-key: YOUR_API_KEY"
ChatGPT (Plus/Pro desktop app)
ChatGPT's desktop app supports MCP servers natively:
- Open ChatGPT desktop → Settings → Connected Tools (or MCP Servers)
- Add a new MCP server with:
- URL:
https://horizon.hamzaammar.ca/mcp - Header:
x-api-key: YOUR_API_KEY
- URL:
- Save — Horizon tools will appear in your next conversation
Alternatively, add it via the config file at ~/Library/Application Support/com.openai.chat/mcp_config.json (Mac):
{
"mcpServers": {
"horizon": {
"command": "npx",
"args": [
"mcp-remote",
"https://horizon.hamzaammar.ca/mcp",
"--header",
"x-api-key: YOUR_API_KEY"
]
}
}
}
Poke by Interaction
- Open Poke → Settings → MCP Servers → Add
- Set the URL to
https://horizon.hamzaammar.ca/mcp - Add request header:
x-api-key: YOUR_API_KEY - Save — tools appear automatically
Replace YOUR_API_KEY with the key shown on your Horizon dashboard.
What it does
Horizon exposes your academic data as MCP tools across four categories:
D2L / Brightspace
get_my_courses— list all enrolled coursesget_my_grades— check grades for any courseget_assignments/get_assignment/get_assignment_submissions— assignments, due dates, submission statusget_upcoming_due_dates— deadlines within a configurable time windowget_course_content/get_course_modules/get_course_module/get_course_topic— full syllabus and lecture materialsget_announcements— instructor posts and updatesdownload_file/read_file/delete_file— download and extract text from course PDFs and files
Piazza
piazza_get_classes/piazza_get_posts/piazza_get_post— browse class discussionspiazza_search/piazza_semantic_search— search posts by keyword or meaningpiazza_sync/piazza_embed_missing— sync and embed recent postspiazza_suggest_for_item— find relevant posts for a given assignment
Notes (uploaded PDFs)
notes_search/semantic_search_notes— search your uploaded notes by keyword or semanticallynotes_sync/notes_embed_missing— process and embed uploaded PDFsnotes_suggest_for_item— find relevant notes for a given assignment
Study & Tasks
tasks_list/tasks_add/tasks_complete— personal task trackingplan_week— AI-generated weekly study plan based on upcoming deadlinessync_all— sync all assignments from every enrolled course at once
Architecture
MCP Client (Claude, ChatGPT, Poke, etc.)
|
| HTTPS + Streamable HTTP
v
Go Gateway (JWT/API key auth, rate limiting, Prometheus metrics)
|
| HTTP proxy (X-User-Id header)
v
Node.js MCP Server (tools, D2L API, Piazza API)
|
+---> Supabase (users, tasks, notes, pgvector embeddings)
+---> D2L Brightspace (session cookies via VNC browser login)
+---> Piazza (SSO cookies)
+---> S3 (browser state persistence for headless token refresh)
+---> OpenAI (embeddings for semantic search)
Session management: D2L sessions are refreshed automatically every 18 hours using saved ADFS browser state from S3. If the ADFS session expires (~30–90 days), Horizon falls back to stored username/password credentials for headless re-login. If Duo MFA is required, the user gets a push notification to re-authenticate via the dashboard.
Structure
d2l-mcp/
gateway/ Go reverse proxy — JWT/API key auth, rate limiting, Prometheus
src/
api/ REST routes (onboarding, file upload, push notifications)
browser/ Playwright + VNC sessions for D2L login with Duo MFA
jobs/ Background session refresh scheduler
tools/ MCP tool implementations (D2L, files, content)
study/ Study tools (notes, tasks, Piazza sync, semantic search)
public/ Onboarding page (horizon.hamzaammar.ca)
scripts/ Deployment scripts (ECS, migrations)
study-mcp-app/ React Native companion app (Expo) — push notifications
supabase/ Database migrations
Self-hosting
Prerequisites
- Node.js 20+, Go 1.22+, Docker
- Supabase project (free tier works)
- AWS account (ECS Fargate, S3, ECR, Secrets Manager)
- OpenAI API key (for semantic search embeddings)
- A D2L Brightspace instance you have student access to
1. Clone and configure
git clone https://github.com/hamzaammar/horizon.git
cd horizon/d2l-mcp
cp .env.template .env
# Fill in SUPABASE_URL, SUPABASE_SERVICE_ROLE_KEY, OPENAI_API_KEY, S3_BUCKET, etc.
2. Run database migrations
Run each SQL file in src/study/db/migrations/ in order via your Supabase SQL editor.
3. Local development
npm install
npm run build
SKIP_JWT_AUTH=1 MCP_USER_ID=dev npm start
# Server at http://localhost:3000/mcp
4. Deploy to AWS ECS
cp task-definition.example.json task-definition.json
# Replace all <PLACEHOLDER> values with your AWS account details and secret ARNs
bash scripts/deploy-to-ecs.sh
See task-definition.example.json for the full ECS Fargate two-container configuration (gateway + backend).
5. Connect your MCP client
Point any MCP client at your deployed server:
| Setting | Value |
|---|---|
| URL | https://your-domain.com/mcp |
| Header | x-api-key: <key from dashboard> |
Authentication
Three methods are supported at the gateway level:
- API keys (
hzn_...) — never expire, best for MCP clients; generated from the dashboard - Supabase JWTs — short-lived access tokens (1 hour), auto-refreshed by the gateway
- Refresh tokens — single-use tokens exchanged for new JWT pairs at
/auth/refresh
All auth is handled by the Go gateway before requests reach the Node.js server. The user's ID is forwarded as X-User-Id and scopes all database queries.
License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。