LLM pack: avatar API, MCP server, llms.txt, crawlable HTML#85
Open
bluerssen wants to merge 2 commits into
Open
LLM pack: avatar API, MCP server, llms.txt, crawlable HTML#85bluerssen wants to merge 2 commits into
bluerssen wants to merge 2 commits into
Conversation
- GET /api/avatar.svg: server-composed avatar image with the same params as the site (or ?code= / ?random=1); strict validation with helpful 400s; immutable caching. Composition reuses the app's own art via a new pure SvgLoader.render function (extracted from the component, zero behavior change) layered in the app's z-order. - POST /mcp: stateless streamable-HTTP MCP server (hand-rolled JSON-RPC, no SDK) with list_avatar_options, generate_avatar, and random_avatar tools returning share URL + image URL + markdown. - public/llms.txt: concise spec of the URL params, API, short codes, and MCP endpoint for agents. - index.html: schema.org WebApplication JSON-LD and pre-hydration descriptive content inside #root so no-JS crawlers see a real page. - README: For LLMs & agents section; documents the append-only constraint on config.json option arrays. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
New 'For developers & agents' card below the generator: copy-paste examples for /api/avatar.svg (with a live example image rendered by the API itself), the claude mcp add command, and short share links, linking to /api/options, llms.txt, and GitHub. Layout-main becomes a flex column so the two cards stack. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
Author
|
Added an on-page "For developers & agents" section per Brian — copy-paste examples for the image API (with a live API-rendered avatar), the MCP add command, and share links. Screenshots verified at desktop and mobile widths. |
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.
Summary
Makes Personas usable by LLMs and agents, not just browsers. Stacked on #84 (short links) — merge order: #83 (grid, independent) / #84 → this.
GET /api/avatar.svg— the avatar as a real image URL. Same query params as the site, plus?code=<shortcode>and?random=1. Server-side composition imports the app's own compiledSvgLoader.render(pure function extracted from the React component — the API can never drift from the app art). Invalid params → 400 with JSON naming the valid values. Deterministic URLs getimmutablecaching.POST /mcp— stateless streamable-HTTP MCP server, hand-rolled JSON-RPC (~120 lines, no SDK, no Durable Objects). Tools:list_avatar_options,generate_avatar,random_avatar— each returns the share URL, SVG image URL, and a markdown embed. After deploy:claude mcp add --transport http personas https://personas.draftbit.com/mcp./llms.txt— concise agent-facing spec: URL param schema,/api/optionsdiscovery, image API, MCP endpoint, determinism/caching notes.WebApplicationJSON-LD plus real descriptive content inside#root(visible to no-JS crawlers, replaced on mount).config.jsonoption arrays are append-only.Verification (wrangler dev + headless browser)
/api/avatar.svgwith 13 pinned params renders pixel-identical to the app for the same URL (screenshots compared)?code=renders shared avatarsinitialize→notifications/initialized(202) →tools/list→tools/callall correct, includingisErroron invalid tool args/llms.txtserves; JSON-LD + fallback content present in raw HTML; app still mounts cleanly and replaces the fallback🤖 Generated with Claude Code