Documentation Index
Fetch the complete documentation index at: https://motherfuckingsideproject.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
Configuration
Overview of all AgentXP configuration options and how to apply them.Configure AgentXP by passing an options object directly to
withAgentXP() in your middleware.ts. No separate config file is required.
middleware.ts
Type-safe config with defineConfig()
For projects where you want to define configuration separately and get full TypeScript inference, import defineConfig() from @reaganhsu/agentxp-core:
agentxp.config.ts
withAgentXP():
middleware.ts
defineConfig() is a zero-overhead identity function — it exists solely for TypeScript autocompletion and type-checking. It does not load, validate, or transform your config at runtime.Configuration shape
The object passed towithAgentXP() accepts the following top-level keys:
| Key | Type | Description |
|---|---|---|
detection | object | Controls how AgentXP identifies AI agent requests |
transform | object | Controls HTML-to-markdown conversion |
permissions | object | Signals what agents are permitted to do with your content |
llmsTxt | object | Configures the auto-generated /llms.txt index |
siteHeader | object | Manual navigation context prepended to every markdown response |
Complete example
middleware.ts
Configuration sections
Detection
Configure which signals AgentXP uses to identify AI agents.
Transform
Control how HTML pages are converted to markdown.
Permissions
Signal what agents may do with your content.
llms.txt
Configure the auto-generated site index for AI agents.