A toy todo CLI in Typer. Highlights mark the agent-friendly bits.
from json import dumpsimport typerapp = typer.Typer(rich_markup_mode=None) # plain text: no box art for agentsTODOS = [{"id": 1, "title": "Write slides"}]@app.command("list")def list_todos(json: bool= typer.Option(False, "--json")):"""Show all todos."""print(dumps(TODOS) if json else"\n".join(t["title"] for t in TODOS))@app.command()def delete(todo_id: int, yes: bool= typer.Option(False, "--yes")):"""Delete a todo by id."""if todo_id notin {t["id"] for t in TODOS}: typer.echo(f"error: no todo {todo_id}; run `todo list`", err=True)raise typer.Exit(3)ifnot yes: typer.echo("error: deleting needs --yes", err=True)raise typer.Exit(4)print(dumps({"deleted": todo_id}))app()
A stub: delete validates and reports but stores nothing. Typer turns type hints and docstrings into --help. Exit code 2 already means a usage error, so domain errors start at 3. Tested with Typer 0.29.2.
from mcp.server import MCPServermcp = MCPServer("Todo")@mcp.tool()def add_todo( title: str, due: str|None=None) ->dict:"""Create a todo. due: ISO date."""return {"id": 42, "title": title}if__name__=="__main__": mcp.run("streamable-http")
tools/list: the agent sees
{"name":"add_todo","description":"Create a todo. due: ISO date.","inputSchema":{"type":"object","properties":{"title":{"type":"string"},"due":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["title"]}}
Type hints and docstrings become the interface. Write them for a reader with no context.
A stub: add_todo stores nothing and ignores due. Tested with the MCP Python SDK 2.3.0, which speaks protocol 2026-07-28; schema output abridged.
No sessions, so any replica can take the request. Cache discovery and reads by their hints; keep app state in a shared store.
Sent with curl to the minimal server.py from the previous slide (MCP Python SDK 2.3.0); without the headers the server returns 400. Response abridged. Specs: Streamable HTTP, caching.
CLI or MCP?
Prefer a CLI when
the agent has a terminal (coding agents)
one developer, their own credentials
output needs piping and scripting
humans use the same tool
Prefer MCP when
the agent has no shell (chat apps)
many users need per-user OAuth
you need central governance and audit
you want hosted, zero-install access
Control delegated access
🔑 Least privilege
Use scoped, short-lived, read-only tokens by default.
🧪 Dry runs, safe retries
Dry-run writes; use idempotency keys for safe retries.
🛑 Explicit intent
Require explicit consent for destructive actions.
🧾 Audit trail
Identify agent traffic and log consequential actions.
---name: todo-clidescription: Manage todos with the `todo` CLI. Use when asked to list or delete todos.---# Using the todo CLI- Run `todo list --json` and parse stdout.- Exit code 3 means "not found": run `todo list` to get valid ids.- Deleting needs `--yes`; ask the user first.
Agent Skills are folders of instructions an agent loads only when relevant.
AGENTS.md does the same job for a repository.
Tools ship them too: Astral publishes an official uv skill.
plugins:- llmstxt:markdown_description:| You can use uv to install Python dependencies, run scripts, ...sections:Getting started:- getting-started/installation.mdGuides:- guides/scripts.md
llms.txt: the build writes
# uv> uv is an extremely fast Python package> and project manager, written in Rust.You can use uv to install Python ...## Getting started- [Installation](https://docs.astral.sh/uv/ getting-started/installation/index.md)## Guides- [Running scripts](https://docs.astral.sh/uv/ guides/scripts/index.md)
Add your repo at context7.com and steer the parser with context7.json. Agents then call resolve-library-id and query-docs over MCP.
what the agent gets back
# query-docs("/astral-sh/uv",# "add a dependency to a project")# → "Adding a dependency with uv add"# (docs/guides/projects.md)uv add requestsuv add --dev pytestuv add --group lint ruff
Not taking part is completely legitimate. Pick deliberately, and list the pages you do want found in sitemap.xml.
robots.txt is a request, not a lock: enforce with bot management or a WAF. Content signals state a preference; Disallow is what crawlers without signal support obey. Content-Signal values must sit on one line in a real file. Sources: contentsignals.org, Cloudflare managed robots.txt
$ curl -sL-A'Claude-User/1.0' https://vercel.com/pricing \-H'Accept: text/markdown'|head-3# Vercel PricingChoose a Vercel plan and compare features and usage pricing.
1,263 → 28 KBVercel pricing page, HTML vs Markdown
179 → 17 KBCloudflare docs page, HTML vs Markdown
Host can’t do content negotiation? Publish .md mirrors and link them with <link rel="alternate" type="text/markdown">.
Never advertise a capability you don’t have. A false signal is worse than none.
For a server at /mcp, that is /.well-known/oauth-protected-resource/mcp; WWW-Authenticate can also point to it. The metadata names your authorisation server; that server, often an external identity provider, publishes /.well-known/oauth-authorization-server. Sources: Cloudflare, isitagentready.com check list; MCP authorisation
Level 4: WebMCP, tools inside the page
search.html
<form toolname="search_flights" tooldescription="Search flights by route and date"><input name="origin" required><input name="destination" required><input name="date" type="date" required><button>Search</button></form>
Experimental
A browser agent calls search_flights directly instead of guessing which box to type in.
WebMCP is a Chrome origin trial; API names are still changing. Watch, don’t bet the roadmap.
Neither agent used WebMCP. Clear names and state alone cut the work by more than half.
Same task, prompt, and browser tools for both agents. The rebuild has less content and keeps the shop on one domain, which explains part of the gap. Tested through its WebMCP tools, it needed the page for links and prices: tools complement the accessibility tree. Code, prompts, and full report: zeiss-ui-sdk
Your host decides some of this
Capability
Static host (e.g. GitHub Pages)
Programmable edge (Cloudflare, Vercel, Netlify)
robots.txt, sitemap, llms.txt
✅
✅
.md mirrors + <link rel="alternate">
✅
✅
Link response headers (RFC 8288)
❌ fixed headers
✅
Accept: text/markdown negotiation
❌
✅ toggle or rewrite rule
Bot management, enforced blocking
❌
✅
Some failing checks are hosting decisions, not code bugs. Use the static substitutes and move on.
Personal vs commercial sites
Personal, non-commercial
Commercial
Goal
Be found and cited correctly
Be found, recommended, and used
Must
Levels 0–1, server-rendered HTML
Levels 0–3 everywhere
Worth it
llms.txt, .md mirrors, Person JSON-LD, trust pages
Markdown negotiation, OpenAPI, CLI, MCP, OAuth
Skip
API catalogue, OAuth, MCP card, WebMCP: nothing to call
Signals for features you don’t offer
Track
Search Console, an occasional scan
Citation rate and share of voice in AI answers
Size the effort to the site. If visitors can’t do anything there, skip the API layer.
# Scan from the terminalnpx is-agentic example.com \--json# Fail CI below your baselinenpx @vercel/agent-readability \ audit https://example.com \--min-score 80
Turn failures into a prompt for your coding agent, then guard the fix in CI. Review the diff like any other PR.