Skip to content

janwilmake/agent-friendly

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 

Repository files navigation

Principles for Websites/Apps

Discuss

Serve llms.txt or sitemap

llms.txt is an increasingly adopted standard of navigation for agents.

Adopt MCP

This specification is still in active development, but is getting a lot of adoption.

See https://modelcontextprotocol.io for more info.

For discoverability, there is no defined standard yet, but there are several competing ideas, which you could already adopt:

Adopt MCP-compatible OAuth

Allow any MCP client to let the user authenticate. If you have protected resources in your app, a set of practices specified these listed documents allows MCP clients (and other protocols) to use your tools.

Serve an OpenAPI

The OpenAPI Specification allows describing your entire server functionality in a discoverable static file. Here are some best practices to creating a great discoverable OpenAPI.

Inform on different user flows

API calls are often part of a bigger sequence of operations. Besides describing this in documentation and your OpenAPI, there's also the Arazzo Specification which allows you to define these sequences in a standardized way.

Besides this, it makes sense to instruct agents on next steps in a sequence in text responses, including in non OK responses that would otherwise be a dead end. This reduces the likelihood that an agent gets stuck, just like you would normally design for when creating a website. This can be done at the REST endpoint level since it also helps programmers. However, some people may prefer this for MCP.

Agent-Friendly Payments

There isn't one dominant strategy yet to make agents able to pay for your products, so I'll create an overview here for competing standards.

Use rel alternate

The HTML Spec specifies you can refer to alternate representations of documents using <link rel="alternate" type="your-mime-type">

Example:

<link rel="alternate" type="text/markdown" href="docs.md" title="Docs" />

By adding a "text/markdown", "text/plain", or "application/json" representation to your HTML documents, you can instruct programmatic access to more token-dense and more machine-readable versions of the same document.

Vary on accept header

Browser requests normally have text/html at the start of their accept header they send when requesting web-pages. Agents don't, yet often recieve the same HTML back on a specific address.

By responding with a more machine-friendly representation of the same document if the accept header prioritizes it (see how this works here) we make it easier for agents to retrieve the content they're looking for.

No captcha for agents

Does NOT serve an 'im not a robot' page

robots.txt should be permissive

If you're blocking robots but allowing humans

Principles for codebases/libraries/packages

Coming soon

Packages

The following is an overview of the packages in this repo, and what their purpose is.

  • getassetmanifest - builds a manifest.json file compatible with cloudflare workers
  • llmstxt-generate - generates a llms.txt file from your manifest.json. Useful to make a llms.txt for static websites hosted on cloudflare workers.

About

Agent-Friendly Web Principles

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published