elements / mcp-app
AGENTS.md115 starsChanged 54 days agoApache-2.0View on GitHub
This file covers how this starter wires an MCP server to an Elements-based MCP App resource. For Elements component APIs, template validation, and general project setup commands, use the Elements CLI/MCP documentation instead.
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,774 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository46 other files it gives its agents.
- AGENTS.mdAGENTS.md
- projects/starters/angular/AGENTS.mdAGENTS.md
- projects/starters/bundles/AGENTS.mdAGENTS.md
- projects/starters/eleventy/AGENTS.mdAGENTS.md
- projects/starters/eleventy-ssr/AGENTS.mdAGENTS.md
- projects/starters/go/AGENTS.mdAGENTS.md
- projects/starters/go-htmx/AGENTS.mdAGENTS.md
- projects/starters/hugo/AGENTS.mdAGENTS.md
- projects/starters/importmaps/AGENTS.mdAGENTS.md
- projects/starters/lit-library/AGENTS.mdAGENTS.md
- projects/starters/mpa/AGENTS.mdAGENTS.md
- projects/starters/nextjs/AGENTS.mdAGENTS.md
- projects/starters/nuxt/AGENTS.mdAGENTS.md
- projects/starters/react/AGENTS.mdAGENTS.md
- projects/starters/solidjs/AGENTS.mdAGENTS.md
- projects/starters/sphinx/AGENTS.mdAGENTS.md
- projects/starters/svelte/AGENTS.mdAGENTS.md
- projects/starters/typescript/AGENTS.mdAGENTS.md
- projects/starters/vue/AGENTS.mdAGENTS.md
- agent-availability-reportSkill
- agent-debug-ciSkill
- agent-dependenciesSkill
- agent-startersSkill
- agent-upkeepSkill
- agent-web-modernizationSkill
- audit-accessibilitySkill
- audit-ciSkill
- audit-codeSkill
- audit-consolidationSkill
- audit-simplificationSkill
- authoring-benchmarksSkill
- authoring-componentsSkill
- authoring-documentationSkill
- authoring-examplesSkill
- authoring-patternsSkill
- authoring-projectsSkill
- authoring-testsSkill
- authoring-typescriptSkill
- elementsSkill
- github-dependabotSkill
- guidance-api-designSkill
- guidance-buildSkill
- guidance-webgpu-performanceSkill
- summarize-releasesSkill
- summarize-video-releasesSkill
- troubleshootingSkill
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
19 rules. About 0 are common, 2 are distinctive, and 17 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
17
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 7
Keep the MCP stdio server entrypoint in src/index.ts.
- Very specific: line 9
Keep app resource URIs stable and use the same URI in the tool _meta.ui.resourceUri and resource registration.
- Very specific: line 10
Keep the app resource HTML in src/ui/*.html and browser-side resource logic in the matching src/ui/*.ts file.
- Very specific: line 11
Keep Elements component registration imports in the browser-side src/ui/*.ts file that renders the corresponding nve-* tags.
- Very specific: line 12
Keep global Elements theme and style imports inside the app resource HTML so the single-file Vite build embeds them.
- Very specific: line 16
Use zod schemas for tool input validation.
- Very specific: line 18
Keep stdio startup at module scope with StdioServerTransport.
- Very specific: line 19
Avoid DOM access in src/index.ts.
- Very specific: line 24
Use App from @modelcontextprotocol/ext-apps for host communication.
- Very specific: line 26
Treat tool results as untrusted data: narrow unknown values before rendering.
- Distinctive: line 27
Use direct DOM APIs for small starter interactions.
- Very specific: line 28
Prefer Elements components and nve-layout/nve-text attributes over starter-specific CSS.
- Very specific: line 32
Keep vite-plugin-singlefile enabled so the MCP resource is emitted as one portable HTML file.
- Very specific: line 33
Keep base: './' for archive-friendly output.
- Distinctive: line 34
Keep the Rollup input pointed at the app resource HTML, not the Node server entrypoint.
- Very specific: line 35
Keep tsconfig.server.json responsible for compiling the stdio server to dist/index.js.
- Very specific: line 39
Run pnpm run build in projects/starters/mcp-app after MCP server, app resource, TypeScript, or Vite changes.
- Very specific: line 40
Run pnpm run lint after TypeScript or config edits.
- Very specific: line 41
Run pnpm run ci before treating starter changes as complete.
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Elements MCP App Starter
This file covers how this starter wires an MCP server to an Elements-based MCP App resource. For Elements component APIs, template validation, and general project setup commands, use the Elements CLI/MCP documentation instead.
Integration Points
- Keep the MCP stdio server entrypoint in
src/index.ts. - Register app tools with
registerAppTooland app HTML resources withregisterAppResource. - Keep app resource URIs stable and use the same URI in the tool
_meta.ui.resourceUriand resource registration. - Keep the app resource HTML in
src/ui/*.htmland browser-side resource logic in the matchingsrc/ui/*.tsfile. - Keep Elements component registration imports in the browser-side
src/ui/*.tsfile that renders the correspondingnve-*tags. - Keep global Elements theme and style imports inside the app resource HTML so the single-file Vite build embeds them.
MCP Server Constraints
- Use
zodschemas for tool input validation. - Return user-visible text in
contentand machine-readable values instructuredContent. - Keep stdio startup at module scope with
StdioServerTransport. - Avoid DOM access in
src/index.ts; it runs in Node.js. - Resolve app resource files relative to
import.meta.urlso compileddist/index.jscan read the bundled resource path.
App Resource Constraints
- Use
Appfrom@modelcontextprotocol/ext-appsfor host communication. - Apply host theme changes with
applyDocumentThemeand keepnve-themesynchronized ondocument.documentElement. - Treat tool results as untrusted data: narrow
unknownvalues before rendering. - Use direct DOM APIs for small starter interactions; extract reusable behavior only after another app resource needs it.
- Prefer Elements components and
nve-layout/nve-textattributes over starter-specific CSS.
Vite Constraints
- Keep
vite-plugin-singlefileenabled so the MCP resource is emitted as one portable HTML file. - Keep
base: './'for archive-friendly output. - Keep the Rollup input pointed at the app resource HTML, not the Node server entrypoint.
- Keep
tsconfig.server.jsonresponsible for compiling the stdio server todist/index.js.
Verification
- Run
pnpm run buildinprojects/starters/mcp-appafter MCP server, app resource, TypeScript, or Vite changes. - Run
pnpm run lintafter TypeScript or config edits. - Run
pnpm run cibefore treating starter changes as complete.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

