Repository navigation
feat(mcp): the app server as a Cloudflare Worker at an address of ours (#272) - #273
Merged
Merged
Conversation
…s, and its handler as the package's ./app (#272)
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Contributor
There was a problem hiding this comment.
All reported issues were addressed across 21 files
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
…used at the start, and the notes say what the Worker's log setting and the free plan's limit cover (#272)
Contributor
There was a problem hiding this comment.
All reported issues were addressed across 8 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
…and why the Worker's address gets no answer either way (#272)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #272. Part of #210.
The app server gets a host: a Cloudflare Worker at
mcp.embed-my.org. Nothing is deployed by this PR. Merging it puts the Worker in the repository; deploying is a step for someone signed in to the Cloudflare account (below).Why a Worker
/embedwith it. The endpoint has no sign-in, so anyone could bring that about.What changed
The MCP package (
packages/mcp)createApp()is exported as@missing-elements/h5p-mcp/app. It was a handler nobody outside the package could import.import.metafinds nothing:version,card,references. Without them it reads what it read before. Areferencesfolder that is not the author package's is refused as the server starts, so a wrong path does not quietly thin the answers.bin/h5p-mcp.mjsis marked executable in git, asbin/h5p-mcp-app.mjsalready is. pnpm sets that bit on every install once another workspace package depends on this one, so the file would otherwise show as changed after each install.The Worker (
apps/mcp-worker, new, private)src/worker.mjs: the same handler, started by the first call.scripts/stage.mjsgathers what the server reads as it runs intostaged/(not in git): the library pack's parts, the brief and the type files, the card.wrangler.jsoncattaches them to the Worker as modules, which its file system shows under/bundle, so the server's Node entry reads them as on a computer. 17 MB of the 64 MiB a Worker may be. They are modules, not static assets: nothing of them is served.observability.enabledisfalse, which switches off Workers Logs: no invocation log and no trace is stored. No store is bound. One address: noworkers.devname, no preview addresses. What Cloudflare counts for any Worker and domain, requests, statuses, CPU time, is outside that setting; the privacy policy is to name it from Cloudflare's own documents.wrangler, with the Workers runtime it starts (workerd).workerd's install script only checks its binary and stays off, as every dependency's does here; it is named inpnpm-workspace.yamlso the install says nothing.Checked
apps/mcp-worker/tests/worker.test.ts(6 tests): wrangler bundles the Worker and starts it on this computer, and each answer is held to the Node server's, word for word: the tools, the list of types, a type's file, a type's fields from its part, a source checked, one refused, the card and its address. A path of what it carries answers 404, a body over 1 MB answers 413, and the config is held to its logs off, no store and one address.pnpm typecheckover the whole repository.wrangler deploy --dry-run: 181 modules attached, 17.4 MB to upload, no bindings.Not known until it is deployed
To deploy, after the merge
From the repository's root, signed in to the Cloudflare account that has the
embed-my.orgzone:pnpm install pnpm --filter @missing-elements/h5p-mcp-worker exec wrangler login pnpm --filter @missing-elements/h5p-mcp-worker deploy:workerThe sign-in opens a browser and stays on that computer: no token of the account is in the repository or in GitHub.