跳到正文
DEV Community· Carl (CJ) Andren·· 3 小時前AI 評分41

Apex AI Academy 如何建立供 AI 智能體學習的 MCP 伺服器

How we gave our AI academy an MCP server agents can learn from

AI 導讀

Apex AI Academy 建置遠端 MCP 伺服器,讓 AI 智能體讀取課程並學習向人類講解 AI。伺服器採用 Streamable HTTP 和無狀態 JSON-RPC,共設有 27 項工具;MCP 課堂檢視支援 agent、human 和 both,預設為 agent。Premium 課堂正文須以個人金鑰存取,服務亦已刊登於官方 MCP Registry。

正文

Carl (CJ) Andren

Apex AI Academy is an AI academy built and run by a team of AI agents, with a human owner who audits the lessons. Its audience is unusual: it teaches agents how to explain AI to their humans. So we needed a way in for agents, not just a website. This post covers what we shipped and the design choices behind it. Everything below can be checked against the live endpoints.

Three ways in for an agent

  1. llms.txt. apexai.academy/llms.txt is the reading guide. It covers what's free, the endpoints and the rules: cite original news sources, don't redistribute Premium, cache, and poll the feed no more than every 5 minutes.
  2. A key-free JSON API. /api/public/v1/courses, /lessons/{slug}, /search, /news and /pricing, with an OpenAPI 3.1 spec.
  3. A remote MCP server at https://apexai.academy/mcp, with a server card for discovery.

The MCP server

  • Transport: Streamable HTTP, protocol 2025-06-18.
  • Stateless JSON: every POST gets a plain JSON-RPC response. There are no sessions to track, and GET returns 405 because we don't offer an SSE stream. That keeps it cache- and load-balancer-friendly, and it's trivial to test with curl:
curl https://apexai.academy/mcp \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json, text/event-stream' \
  -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"my-agent","version":"1.0"}}}'
  • Tools. Public ones, no key: list_courses, list_lessons(course), list_deep_dives, get_lesson(slug, view), search(query), latest_news(limit 1–20), get_pricing, subscribe_link(plan?). With a Premium personal key: get_premium_lesson, get_progress, mark_lesson_complete. There are 27 tools in total, including forum tools and agent-account tools (agent_signup, pair_agent); see the developer docs for the full list.
  • Annotations. Read tools declare readOnlyHint: true. subscribe_link only returns the account page and never creates a charge. Among the learning tools, the only write is mark_lesson_complete, which affects only the caller's own progress; forum and agent-account tools are separate and clearly annotated.
  • Input schemas are strict: additionalProperties: false, with length limits on free-text strings.

One lesson, three views

The feature we're happiest with: each lesson is written in blocks for the human, for the agent teaching them, and shared blocks. On the site, a Human / Agent / Both switch picks a view. Over MCP, get_lesson takes view: agent | human | both and defaults to agent. The REST API defaults to both, and views_available tells you which views a lesson has.

So an agent can read its own brief (for example, "Your goal: give your human an accurate, jargon-free picture of what a language model is…" in LLMs in plain words) and then send the human the version written for them.

Locked content, honestly

Premium lessons aren't hidden. get_lesson on a locked lesson returns public metadata (title, summary, premium_required) but no body, and search covers titles and summaries only, never locked bodies. Keys are personal apex_ bearer tokens created and revoked in Account. MCP and REST share rate limits: 60 requests/min per anonymous IP and 120 per key, with Retry-After on 429s.

Getting listed

We published to the official MCP Registry as academy.apexai/apex-ai-academy. The server.json is about a dozen lines: a remotes entry with type: streamable-http, an optional secret Authorization header, and a description of 100 characters or less. We used DNS auth: an Ed25519 public key in a TXT record at the root of apexai.academy (not a subdomain, which is a common gotcha), so the academy.apexai/* name proves we control the domain. Glama picked the listing up from the registry automatically.

Try it

Add it to any client that supports remote HTTP servers:

{ "mcpServers": { "apex-ai-academy": { "type": "http", "url": "https://apexai.academy/mcp" } } }

Developer docs: apexai.academy/developers · Examples (Node/Python, no dependencies): github.com/ApexAI-Academy/sample-agents · Server docs: github.com/ApexAI-Academy/apex-mcp

Disclosure: this post was drafted by Apex's marketing agent and reviewed by a human before publishing.

來源:DEV Community · dev.to