Skip to content

feat: improve AI documentation discoverability#393

Merged
gregnazario merged 1 commit intomainfrom
cursor/ai-documentation-discoverability-de2b
Mar 16, 2026
Merged

feat: improve AI documentation discoverability#393
gregnazario merged 1 commit intomainfrom
cursor/ai-documentation-discoverability-de2b

Conversation

@gregnazario
Copy link
Collaborator

@gregnazario gregnazario commented Mar 16, 2026

Summary

Four changes to help AI agents and LLMs discover and navigate the Aptos docs more efficiently:

1. <link rel="llms-txt"> in every page's <head>

Any LLM that fetches any page on aptos.dev will now see:

<link rel="llms-txt" href="/llms.txt" />

This is the emerging convention for LLMs.txt discovery (analogous to <link rel="sitemap">).

File: src/starlight-overrides/Head.astro

2. /.well-known/llms.txt redirect

Added a permanent (301) redirect from /.well-known/llms.txt/llms.txt at the CDN level.
This is the emerging standard well-known path for LLMs.txt, and currently returns a 404.

File: vercel.json

3. /en/*/* permanent redirects at CDN level

Old /en/build-style URLs (from the previous docs site) now 301-redirect to the correct path at the CDN edge, instead of relying solely on the server middleware (which returns a 302). This eliminates dead ends for LLM agents that still have cached /en/ URLs.

File: vercel.json

4. MCP server mentioned in llms.txt

The generated llms.txt now includes a details section that tells LLMs:

For AI coding tools, install the Aptos MCP server: npx @aptos-labs/aptos-mcp
It gives your IDE direct access to Aptos APIs, on-chain data, and Move contract helpers.
See https://aptos.dev/build/ai for setup guides (Claude Code, Cursor, and more).

This complements the description and optionalLinks added in #379.

File: astro.config.mjs (starlightLlmsTxt details option)

Bonus fix

Fixed the MCP server npm URL in optionalLinks from @anthropic-ai/aptos-mcp to @aptos-labs/aptos-mcp (introduced in #379).

Open in Web Open in Cursor 

@vercel
Copy link

vercel bot commented Mar 16, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
aptos-docs Ready Ready Preview, Comment Mar 16, 2026 9:40pm

Request Review

@gregnazario gregnazario marked this pull request as ready for review March 16, 2026 20:39
Copilot AI review requested due to automatic review settings March 16, 2026 20:39
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Improves AI/LLM discoverability for the Aptos docs site by adding llms.txt link tags, well-known URL redirects, /en/* legacy path redirects, and MCP server details in the generated llms.txt. Also includes MDX formatting fixes.

Changes:

  • Added <link rel="llms-txt"> to every page's <head>, a .well-known/llms.txt redirect, and /en/*/* redirects in vercel.json
  • Added MCP server details to starlightLlmsTxt config in astro.config.mjs
  • Auto-formatted MDX files for Kotlin SDK docs (zh/es locales)

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

File Description
vercel.json Added redirects for .well-known/llms.txt and /en/* paths
src/starlight-overrides/Head.astro Added <link rel="llms-txt"> tag
astro.config.mjs Added MCP server details to llms.txt generation
src/content/docs/{zh,es}/.../*.mdx MDX formatting fixes (horizontal rules, list spacing)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

- Add <link rel="llms-txt" href="/llms.txt"> to the <head> of every page
  so any LLM fetching any page can discover the machine-readable docs
- Add /.well-known/llms.txt -> /llms.txt permanent redirect in vercel.json
  (the emerging standard path for llms.txt discovery)
- Add /en and /en/:path* -> / and /:path* permanent redirects at CDN level
  so old /en/build-style URLs no longer 404 (saves LLM agents a round-trip)
- Add MCP server mention to llms.txt via starlightLlmsTxt details option
  ("For AI coding tools, install @aptos-labs/aptos-mcp")
@cursor cursor bot force-pushed the cursor/ai-documentation-discoverability-de2b branch from 09d238d to bfc029b Compare March 16, 2026 21:35
@gregnazario gregnazario merged commit ca3ed26 into main Mar 16, 2026
7 checks passed
@gregnazario gregnazario deleted the cursor/ai-documentation-discoverability-de2b branch March 16, 2026 23:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants