Skip to content

Commit 0177514

Browse files
authored
Merge pull request #24831 from dvdksn/isitagentready
Improve agent/LLM discoverability of the docs site
2 parents 12124ee + 63be81f commit 0177514

5 files changed

Lines changed: 43 additions & 4 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,15 @@ jobs:
103103
--exclude "*" \
104104
--include "*.pf_meta" \
105105
--include "*.pf_fragment"
106+
-
107+
name: Set markdown Content-Type on llms.txt
108+
if: ${{ env.DOCS_S3_BUCKET != '' }}
109+
run: |
110+
aws --region ${{ env.DOCS_AWS_REGION }} s3 cp \
111+
s3://${{ env.DOCS_S3_BUCKET }}/llms.txt \
112+
s3://${{ env.DOCS_S3_BUCKET }}/llms.txt \
113+
--content-type="text/markdown" \
114+
--metadata-directive="REPLACE"
106115
-
107116
name: Update Cloudfront config
108117
if: ${{ env.DOCS_CLOUDFRONT_ID != '' }}

hack/releaser/cloudfront-lambda-redirects.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,11 @@ exports.handler = (event, context, callback) => {
6868
// If it's not a file, treat it as a directory
6969
if (!hasFileExtension) {
7070
if (wantsMarkdown) {
71-
// Markdown files are flattened: /path/to/page.md not /path/to/page/index.md
72-
uri = uri.replace(/\/$/, '') + '.md';
71+
// Markdown files are flattened: /path/to/page.md not /path/to/page/index.md.
72+
// Homepage has no flattened equivalent, so serve llms.txt as the
73+
// agent-oriented markdown index of the site.
74+
const stripped = uri.replace(/\/$/, '');
75+
uri = stripped === '' ? '/llms.txt' : stripped + '.md';
7376
} else {
7477
// HTML uses directory structure with index.html
7578
if (!uri.endsWith("/")) {
@@ -79,8 +82,9 @@ exports.handler = (event, context, callback) => {
7982
}
8083
request.uri = uri;
8184
} else if (wantsMarkdown && uri.endsWith('/index.html')) {
82-
// If requesting index.html but wants markdown, use the flattened .md file
83-
uri = uri.replace(/\/index\.html$/, '.md');
85+
// If requesting index.html but wants markdown, use the flattened .md file.
86+
// Root index.html has no flattened equivalent, so serve llms.txt instead.
87+
uri = uri === '/index.html' ? '/llms.txt' : uri.replace(/\/index\.html$/, '.md');
8488
request.uri = uri;
8589
}
8690

layouts/home.llms.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
{{- $grouped := $sorted.GroupBy "Section" -}}
44

55
# Docker Documentation
6+
7+
> MCP endpoint for structured agent access: https://mcp-docs.docker.com/mcp
68
{{- range $grouped }}
79

810
## {{ humanize .Key }}

layouts/home.robots.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
{{- if hugo.IsProduction -}}
88
User-agent: *
99
Disallow: /unassociated-machines/
10+
Content-Signal: ai-train=yes, search=yes, ai-input=yes
1011

1112

1213
Sitemap: {{ "sitemap.xml" | absURL }}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"serverInfo": {
3+
"name": "llms-txt",
4+
"version": "1.26.0",
5+
"description": "Official Docker documentation MCP server. Exposes a fetch_docker_docs tool that returns the docs.docker.com content index."
6+
},
7+
"transport": {
8+
"type": "http",
9+
"url": "https://mcp-docs.docker.com/mcp"
10+
},
11+
"capabilities": {
12+
"prompts": {
13+
"listChanged": false
14+
},
15+
"resources": {
16+
"subscribe": false,
17+
"listChanged": false
18+
},
19+
"tools": {
20+
"listChanged": false
21+
}
22+
}
23+
}

0 commit comments

Comments
 (0)