MCP Integration (llms.txt)
TinyKit Pro includes a Model Context Protocol (MCP) integration via the /llms.txt endpoint. This endpoint provides site information optimized for consumption...
TinyKit Pro includes a Model Context Protocol (MCP) integration via the /llms.txt endpoint. This endpoint provides site information optimized for consumption by large language models.
What is llms.txt?
The llms.txt specification (https://llmstxt.org) defines a standardized format for providing website information to AI language models. Similar to robots.txt for web crawlers, llms.txt helps LLMs understand your site's structure and purpose.
Endpoint
URL: /llms.txt
Method: GET
Content-Type: text/plain; charset=utf-8
Cache: Public, max-age 3600 seconds (1 hour)
Implementation
The endpoint is implemented at src/app/llms.txt/route.ts:
import { fetchQuery } from "convex/nextjs";
import { api } from "@/convex/_generated/api";
export const dynamic = "force-dynamic";
export async function GET() {
const baseUrl = process.env.NEXT_PUBLIC_SITE_URL ?? "http://localhost:3000";
try {
const settings = await fetchQuery(
api.siteSettings.public.queries.getPublicSettings,
{},
);
const siteName = settings.siteName ?? "My SaaS App";
const slogan = settings.slogan ?? "";
const description =
settings.description ?? "A production-ready SaaS application";
const content = `# ${siteName}
> ${description}
${slogan ? `${slogan}\n\n` : ""}Built with Next.js, Convex, and Stripe.
## Links
- [Home](${baseUrl}): Main landing page
- [Sign Up](${baseUrl}/auth/sign-up): Create an account
- [Sign In](${baseUrl}/auth/sign-in): Access your account
`;
return new Response(content, {
headers: {
"Content-Type": "text/plain; charset=utf-8",
"Cache-Control": "public, max-age=3600, s-maxage=3600",
},
});
} catch {
// Fallback content
}
}Example Output
When accessed, the endpoint returns content like:
# TinySaaS
> A production-ready SaaS application for teams
Transform your organization productivity with real-time collaboration.
Built with Next.js, Convex, and Stripe.
## Links
- [Home](https://yourdomain.com): Main landing page
- [Sign Up](https://yourdomain.com/auth/sign-up): Create an account
- [Sign In](https://yourdomain.com/auth/sign-in): Access your accountDynamic Content
The endpoint pulls content dynamically from your site settings:
| Setting | Source | Fallback |
|---|---|---|
| Site Name | siteSettings.siteName | "My SaaS App" |
| Description | siteSettings.description | "A production-ready SaaS application" |
| Slogan | siteSettings.slogan | (empty) |
| Base URL | NEXT_PUBLIC_SITE_URL env var | "http://localhost:3000" |
Customization
Adding More Links
To add additional links to your llms.txt output, modify src/app/llms.txt/route.ts:
const content = `# ${siteName}
> ${description}
## Links
- [Home](${baseUrl}): Main landing page
- [Sign Up](${baseUrl}/auth/sign-up): Create an account
- [Sign In](${baseUrl}/auth/sign-in): Access your account
- [Documentation](${baseUrl}/docs): Learn how to use our platform
- [API Reference](${baseUrl}/api-docs): Developer API documentation
- [Pricing](${baseUrl}/#pricing): View pricing plans
`;Adding Sections
You can add more sections to help LLMs understand your site:
const content = `# ${siteName}
> ${description}
## Features
- Real-time collaboration
- Team management with roles
- Subscription billing
- Multi-organization support
## Links
- [Home](${baseUrl}): Main landing page
...
## API
The API is available at ${baseUrl}/api for authenticated users.
## Contact
For support, email support@yourdomain.com
`;Testing
Visit your llms.txt endpoint directly:
curl http://localhost:3000/llms.txtOr in the browser:
- Development: http://localhost:3000/llms.txt
- Production: https://yourdomain.com/llms.txt
Use Cases
AI Assistant Integration
LLMs can use your llms.txt to understand:
- What your application does
- Where users can sign up or sign in
- Key features and capabilities
- How to navigate your site
Claude Code Integration
When using Claude Code with TinyKit Pro, the llms.txt endpoint provides context about your deployed application that AI assistants can reference.
SEO for AI
As AI-powered search becomes more prevalent, having a well-structured llms.txt helps AI systems accurately represent your site in responses.
Best Practices
- Keep it concise: LLMs work best with clear, focused information
- Update regularly: Ensure links and features are current
- Use standard format: Follow the llms.txt specification
- Include key actions: Sign up, sign in, main features
- Set appropriate cache: Balance freshness with performance
Environment Variables
| Variable | Purpose | Default |
|---|---|---|
NEXT_PUBLIC_SITE_URL | Base URL for generated links | http://localhost:3000 |
Related Documentation
- Site Branding - Site branding and settings configuration
- SEO & OG Images - SEO optimization and social sharing
Modular Routing System
TinyKit Pro implements a centralized, modular route configuration system that separates routes by domain (core auth, public pages, admin panel, organizations...
Hono + OpenAPI Integration
TinyKit Pro uses Hono with @hono/zod-openapi for HTTP endpoints, providing automatic OpenAPI specification generation, interactive API documentation, and typ...