はじめに
皆さんは llms.txt をご存知でしょうか?
2024年9月、fast.aiの共同創設者であるJeremy Howard氏が提唱した、LLM向けのドキュメント標準フォーマットです。Webサイトのルートに配置するMarkdownファイルで、LLMがサイトの内容を効率的に理解できるようにすることを目的としています。
実は Databricksもllms.txtを公開しています。本記事では、Databricksのllms.txtの内容と、Claude DesktopのカスタムMCPサーバーを使った活用方法を紹介します。
llms.txtとは
背景
LLMは大量のテキストを処理できますが、HTMLページをそのまま読み込むと、ナビゲーション、広告、フッターなど多くのノイズが含まれます。また、コンテキストウィンドウの制限もあるため、効率的な情報取得が求められます。
llms.txtは、こうした課題を解決するために設計されました。
仕様概要
-
配置場所: Webサイトのルート(例:
https://example.com/llms.txt) - フォーマット: Markdown
-
構造:
- H1: サイト名
- blockquote: サイトの説明
- H2: セクション見出し
- リスト: ページへのリンクと説明
関連ファイルとして、全コンテンツを1ファイルにまとめた llms-full.txt や、各ページのMarkdown版(*.md)も定義されています。
採用状況
2024年11月にMintlifyがサポートを開始し、一気に普及が進みました。現在、以下のような企業・プロジェクトが採用しています:
- Anthropic
- Cloudflare
- Stripe
- Vercel
- Supabase
- LangChain
- Databricks
参考: llmstxt.org
Databricksのllms.txt
Databricksは2つのllms.txtを公開しています。
プラットフォームドキュメント
URL: https://docs.databricks.com/llms.txt
Databricksプラットフォーム全体のドキュメント構造を網羅しています。
# Databricks documentation
> Databricks documentation
## Getting Started
- [What is Databricks?](https://docs.databricks.com/introduction/)
- [Train and deploy a model](https://docs.databricks.com/getting-started/ml-quick-start)
- [Query foundation models](https://docs.databricks.com/getting-started/query-llm-foundational-model)
...
## Machine Learning and AI
- [Generative AI](https://docs.databricks.com/generative-ai/)
- [Agent Bricks](https://docs.databricks.com/agent-bricks/)
- [MLflow for GenAI](https://docs.databricks.com/mlflow3/genai)
- [Model serving](https://docs.databricks.com/machine-learning/model-serving/)
- [Vector Search](https://docs.databricks.com/generative-ai/vector-search)
...
主なセクション:
- Getting Started
- Machine Learning and AI
- Data Engineering
- Data Warehousing
- Governance
- Developer Tools
- Reference
REST APIリファレンス
URL: https://docs.databricks.com/api/llms.txt
REST APIの全エンドポイントがMarkdown形式でまとめられています。
# Databricks REST API documentation
> Reference documentation for the Databricks REST API
## Account Access Control
- [Get assignable roles for a resource](https://docs.databricks.com/api/account/accountaccesscontrol/getassignablerolesforresource)
...
## Apps
- [Create an app](https://docs.databricks.com/api/workspace/apps/create)
- [Delete an app](https://docs.databricks.com/api/workspace/apps/delete)
...
Claude DesktopでカスタムMCPサーバーを作る
llms.txtを活用する方法として、Claude DesktopのMCP(Model Context Protocol)サーバーを作成してみます。
なぜカスタムMCPサーバー?
Claude Desktopには標準でfetchツールが搭載されていますが、カスタムMCPサーバーを作ることで以下のメリットがあります:
- 専用ツール化: URLを指定せずに呼び出せる
- 検索機能の追加: llms.txt内をキーワード検索
- キャッシュ: 頻繁なリクエストを削減
- 複数ソースの統合: ドキュメントとAPIリファレンスを横断検索
実装
Pythonスクリプト
databricks_docs_mcp.py:
import asyncio
import httpx
from mcp.server.fastmcp import FastMCP
mcp = FastMCP("databricks-docs")
@mcp.tool()
async def get_databricks_docs() -> str:
"""Databricksドキュメントの目次(llms.txt)を取得"""
async with httpx.AsyncClient() as client:
resp = await client.get("https://docs.databricks.com/llms.txt")
return resp.text
@mcp.tool()
async def get_databricks_api() -> str:
"""Databricks REST APIリファレンスの目次を取得"""
async with httpx.AsyncClient() as client:
resp = await client.get("https://docs.databricks.com/api/llms.txt")
return resp.text
@mcp.tool()
async def search_databricks(query: str) -> str:
"""Databricksドキュメントをキーワード検索
Args:
query: 検索キーワード
"""
async with httpx.AsyncClient() as client:
docs = (await client.get("https://docs.databricks.com/llms.txt")).text
api = (await client.get("https://docs.databricks.com/api/llms.txt")).text
results = []
for line in (docs + "\n" + api).split("\n"):
if query.lower() in line.lower():
results.append(line)
if results:
return f"'{query}' の検索結果:\n" + "\n".join(results[:30])
else:
return f"'{query}' に一致する結果が見つかりませんでした"
if __name__ == "__main__":
mcp.run()
Claude Desktop設定
~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"databricks-docs": {
"command": "uv",
"args": [
"run",
"--with", "mcp[cli]",
"--with", "httpx",
"python",
"/path/to/databricks_docs_mcp.py"
]
}
}
}
ポイント: uv を使うことで、依存関係(mcp, httpx)を自動解決できます。
brew install uv
使用例
Claude Desktopで以下のように使えます:
ユーザー: DatabricksのMLflowについて教えて
Claude: [search_databricksツールを呼び出し]
'mlflow' の検索結果:
- [MLflow for GenAI](https://docs.databricks.com/mlflow3/genai)
- [Model registry](https://docs.databricks.com/mlflow/model-registry)
- [MLflow for Models](https://docs.databricks.com/mlflow/experiments)
...
応用アイデア
llms.txtを活用したさらなるアイデアをいくつか紹介します。
Cursor/Windsurfの@Docs連携
CursorやWindsurfの外部ドキュメント機能にllms.txtを登録することで、コーディング中にDatabricksドキュメントを参照できます。
RAG + Vector Search
llms.txt解析 → 各ページ取得 → チャンク分割 → 埋め込み → Databricks Vector Search
Databricksネイティブなドキュメント検索システムを構築できます。
変更監視Bot
llms.txtを定期的にチェックし、新機能や新APIの追加を検知してSlackに通知するBotを作成できます。Qiita記事のネタ探しにも使えそうです。
NotebookLMでの活用
llms.txtをNotebookLMに読み込ませ、Databricksドキュメントの音声サマリーやFAQを自動生成できます。
まとめ
- llms.txt はLLM向けのドキュメント標準フォーマット
- Databricks はプラットフォームドキュメントとAPIリファレンスの両方でllms.txtを公開
- Claude Desktop のカスタムMCPサーバーを作成することで、ドキュメント検索を効率化できる
- RAG、変更監視、ワークショップ題材など、様々な応用が可能
llms.txtはまだ発展途上の仕様ですが、主要なLLMプロバイダーが正式にサポートすれば、AI時代の「robots.txt」のような存在になるかもしれません。
Databricksユーザーの皆さんも、ぜひllms.txtを活用してみてください!
参考リンク
- llms.txt 公式サイト
- Databricks llms.txt
- Databricks API llms.txt
- Model Context Protocol
- Anthropic MCP Documentation




