Magicao
Developer documentation

Bring Magicao learning tools into your app or AI assistant.

Use the Partner REST API to connect your own software, or use the Model Context Protocol (MCP) server to let authorised AI assistants discover Magicao's curriculum and practice tools.

Published curriculum onlyAdult consent requiredRead and practice tools
Integration availability: The REST API and MCP server are implemented in the Magicao source but need an enabled deployment, approved OAuth client and staging checks before external use. The hostnames below are placeholders, not live endpoints. Client registration is operator-approved, not open self-service.

Choose how to connect

Both paths use the same published content, authorised learners and Magicao answer checking.

1 Partner REST API

For school platforms, mobile apps, websites and developers writing their own integration.

HTTPS + JSON · OAuth 2.0 · /api/partner/v1/

View REST examples

2 MCP server

For ChatGPT connectors, supported LLM clients and AI agents that discover callable tools.

Streamable HTTP · OAuth + PKCE · /mcp

View MCP setup

Before you start

  1. 1
    Ask Magicao to approve your integration.

    Contact Magicao with your organisation, intended use, requested permission scopes and an exact HTTPS OAuth redirect URL. Registration and approval are handled by an authorised operator.

  2. 2
    Set up OAuth in your backend.

    Use a pre-approved client ID, authorisation code with PKCE S256 and a signed-in parent or teacher's explicit consent to access learners. Confidential-client secrets must stay on your server.

  3. 3
    Check the deployment and endpoints.

    Ask for your approved API origin (and MCP origin, if needed). Do not assume the example addresses below are running. Use staging first, with a test adult account and non-sensitive example data.

  4. 4
    Discover published data, then start practice.

    Use catalogue-provided IDs; never guess grades, topics or learner IDs. Practice writes and answers require the right scopes, current learner access and consent.

REST API quick start

These are example requests for an approved, deployed integration, not a public demo API.

1. Set your API host and check capabilities

Capabilities are public when the partner API is enabled; learner and catalogue requests need a valid token.

Shell · replace placeholder host
API_BASE="https://YOUR-API-HOST"
curl --fail-with-body "$API_BASE/api/partner/v1/capabilities"

2. Authorise the adult user

Use GET /oauth/authorize with response_type=code, your registered client_id, exact redirect_uri, approved scope, random state and a PKCE S256 challenge. After adult approval, your server exchanges the one-time code at POST /oauth/token. Do not paste tokens or client secrets into a chat or browser page.

Discovery (when MCP OAuth is enabled): GET /.well-known/oauth-authorization-server at the API issuer. Use the actual issuer returned in the metadata, not the example domain.

3. Read published curricula, levels and topics

Shell · delegated access token
# Your backend has securely obtained MAGICAO_ACCESS_TOKEN.
curl --fail-with-body \
  -H "Authorization: Bearer $MAGICAO_ACCESS_TOKEN" \
  "$API_BASE/api/partner/v1/curricula?country_code=GB"

curl --fail-with-body \
  -H "Authorization: Bearer $MAGICAO_ACCESS_TOKEN" \
  "$API_BASE/api/partner/v1/curricula/england_national/levels"

curl --fail-with-body \
  -H "Authorization: Bearer $MAGICAO_ACCESS_TOKEN" \
  "$API_BASE/api/partner/v1/curricula/england_national/topics?level_id=year-3&subject=Maths"

4. Create a practice session

Obtain learner_id from GET /learners and topic_id from the topics endpoint. The learner's curriculum and level must match their saved profile.

Shell · returns HTTP 202 with operation_id
curl --fail-with-body -X POST \
  "$API_BASE/api/partner/v1/practice-sessions" \
  -H "Authorization: Bearer $MAGICAO_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(python -c 'import uuid; print(uuid.uuid4())')" \
  -d '{
    "learner_id":"lrn_FROM_LEARNERS",
    "curriculum_id":"england_national",
    "level_id":"year-3",
    "subject":"Maths",
    "topic_id":"top_FROM_TOPICS",
    "question_count":5,
    "mode":"tutor"
  }'

A completed response includes the operation_id, session_id and public questions. Call GET /operations/{operation_id} only while status is pending; that call finishes the worksheet and includes the questions. Follow retry_after_seconds only when it is still running. Use GET /practice-sessions/{session_id} when you already have a session id. A repeated write should reuse its original UUID idempotency key.

5. Submit an answer

After an adult approves the submission, send a new UUID idempotency key and the returned session/question IDs. The first recorded answer is final; partner attempts earn no XP or gift points.

Shell · answer example
curl --fail-with-body -X POST \
  "$API_BASE/api/partner/v1/practice-sessions/SESSION_ID/answers" \
  -H "Authorization: Bearer $MAGICAO_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(python -c 'import uuid; print(uuid.uuid4())')" \
  -d '{"question_id":"QUESTION_ID","answer":"24"}'

