agentleFS
NVIDIAKnown publisherNVIDIA/elements/projects/starters/mcp-app/AGENTS.md

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.

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
  1. Very specific:

    Keep the MCP stdio server entrypoint in src/index.ts.

    line 7
  2. Very specific:

    Keep app resource URIs stable and use the same URI in the tool _meta.ui.resourceUri and resource registration.

    line 9
  3. Very specific:

    Keep the app resource HTML in src/ui/*.html and browser-side resource logic in the matching src/ui/*.ts file.

    line 10
  4. Very specific:

    Keep Elements component registration imports in the browser-side src/ui/*.ts file that renders the corresponding nve-* tags.

    line 11
  5. Very specific:

    Keep global Elements theme and style imports inside the app resource HTML so the single-file Vite build embeds them.

    line 12
  6. Very specific:

    Use zod schemas for tool input validation.

    line 16
  7. Very specific:

    Keep stdio startup at module scope with StdioServerTransport.

    line 18
  8. Very specific:

    Avoid DOM access in src/index.ts.

    line 19
  9. Very specific:

    Use App from @modelcontextprotocol/ext-apps for host communication.

    line 24
  10. Very specific:

    Treat tool results as untrusted data: narrow unknown values before rendering.

    line 26
  11. Distinctive:

    Use direct DOM APIs for small starter interactions.

    line 27
  12. Very specific:

    Prefer Elements components and nve-layout/nve-text attributes over starter-specific CSS.

    line 28
  13. Very specific:

    Keep vite-plugin-singlefile enabled so the MCP resource is emitted as one portable HTML file.

    line 32
  14. Very specific:

    Keep base: './' for archive-friendly output.

    line 33
  15. Distinctive:

    Keep the Rollup input pointed at the app resource HTML, not the Node server entrypoint.

    line 34
  16. Very specific:

    Keep tsconfig.server.json responsible for compiling the stdio server to dist/index.js.

    line 35
  17. Very specific:

    Run pnpm run build in projects/starters/mcp-app after MCP server, app resource, TypeScript, or Vite changes.

    line 39
  18. Very specific:

    Run pnpm run lint after TypeScript or config edits.

    line 40
  19. Very specific:

    Run pnpm run ci before treating starter changes as complete.

    line 41

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

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 registerAppTool and app HTML resources with registerAppResource.
  • Keep app resource URIs stable and use the same URI in the tool _meta.ui.resourceUri and resource registration.
  • Keep the app resource HTML in src/ui/*.html and browser-side resource logic in the matching src/ui/*.ts file.
  • Keep Elements component registration imports in the browser-side src/ui/*.ts file that renders the corresponding nve-* 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 zod schemas for tool input validation.
  • Return user-visible text in content and machine-readable values in structuredContent.
  • 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.url so compiled dist/index.js can read the bundled resource path.

App Resource Constraints

  • Use App from @modelcontextprotocol/ext-apps for host communication.
  • Apply host theme changes with applyDocumentTheme and keep nve-theme synchronized on document.documentElement.
  • Treat tool results as untrusted data: narrow unknown values 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-text attributes over starter-specific CSS.

Vite Constraints

  • Keep vite-plugin-singlefile enabled 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.json responsible for compiling the stdio server to dist/index.js.

Verification

  • Run pnpm run build in projects/starters/mcp-app after MCP server, app resource, TypeScript, or Vite changes.
  • Run pnpm run lint after TypeScript or config edits.
  • Run pnpm run ci before treating starter changes as complete.

Download now (ZIP)

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.