Skip to content

feat: Improve llms.txt and add Accept: text/markdown content negotiation#805

Merged
dcramer merged 8 commits intomainfrom
improve-llms-txt-content-negotiation
Feb 12, 2026
Merged

feat: Improve llms.txt and add Accept: text/markdown content negotiation#805
dcramer merged 8 commits intomainfrom
improve-llms-txt-content-negotiation

Conversation

@dcramer
Copy link
Member

@dcramer dcramer commented Feb 12, 2026

Expand llms.txt from a bare server address to comprehensive setup documentation
so AI agents can actually help users configure the MCP server correctly. Previously
the endpoint only said "The MCP's server address is: https://mcp.sentry.dev/mcp"
with no mention of org/project scoping, query parameters, or setup commands — leading
to repeated failed attempts when agents tried to help users connect.

The new content covers:

  • Base endpoint and optional org/project scoping
  • Query parameters (?experimental=1, ?agent=1)
  • Copy-paste setup commands for Claude Code, Cursor, and VSCode

Also adds Accept: text/markdown content negotiation on GET / so AI agents
requesting the homepage get the same useful markdown instead of the raw SPA HTML.

Extracts a getBaseUrl() helper to deduplicate origin derivation across route handlers.

@dcramer dcramer marked this pull request as ready for review February 12, 2026 21:31
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

dcramer and others added 8 commits February 12, 2026 14:03
Expand llms.txt from a bare server address to comprehensive setup docs
covering endpoint scoping (org/project), query parameters, and
copy-paste setup commands for Claude Code, Cursor, and VSCode.

Add Accept: text/markdown content negotiation on GET / so AI agents
requesting the homepage get the same useful markdown instead of SPA HTML.

Extract getBaseUrl() helper to deduplicate origin derivation across
route handlers.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Cloudflare's static asset serving intercepts GET / before the Hono app
runs, so the Accept: text/markdown handler never fires. Move the check
to the outer worker fetch handler in index.ts where it runs before
asset routing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Cloudflare's asset serving intercepts GET / before the worker runs,
preventing Accept: text/markdown content negotiation. Enable
run_worker_first so the worker handles all requests first, with an
explicit fallback to env.ASSETS.fetch() for unmatched non-MCP routes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Ensure /api, /oauth, and /.mcp paths return proper error responses
instead of falling through to static asset (SPA) serving.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
All unmatched routes should fall through to static assets since
run_worker_first is only needed for homepage content negotiation.
Any route the worker handles will return a non-404 response.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Content negotiation on GET / required run_worker_first, a 404 fallback
to env.ASSETS.fetch(), and changes to wrangler routing — too much
complexity for one endpoint. The comprehensive setup docs are already
served at /llms.txt which works without any routing changes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@dcramer dcramer force-pushed the improve-llms-txt-content-negotiation branch from 7353760 to cf41928 Compare February 12, 2026 22:05
@dcramer dcramer merged commit a10db6d into main Feb 12, 2026
13 checks passed
@dcramer dcramer deleted the improve-llms-txt-content-negotiation branch February 12, 2026 22:10
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.

1 participant