Partner REST endpoints

Routes below are relative to /api/partner/v1. OAuth routes live at the API issuer root.

Method and pathWhat it doesPermission
GET /capabilitiesDiscover API limits and featuresPublic when enabled
GET /curriculaList published curriculacatalogue:read
GET /curricula/{id}/levelsList published years or gradescatalogue:read
GET /curricula/{id}/topicsFind topics using level_id and optional subjectcatalogue:read
GET /learnersList learner pseudonyms authorised for this partnerlearners:read
POST /practice-sessionsCreate practice and return questions when readypractice:write
GET /operations/{id}Finish a pending operation and return questions when readypractice:read
GET /practice-sessions/{id}Read questions without hidden answer keyspractice:read
POST /practice-sessions/{id}/answersCheck one answer and save the first attemptpractice:write
GET /learners/{id}/progressRead aggregate progressprogress:read

Connect an AI assistant with MCP

The MCP server is a separate service, backed by the same Partner REST API.

For ChatGPT and other compatible clients

  1. Ask Magicao to approve an OAuth public client, with the exact HTTPS callback URL supplied by your MCP client.
  2. In the client's custom MCP / plugin connection settings (where available), enter the deployed MCP URL, not the REST API URL.
  3. Sign in using a Magicao adult account, review scopes and approve only the necessary permissions.
  4. Ask the assistant to list curricula or choose an authorised learner, then request practice. Review any writes before submission.

A Magicao MCP connector is not automatically installed or publicly listed; available client setup options depend on the host.

MCP connection details

Transport: Streamable HTTP
MCP endpoint: https://YOUR-MCP-HOST/mcp
OAuth issuer: https://YOUR-API-HOST
Auth: OAuth authorisation code + PKCE S256, approved client and exact resource audience.

Example MCP server configuration
{
  "mcpServers": {
    "magicao": {
      "type": "streamable-http",
      "url": "https://YOUR-MCP-HOST/mcp"
    }
  }
}

Client configuration formats vary; some clients ask for only a URL. Protected resource metadata is served at /.well-known/oauth-protected-resource/mcp on the MCP host.

Available MCP tools

MCP tool namePurpose
magicao_list_curriculaFind published curricula
magicao_list_levelsFind available years or grades
magicao_list_topicsFind published topics
magicao_list_learnersList authorised learner IDs
magicao_create_practicePrepare practice and return questions when ready
magicao_get_operationFinish pending practice and return questions when ready
magicao_get_practiceRetrieve practice questions
magicao_submit_answerCheck an approved answer
magicao_get_progressRead aggregate progress
Try saying:

“Use Magicao to find published Year 3 Maths topics.”
“Create five multiplication questions for my authorised learner.”
“Summarise the selected learner's Magicao progress.”

The assistant can only act after a successful connection with sufficient scopes. MCP results are not an invitation to override security checks or adult approval.

Privacy, consent and limits

Privacy by design

  • Parents and teachers authorise learner access; direct child ChatGPT accounts are not supported.
  • Partners receive pseudonymous learner IDs, not names, birth dates, login codes or raw answers.
  • Every protected request checks scopes and current access. Consent can be revoked.
  • No hidden question answer keys or private marking rubrics are returned.

Operational rules

  • 60 REST requests per minute and up to 5 new practice operations per minute per approved client.
  • 1–20 questions per practice session; submitted answers do not award XP or gift points.
  • New practice and answer writes need a UUID Idempotency-Key; do not send writes repeatedly without checking the operation.
  • Handle 401, 403, 409, 422, 429 and 503 as documented by the API.

Keep OAuth access tokens and client secrets on your server. Do not put them in browser code, logs or LLM prompts. Follow UK/EU privacy requirements and your safeguarding agreements for children's data.

Frequently asked questions

Can I use the API without approval?

No. Partners need explicit operator approval. Catalogue access requires an authorised token; learner data also requires consent from the eligible adult.

Is the API or MCP server live on magicao.com?

This page documents the source implementation. Public API/MCP hostnames are only available after deployment and configuration. Ask Magicao for a confirmed staging or production URL.

Does Magicao generate new questions using the LLM?

These integrations use existing published and verified question sets. They do not call a paid generative model just to list topics or build partner practice sessions.

Can a ChatGPT user connect directly?

Only through a supported custom MCP/plugin connection flow after client approval and Magicao adult account linking. No child sign-in or public Magicao ChatGPT listing is implied.

What if the requested country or topic is missing?

Only reviewed, published topics appear. An available country or school year does not guarantee that all its curriculum topics are published.

Where can I request access or ask a question?

Use the Magicao contact page and describe your platform, redirect URI, expected use and required scopes. Never send client secrets or access tokens in a support message.