llms.txt

io.github.basitalisandhuv0.1.1更新于 Oct 5, 2026

Build llms.txt from local Markdown or a sitemap.xml and check an existing llms.txt file.

已验证STDIO仅桌面Developer ToolsKnowledge & Memory

概览

AI 生成的概览

从本地 Markdown 文件或本地 sitemap.xml 生成 llms.txt,并按约定检查已有的 llms.txt 文件。

功能
该服务器提供三个工具。generate_llms_txt 扫描目录中的 .md、.mdx 和 .markdown 文件,跳过 node_modules、.git、构建产物和隐藏目录,从 frontmatter、首个 H1 或文件名提取标题,按顶层文件夹分组,并返回文本、条目和被跳过的文件。generate_from_sitemap 将本地 sitemap.xml 转换为每个 url 一条链接,按首个路径段分组。check_llms_txt 针对文件路径或提供的内容,按行号报告错误、警告和信息。
适用场景
当你维护文档或网站,希望根据现有 Markdown 或 sitemap 生成 llms.txt,或在发布前按约定校验已有的 llms.txt 时,适合使用。
运行要求
通过 stdio 在本地运行;无需网络访问、账号、API 密钥或环境变量。可用 npx 安装固定版本的软件包,或运行 Docker 镜像 ghcr.io/basitalisandhu/mcp-llms-txt:0.1.1。从代码检出运行时需要 Node.js 并先执行构建。它只读取你指定的文件。
安装前请注意
它会读取你指定目录或路径下的本地文件,最多 1000 个文件、每个 1 MB、12 层深度,或单个不超过 2 MB 的 sitemap 或 llms.txt。它从不写入,也不抓取 URL,因此返回的文本需要你自己保存。由 sitemap 生成的条目备注为空,因为不会抓取页面内容,发布前请补全。请固定软件包版本,以免更新在你不察觉时改变编辑器中运行的内容。

安装

在 SourceWeft 中

  1. 打开 控制台中的 llms.txt,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

llms-txt MCP server

Generates an llms.txt from a directory of Markdown or from a local sitemap.xml, and checks an existing llms.txt against the convention. Reads local files only; never writes and never fetches a URL.

Part of dev-mcp-servers. Stdio transport only; the server never opens a port.

Tools

ToolInputWhat it returns
generate_llms_txtdirectory, title, description?, details?, base_url?, url_style?, max_files?, include_dirs?, optional_sections?Scans .md, .mdx and .markdown files (skipping node_modules, .git, build output and hidden directories), takes each title from frontmatter, the first H1 or the file name and the notes from frontmatter or the first paragraph, groups by top-level folder, and returns the text plus the entries and anything skipped.
generate_from_sitemappath, title, description?, details?, include_prefix?, exclude_prefix?, optional_sections?, max_urls?One link per <url>, grouped by first path segment, titles derived from the URL (pages are not fetched).
check_llms_txtpath or contentErrors, warnings and info with line numbers: single H1 first, blockquote summary, H2 sections of - [name](url): notes, no deeper headings, no duplicates, modest size.

Install

Claude Code:

bash
claude mcp add llms-txt -- npx -y @basitalisandhu/[email protected]

Add -s user to make it available in every project. Any client that reads .mcp.json (Claude Code, Claude Desktop, Cursor):

json
{  "mcpServers": {    "llms-txt": {      "command": "npx",      "args": ["-y", "@basitalisandhu/[email protected]"]    }  }}

Pin the version as shown so that an update to the package cannot change what runs in your editor without you noticing. From a checkout, use "command": "node", "args": ["<path>/packages/llms-txt/dist/index.js"] after npm install && npm run build at the repository root.

What it touches

  • Network: None.
  • Local files: Reads Markdown files under the directory you name (up to 1000 files, 1 MB each, 12 levels deep) or the one sitemap or llms.txt you name (up to 2 MB).
  • Telemetry: none.

Notes

  • The output is returned as text; write it to llms.txt yourself after reviewing it.
  • Sitemap-derived files have empty notes because page content is not fetched; fill them in before publishing.

Build and test

bash
npm install        # at the repository rootnpm run build -w @basitalisandhu/mcp-llms-txtnpm test -w @basitalisandhu/mcp-llms-txt

Tests use node:test and the SDK's in-memory transport; they do not reach the network.

Licence

MIT. See LICENSE.

来源:packages/llms-txt/README.md,提交 58c8c95

工具

0
工具元数据尚未被收录。

版本历史

1
  1. v0.1.1最新Oct 5, 2026