llmstxt-mcp

digitalcyphrpnk/llmstxt-mcp

3.2

If you are the rightful owner of llmstxt-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

An MCP (Model Context Protocol) server for discovering, generating, and validating llms.txt files.

Tools
6
Resources
0
Prompts
0

llms-txt MCP Server

An MCP (Model Context Protocol) server for discovering, generating, and validating llms.txt files.

Features

  • Discovery: Find and parse existing llms.txt files from websites
  • Generation: Create llms.txt files for projects and websites
  • Validation: Check llms.txt format compliance with the specification
  • Context Expansion: Convert llms.txt files into full context for LLM consumption
  • Directory Search: Search community directories for llms.txt implementations
  • Repository Analysis: Generate llms.txt from repository structure

Tools Available

discover_llmstxt

Discover and parse llms.txt file from a website.

Parameters:

  • url (string): Website URL to check for llms.txt

generate_llmstxt

Generate llms.txt file for a project or website.

Parameters:

  • title (string): Project or website title
  • description (string): Brief description of the project
  • docs_urls (array, optional): List of documentation URLs
  • examples_urls (array, optional): List of example URLs
  • optional_urls (array, optional): List of optional reference URLs
  • output_path (string, optional): Path to save the generated file

validate_llmstxt

Validate llms.txt format compliance.

Parameters:

  • content (string): llms.txt content to validate

expand_llmstxt_context

Expand llms.txt into full context for LLM consumption.

Parameters:

  • llmstxt_url (string): URL to llms.txt file
  • include_optional (boolean, optional): Include optional URLs in expansion
  • max_content_length (number, optional): Maximum content length per URL
  • format_type (string, optional): Output format ("markdown", "xml", "plain")

search_llmstxt_directory

Search community directories for llms.txt files.

Parameters:

  • query (string, optional): Search query
  • category (string, optional): Filter by category
  • limit (number, optional): Maximum number of results

generate_from_repository

Generate llms.txt from a repository by analyzing its structure.

Parameters:

  • repo_url (string): Repository URL
  • title (string, optional): Project title
  • description (string, optional): Project description
  • include_readme (boolean, optional): Include README.md
  • auto_discover_docs (boolean, optional): Auto-discover documentation

Installation

Using uv (recommended)

# Clone the repository
git clone https://github.com/digitalcyphrpnk/llmstxt-mcp.git
cd llmstxt-mcp

# Setup with uv
uv venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate

# Install dependencies
uv pip install -e .

Using pip

pip install llmstxt-mcp

Configuration

OpenCode Configuration

Add to your opencode.json:

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "llmstxt": {
      "type": "local",
      "command": ["llmstxt-mcp"],
      "enabled": true
    }
  }
}

Claude Desktop Configuration

Add to your Claude Desktop configuration:

{
  "mcpServers": {
    "llmstxt": {
      "command": "llmstxt-mcp"
    }
  }
}

Usage Examples

Discover existing llms.txt

Check if https://fastht.ml has an llms.txt file

Generate llms.txt for a project

Generate an llms.txt file for my React documentation project with title "React Docs" and description "Comprehensive React documentation and examples"

Validate llms.txt format

Validate this llms.txt content to ensure it follows the specification

Expand llms.txt to full context

Expand the llms.txt from https://fastht.ml/docs/llms.txt into full context for analysis

Search community directory

Search for llms.txt files related to "documentation" projects

Generate from repository

Generate an llms.txt file by analyzing the structure of https://github.com/microsoft/typescript

llms.txt Specification

The llms.txt specification defines a standard format:

  1. H1 Title (required): # Project Name
  2. Blockquote Description (optional): > Brief description
  3. Sections (optional):
    • ## Docs - Documentation links
    • ## Examples - Example links
    • ## Optional - Additional references
  4. Links: Markdown format - [Name](URL)

Development

Setup Development Environment

# Clone and setup
git clone https://github.com/digitalcyphrpnk/llmstxt-mcp.git
cd llmstxt-mcp

# Install with development dependencies
uv pip install -e ".[dev]"

# Run tests
pytest

# Format code
black src tests
ruff check src tests

# Type checking
mypy src

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests for new functionality
  5. Run the test suite
  6. Submit a pull request

License

MIT License - see file for details.

Related Projects