Feature · Engineering · AI · Product
Connect Your Own AI App to Cereby: A Quiz for One Coin, Not Seven
A second door into Cereby, for the AI app a student already uses, and what it took to make that door safe to leave open.
A student is revising for a Thursday exam. Their notes are in Cereby. The AI assistant they talk to all day is somewhere else. They ask it to quiz them on the lecture, and it cannot: it has never seen the notes. So they paste the note in, take the quiz there, and Cereby never learns they got question four wrong. (The student is made up. The gap is not.)
We cannot count how often that happens: a paste into another app leaves no trace in ours. What we can count is the price of the alternative. A ten-question quiz from Cereby's own chat costs seven coins on the default model, because our model reads the note and writes the questions. If the student's own AI did both, all that is left for Cereby is to check the quiz and save it.
This post is about the student MCP server that makes that possible. MCP, the Model Context Protocol, is a standard way to hand an AI app a set of tools: each has a name, a description and a list of arguments, and the app decides when to call one. A student turns it on in Settings (Integrations, then AI apps), pastes one address into their AI app, signs in, and allows the app. From then on it can read their notes, save a quiz, record how they did on it, sync their Canvas assignments and plan their week. It is part of every paid plan. We already had an MCP server, for the founder: Giving Our AI Agent Read-Only Access to Production, Behind Four Locks.
One caution about scale. The server opened to students the day this post went up, and as we write one account has connected an app: ours. Every number below is a price, a count of what was built, or a check we ran. None is usage.
Not an admin
The address we already had could not simply be shared. It gives its caller the founder's job: tickets, production logs, one user's plan and coins. A student who signed in there got one sentence back, in red in the diagram:
In fairness to the old door, nobody was knocking: in the 46 hours of logs we keep, it refused no student at all. We built the second door for the paste, not for a queue.
The shortcut was one server with its tool list filtered by who is calling. A filter is one mistake away from handing a student an admin tool, so the student server is a separate address with a separate list, and a test fails if a student file so much as imports an admin one. There is no filter to get wrong.
Two doors
The student door asks four questions on every call, then looks at what kind of tool is being called:
A refusal is a sentence, not an error code. An account with no plan still connects, and each call says that this is part of every paid plan and where to get one. An AI app shows a bare 403 as "connection failed", which tells the student nothing.
The second question is there because a sign-in token from our provider is not tied to one address. So the feature has a switch in Settings, off by default: a token granted somewhere else does nothing until the student has asked for this.
Behind the door are 47 tools: 17 read, 4 save something new, 11 edit, 2 pull something in from outside (a Canvas sync, a web link), 5 run work only Cereby can do, 2 make or revoke share links and 6 delete. The last eight run only when the student has chosen full access: a delete cannot be undone, and a share link is public. Our own instructions for a connecting AI app grew past their budget one slice at a time; we rewrote them shorter rather than raise the cap.
The student's door is a switch in Settings:
AI apps in Settings, on synthetic connections. The line that names apps by brand is left out of the picture.
What the seven coins were made of
In our chat, a quiz is our model's work from end to end. Over MCP, the student's AI reads the note (a free call) and writes the questions. Cereby runs each one through the validator its own generator has to pass, saves what passes, and hands back what it rejected with the reason:
The rule is short. Reading is free. Saving something new the student's AI wrote is one coin. What is free in the app is free here, and nothing costs more over MCP than in the app. The four things our chat charges to generate, priced by the chat's own function on the default model (gray), against saving the same thing over MCP (green):
On a stronger model the gap is wider: the same quiz runs from 4 to 105 coins across the eleven models the chat offers. Over MCP it is one, because whichever model wrote it was not ours.
A quiz taken in the AI app still counts. The app reads the quiz without its answer key, asks the questions, and sends back what the student picked. Cereby grades that against the key it stored, never the AI's own marking, and the attempt lands in the student's performance like any other.
The price, asked first
Some work the student's AI cannot do: voice a podcast, render a short video, draw an image. Those run on our side, with the chat's own code, at the chat's own price. That price is not one coin, and an AI app acts on what it reads. One stray line in a note should not be able to spend a video's worth of coins.
That is the chat's path, not the app's dedicated routes for making an image, a podcast and a video, which we nearly wrapped. Nothing in the app calls them (the chat makes all three through its own tool runner), and none gives coins back when a run fails. The tools use the chat's path, which charges first and refunds once.
So a tool that costs real coins does not run the first time it is called. It answers with the price, and makes the thing only when the call comes again with that price in it:
Step 3 is what the server answered when we ran it: 12 coins and about 40 seconds for a five-minute, two-speaker episode. Twenty minutes with three speakers quoted 62, an image 2 to 15, a video 45 to 101. The quotes are real; we have not yet made a podcast through this door in production.
The consent screen is not the gate
For "paste one address and sign in" to work with any AI app, our sign-in provider has to let apps register themselves. Its own warning about that setting is blunt: anyone can register an app under a legitimate-sounding name and send your users to approve it.
We traced what such an app's token could reach. Our ordinary routes take session cookies, so nothing there. That left the two MCP doors, and both were wider open than we had thought. The student door admitted any app a student had approved on the consent screen. The admin door asked only whether the token was an admin's: one careless tap from the founder would have handed a stranger's app every admin tool.
Both now treat the consent screen as an app asking, not as a yes:
On the student side, a new app's first call lists it in Settings as waiting and is refused, and so is every call after, until the student presses Allow beside its name, in Cereby, behind their own session. On the admin side the list has one entry, chosen from evidence: of the 300 most recent sign-ins to the admin server, 223 came by this route, all from one app and one account. The cost is one more tap when a student connects an app. A door that can delete notes is worth a tap.
It held the first time it was used. On our own first connection the app's first three calls came back refused. After one tap in Settings, the next four ran, each in under a second.
Everything the app can do, counted
"Everything the app can do" is easy to promise and easy to let rot, so it is a list a test reads. Cereby's chat can be asked for 38 kinds of thing, and each is placed as offered or left out with a reason:
Two of the seven are the chat itself (answer a question, explain a concept): the student's AI is the chat. Five belong to features the app no longer offers. The same list covers the 97 groups of routes behind the app: 31 offered in whole or in part, 39 left out with a reason (MCP has no upload; buying coins is a browser flow; deleting the account is never offered to an AI app), 26 that are not a student's to do, and one still owed.
The one owed is "listen to this note". Its audio is spoken from sentences the browser builds by walking the open editor, and stored against a fingerprint of them. A server cannot build those yet, and audio from any other split would not match the highlight that follows the voice. We left it out rather than ship one that drifts.
A new route or chat action fails the test until someone places it, and the count owed can only go down.
Placing them meant reading them. Every tool calls the function the app's own route calls; where that logic lived inside a route, we moved it out and had the route call it too. Reading that many routes closely turned up things that had nothing to do with MCP. Seven handlers for a student's files tested whether the sign-in lookup returned anything. It always returns an object, so a signed-out request fell through to the database. It was harmless by luck: the insert failed on a missing user (a 500 where a 401 belonged) and the delete matched nothing. They test the user now.
The reading also decided two of the places. A calendar connected through the phone is read on the phone, so a server "sync" would have reported success having fetched nothing; the tool says when the phone last sent its events instead. Note tags are stored under a kind of note id the library stopped using, so we left tags out.
A link tool that would have read our own network
"Add a web link" fetched whatever address it was given, following redirects, from inside our network, and returned the answer as page text. An AI app repeats what it reads, so this had to close before a link tool could exist. The fetcher now refuses any host that does not resolve to public addresses only, and checks again before every redirect. Run against the real network:
https://example.com/ → 200, 156 characters of text
http://github.com/ → 200, after a redirect to https, checked first
http://localhost:3103/ → refused before any request
http://127.0.0.1:3103/ → refused
http://[::1]:3103/ → refused
http://2130706433/ → refused (127.0.0.1, written as one number)
http://169.254.169.254/latest/meta-data/ → refused
https://localtest.me/ → refused (a public name that resolves to 127.0.0.1)
Before and after
| Before | After | |
|---|---|---|
| A student's own AI and their notes | Copy and paste | One address, one sign-in, one tap to allow |
| A 10-question quiz from a note | 7 coins, written by our model | 1 coin, written by theirs, checked by us |
| A quiz taken in the AI app | Cereby never hears about it | Graded on our side, counted in performance |
| An app a user approved by mistake | Let in at both doors | Waits to be allowed, or is not on the list |
| "Add a web link" | Fetched any address | Public addresses only |
What this taught us
Parity is a list before it is a feature. We could not say what "everything the app can do" meant until a test made us place 38 chat actions and 97 groups of routes one by one, and the two we argued about, tags and note audio, were the ones that turned out to be broken or browser-only.
Wrapping a route is the best audit we have run by accident. The file handlers' sign-in check that never fired and the fetcher that read inside addresses were both in plain sight. Nobody reads a working route until they have to call it from somewhere new.
A consent screen is someone else's gate. It proves a person tapped a button on a page we do not control, under a name the app chose for itself. The yes that counts is given in our own Settings.
The reader is a context window the student pays for. The admin server's 142 tools take 263,497 characters to describe, and its one user never notices. A student's AI app reads the list every time it connects, so the student one is 35,765 characters for 47 tools, and a test fails the day it passes 50,000.
What's next
Usage, first: this post has none, and the next one about this server should be made of nothing else. Then note audio, which needs a note's spoken sentences built on the server.