Lighthouse MCP
Lighthouse MCP Server
Google Lighthouse を使用して包括的な Web パフォーマンス監査と分析機能を提供する Model Context Protocol (MCP) サーバーです。このサーバーにより、LLM や AI エージェントは詳細な Web サイトのパフォーマンス評価、アクセシビリティ監査、SEO 分析、セキュリティチェック、Core Web Vitals のモニタリングを実行できます。
🌟 主な機能
🚀 パフォーマンス分析: Core Web Vitals、パフォーマンススコア、最適化の推奨事項を含む完全な Lighthouse 監査
♿ アクセシビリティ監査: WCAG 準拠チェックとアクセシビリティスコア分析
🔍 SEO 分析: 検索エンジン最適化の監査とベストプラクティスの推奨事項
🔒 セキュリティ評価: HTTPS、CSP、セキュリティ脆弱性のスキャン
📊 リソース分析: JavaScript、CSS、画像、フォントの最適化機会
📱 モバイル vs デスクトップ: スロットリングオプションを備えたデバイス間の比較分析
⚡ Core Web Vitals: しきい値チェックによる LCP、INP、CLS のモニタリング
🎯 パフォーマンスバジェット: カスタムパフォーマンスしきい値とバジェットモニタリング
🤖 エージェント型ブラウジング: ページが AI エージェントにどの程度対応しているかを評価する Lighthouse 13 監査(WebMCP ツール、エージェントアクセシビリティツリー、llms.txt)
🧩 構造化出力: すべてのツールが
outputSchemaを宣言し、検証済みのstructuredContentを返すため、クライアントは解析対象の JSON 文字列ではなく型付きデータを取得できます📚 参照リソース: Web パフォーマンス、アクセシビリティ、SEO、セキュリティに関する組み込みのガイドラインとベストプラクティス
Related MCP server: mcp-seo
🛠️ 必要条件
Node.js 22.0.0 以降
Chrome/Chromium ブラウザ(Lighthouse によって自動管理)
VS Code、Cursor、Windsurf、Claude Desktop、その他の MCP クライアント
🚀 はじめに
以下のいずれかの設定を使用して、お好みのクライアントで Lighthouse MCP サーバーをインストールします:
{
"mcpServers": {
"lighthouse": {
"command": "npx",
"args": ["@danielsogl/lighthouse-mcp@latest"]
}
}
}永続的な Chrome プロファイル(ログインセッション)
認証済みセッションが必要な場合は、永続的な Chrome プロファイルで起動し、ヘッド付きモードで実行します:
{
"mcpServers": {
"lighthouse": {
"command": "npx",
"args": [
"@danielsogl/lighthouse-mcp@latest",
"--profile-path",
"<profile-path>",
"--no-headless"
]
}
}
}--chrome-flag を使用して追加の Chrome フラグを渡すことができます。例: --chrome-flag=--disable-gpu。
フラグ値が -- で始まり、既知のオプション名と一致する場合は、トップレベルのオプションとして解析されるのを避けるため、--chrome-flag=... を使用することをお勧めします。
プロファイルモードでは Lighthouse のストレージリセットが無効になり、Cookie とローカルストレージが実行間で保持されます。
--user-data-dir が存在しないディレクトリを指している場合、そのディレクトリは作成され、新しいプロファイルとして扱われます。
--profile-path には chrome://version に表示されるプロファイルパス(例: .../Default)を設定します。
注: Chrome のリモートデバッグには非デフォルトのユーザーデータディレクトリが必要なため、システムデフォルトではなく専用のプロファイルディレクトリを再利用してください。
必要に応じて、--user-data-dir と --profile-directory を個別に渡すこともできます。
--chrome-port のみでの接続ではストレージは保持されません。セッションを維持するにはプロファイルフラグを含めてください。
CLI オプション
MCP サーバーでサポートされている実行時フラグ:
--profile-path <path>:chrome://versionのプロファイルパスを使用(ユーザーデータディレクトリとプロファイル名を自動的に導出)--user-data-dir <path>: 永続セッション用に Chrome プロファイルディレクトリを再利用--profile-directory <name>: ユーザーデータディレクトリ内のプロファイルを選択--chrome-path <path>: Chrome/Chromium 実行ファイルへの明示的なパス(自動検出を上書き。CHROME_PATH環境変数も尊重)--chrome-flag <flag>または--chrome-flag=<flag>: 追加の Chrome フラグを渡す(繰り返し可能)--chrome-port <port>または--remote-debugging-port <port>: リモートデバッグを有効にして起動された既存の Chrome インスタンスに接続--headless: ヘッドレスモードを強制--no-headless: ヘッド付きモードを強制
ロギング
Lighthouse は stderr にログを出力します。サーバーはこれを error に維持するため、MCP クライアントのログが氾濫することはありません。デバッグ時(Chrome の起動に失敗した場合など)は LIGHTHOUSE_LOG_LEVEL を silent、info、または verbose に設定してください。
LIGHTHOUSE_LOG_LEVEL=verbose npx @danielsogl/lighthouse-mcp@latestWSL2 / カスタム Chrome パス
誤った Chrome バイナリが選択された場合(例: WSL2 で Linux バイナリの代わりに Windows Chrome が選択された場合)、パスを明示的に設定します:
# Via CLI flag
npx @danielsogl/lighthouse-mcp@latest --chrome-path /usr/bin/google-chrome
# Via environment variable
CHROME_PATH=/usr/bin/google-chrome npx @danielsogl/lighthouse-mcp@latestMCP 設定内:
{
"mcpServers": {
"lighthouse": {
"command": "npx",
"args": ["@danielsogl/lighthouse-mcp@latest", "--chrome-path", "/usr/bin/google-chrome"]
}
}
}E2E スモークテスト(プロファイル)
永続的なプロファイルを使用して実際の監査を実行します(必要に応じて既存のプロファイルディレクトリを使用し、一度ログインします):
npm run smoke:profile -- --url https://example.com \
--profile-path "<profile-path>" \
--no-headlessE2E スモークテスト(既存の Chrome に接続)
リモートデバッグを有効にして Chrome を起動します:
/path/to/GoogleChromeExecutable \
--remote-debugging-port=9222 \
--user-data-dir /path/to/chrome-profile/path/to/GoogleChromeExecutable をお使いのプラットフォームの Chrome/Chromium バイナリパスに置き換えてください。
次に、Lighthouse をそのインスタンスに接続します:
npm run smoke:profile -- --url https://example.com --chrome-port 9222接続時にストレージを保持するには、プロファイルパスを渡して Lighthouse が Cookie/ローカルストレージを維持できるようにします:
npm run smoke:profile -- --url https://example.com \
--chrome-port 9222 \
--profile-path "<profile-path>"VS Code へのインストール
VS Code CLI を使用して Lighthouse MCP サーバーをインストールすることもできます:
# For VS Code
code --add-mcp '{"name":"lighthouse","command":"npx","args":["-y","@danielsogl/lighthouse-mcp@latest"]}'
# For VS Code Insiders
code-insiders --add-mcp '{"name":"lighthouse","command":"npx","args":["-y","@danielsogl/lighthouse-mcp@latest"]}'インストール後、Lighthouse MCP サーバーは VS Code の GitHub Copilot エージェントで使用できるようになります。
Cursor へのインストール
Cursor Settings → MCP → Add new MCP Server に移動します。名前を "lighthouse" にし、コマンド npx @danielsogl/lighthouse-mcp@latest で command タイプを使用します:
{
"mcpServers": {
"lighthouse": {
"command": "npx",
"args": ["@danielsogl/lighthouse-mcp@latest"]
}
}
}Windsurf へのインストール
Windsurf MCP のドキュメントに従ってください。次の設定を使用します:
{
"mcpServers": {
"lighthouse": {
"command": "npx",
"args": ["@danielsogl/lighthouse-mcp@latest"]
}
}
}Claude Desktop へのインストール
MCP インストールのガイドに従い、次の設定を使用します:
{
"mcpServers": {
"lighthouse": {
"command": "npx",
"args": ["@danielsogl/lighthouse-mcp@latest"]
}
}
}🔧 利用可能なツール
Lighthouse MCP サーバーは、包括的な Web 分析のための以下のツールを提供します:
🏁 監査ツール
ツール | 説明 | パラメータ |
| 包括的な Lighthouse 監査を実行 |
|
| アクセシビリティスコアと推奨事項を取得 |
|
| SEO 分析と推奨事項を取得 |
|
⚡ パフォーマンスツール
ツール | 説明 | パラメータ |
| 全体的なパフォーマンススコアを取得 |
|
| Core Web Vitals メトリクスを取得 |
|
| デバイス間のパフォーマンスを比較 |
|
| パフォーマンスバジェットをチェック |
|
| LCP 最適化の機会を見つける |
|
🔍 分析ツール
ツール | 説明 | パラメータ |
| 未使用の JavaScript コードを検出 |
|
| すべての Web サイトリソースを分析 |
|
🔒 セキュリティツール
ツール | 説明 | パラメータ |
| 包括的なセキュリティ監査を実行 |
|
💬 利用可能なプロンプト
Lighthouse MCP サーバーには、LLM が構造化された分析と推奨事項を提供するのに役立つ再利用可能なプロンプトが含まれています:
📊 分析プロンプト
プロンプト | 説明 | パラメータ |
| Lighthouse 監査結果を分析 |
|
| 監査前後の結果を比較 |
|
| Core Web Vitals 最適化の推奨事項を取得 |
|
| リソース最適化の推奨事項を取得 |
|
📚 利用可能なリソース
Lighthouse MCP サーバーは、重要なガイドラインとベストプラクティスを含む組み込みの参照リソースを提供します:
リソース | 説明 | URI |
| Core Web Vitals パフォーマンスしきい値 |
|
| パフォーマンス最適化テクニックとその影響 |
|
| WCAG 2.1 アクセシビリティガイドラインと問題点 |
|
| SEO ベストプラクティスと最適化の機会 |
|
| Web セキュリティのベストプラクティスと脆弱性 |
|
| サイトタイプ別のパフォーマンス予算の推奨事項 |
|
| Lighthouse 監査カテゴリとスコアリング方法 |
|
| フレームワーク別の最適化ガイド |
|
🎯 戦略プロンプト
プロンプト | 説明 | パラメータ |
| 包括的なパフォーマンス改善計画を生成 |
|
| カスタムパフォーマンス予算の推奨事項を作成 |
|
| SEO 改善の推奨事項を生成 |
|
| アクセシビリティ改善ガイドを作成 |
|
🔧 プロンプトパラメータの詳細
auditResults: Lighthouse ツールによる JSON 形式の監査結果focusArea: 焦点を当てる特定のカテゴリ("performance"、"accessibility"、"seo"、"best-practices"、"agentic-browsing")beforeAudit/afterAudit: 変更前後の Lighthouse 監査結果changesImplemented: 監査間で行われた変更の説明currentMetrics: 監査による現在のパフォーマンス指標targetGoals: 具体的なパフォーマンス目標またはビジネス目標timeframe: 改善を実装するための期間framework: フロントエンドフレームワークまたはテクノロジースタックconstraints: 技術的またはビジネス上の制約websiteType: Web サイトのタイプ(例:e コマース、ブログ、コーポレートサイト)targetAudience: ターゲットオーディエンスまたは市場情報complianceLevel: WCAG 準拠レベル("AA"または"AAA")userGroups: アクセシビリティで考慮すべき特定のユーザーグループ
📋 パラメータの詳細
共通パラメータ
url(必須): 分析する Web サイトの URLdevice: ターゲットデバイス("desktop"または"mobile"、デフォルト:"desktop")includeDetails: 詳細な監査情報を含める(デフォルト:false)throttling: ネットワーク/CPU スロットリングを有効にする(デフォルト:false)
固有パラメータ
categories: 監査する Lighthouse カテゴリ(["performance", "accessibility", "best-practices", "seo", "agentic-browsing"])threshold: 指標のカスタムしきい値(例:{"lcp": 2.5, "inp": 200, "cls": 0.1})budget: パフォーマンス予算の上限(例:{"performanceScore": 90, "largestContentfulPaint": 2500})resourceTypes: 分析するリソースタイプ(["images", "javascript", "css", "fonts", "other"])minBytes: 分析の最小ファイルサイズしきい値(デフォルト:2048)checks: 実行するセキュリティチェック(["https", "csp", "hsts", "origin-isolation", "clickjacking", "trusted-types", "third-party-cookies", "deprecations"])
💡 使用例
基本パフォーマンス監査
// Get overall performance score
{
"tool": "get_performance_score",
"arguments": {
"url": "https://example.com",
"device": "mobile"
}
}Core Web Vitals 分析
// Check Core Web Vitals with custom thresholds
{
"tool": "get_core_web_vitals",
"arguments": {
"url": "https://example.com",
"device": "mobile",
"includeDetails": true,
"threshold": {
"lcp": 2.5,
"inp": 200,
"cls": 0.1
}
}
}セキュリティ評価
// Comprehensive security audit
{
"tool": "get_security_audit",
"arguments": {
"url": "https://example.com",
"checks": ["https", "csp", "hsts"]
}
}リソース最適化
// Find optimization opportunities
{
"tool": "analyze_resources",
"arguments": {
"url": "https://example.com",
"resourceTypes": ["images", "javascript"],
"minSize": 1024
}
}参照リソースの使用
組み込みのガイドラインとベストプラクティスにアクセス:
// Get Core Web Vitals thresholds
{
"resource": {
"uri": "lighthouse://performance/core-web-vitals-thresholds"
}
}
// Access WCAG accessibility guidelines
{
"resource": {
"uri": "lighthouse://accessibility/wcag-guidelines"
}
}
// Get framework-specific optimization guides
{
"resource": {
"uri": "lighthouse://frameworks/optimization-guides"
}
}分析のためのプロンプトの使用
// Analyze audit results with focused recommendations
{
"prompt": "analyze-audit-results",
"arguments": {
"auditResults": "{...lighthouse audit json...}",
"focusArea": "performance"
}
}
// Create a performance improvement plan
{
"prompt": "create-performance-plan",
"arguments": {
"currentMetrics": "{...current performance metrics...}",
"targetGoals": "Achieve 90+ performance score and sub-2s LCP",
"timeframe": "3 months"
}
}
// Compare before/after audit results
{
"prompt": "compare-audits",
"arguments": {
"beforeAudit": "{...before audit results...}",
"afterAudit": "{...after audit results...}",
"changesImplemented": "Implemented lazy loading and image optimization"
}
}🎯 ユースケース
パフォーマンスモニタリング: 自動パフォーマンス追跡と Core Web Vitals モニタリング
アクセシビリティ準拠: WCAG 2.1 準拠チェックと是正ガイダンス
SEO 最適化: 技術的 SEO 監査と検索エンジン最適化の推奨事項
セキュリティ評価: 脆弱性スキャンとセキュリティベストプラクティスの検証
リソース最適化: バンドル分析と最適化機会の特定
パフォーマンス予算: 自動パフォーマンス予算モニタリングとアラート
CI/CD 統合: 自動品質ゲートとパフォーマンス回帰検出
🏗️ アーキテクチャ
サーバーは以下を使用して構築されています:
Model Context Protocol SDK: MCP サーバー実装用
Google Lighthouse: Web パフォーマンス監査用
Chrome Launcher: ブラウザ自動操作用
TypeScript: 型安全性と開発者体験の向上のため
Zod: ランタイムスキーマ検証用
🧪 テスト
npm run test:run # unit tests
npm run test:coverage # unit tests with coverage
npm run test:e2e # end-to-end testsエンドツーエンドスイートは、サーバーをビルドし、実際の MCP クライアントで stdio 経由で起動し、ループバック上で提供されるフィクスチャページに対して実際の Lighthouse 監査を実行します。Chrome がインストールされている必要があります。標準以外の場所にある場合は CHROME_PATH を設定してください。
🤝 コントリビューション
コントリビューションを歓迎します!詳細については、コントリビューションガイド をお読みください:
コードスタイルと標準
テスト要件
プルリクエストプロセス
開発環境のセットアップ
📜 ライセンス
このプロジェクトは MIT ライセンスの下でライセンスされています。詳細は LICENSE ファイルを参照してください。
🔒 セキュリティ
セキュリティ問題については、セキュリティポリシー を参照してください。
📞 サポート
🐛 バグ報告: GitHub Issues
💬 ディスカッション: GitHub Discussions
📧 メール: security@codingrules.ai
🙏 謝辞
優れた監査エンジンを提供してくれた Google Lighthouse チーム
Model Context Protocol 仕様を策定した Anthropic
絶え間ないインスピレーションとコントリビューションを提供してくれるオープンソースコミュニティ
❤️ を込めて Daniel Sogl が作成
Available Tools
11 toolsanalyze_resourcesAnalyze Page ResourcesARead-only
Analyze website resources (images, JS, CSS, fonts) for optimization opportunities
Inputs: url (required), device, minSize, resourceTypes. Returns: url, device, filters, summary, +3 more
check_performance_budgetCheck Performance BudgetBRead-only
Check if website performance meets specified budget thresholds
Inputs: url (required), budget (required), device. Returns: data, summary, recommendations
compare_mobile_desktopCompare Mobile vs DesktopARead-only
Compare website performance between mobile and desktop devices
Inputs: url (required), categories, throttling, includeDetails. Returns: data, summary, recommendations
find_unused_javascriptFind Unused JavaScriptBRead-only
Find unused JavaScript code to reduce bundle size
Inputs: url (required), device, minBytes. Returns: url, device, summary, timestamp, +3 more
get_accessibility_scoreGet Accessibility ScoreBRead-only
Get the accessibility score and recommendations for a website
Inputs: url (required), device, includeDetails. Returns: data, summary, recommendations
get_core_web_vitalsGet Core Web VitalsARead-only
Get Core Web Vitals metrics for a website
Inputs: url (required), device, threshold, includeDetails. Returns: data, summary, recommendations
get_lcp_opportunitiesGet LCP OpportunitiesBRead-only
Get LCP optimization opportunities for a website
Inputs: url (required), device, threshold, includeDetails. Returns: data, summary, recommendations
get_performance_scoreGet Performance ScoreCRead-only
Get the performance score for a website
Inputs: url (required), device. Returns: data, summary, recommendations
get_security_auditGet Security AuditARead-only
Perform security audit checking HTTPS, CSP, and other security measures
Inputs: url (required), checks, device. Returns: data, summary, recommendations
get_seo_analysisGet SEO AnalysisCRead-only
Get SEO analysis and recommendations for a website
Inputs: url (required), device, includeDetails. Returns: data, summary, recommendations
run_auditRun Lighthouse AuditBRead-only
Run a comprehensive Lighthouse audit on a website
Inputs: url (required), device, categories, throttling. Returns: data, summary, recommendations
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 11 tools
There is significant overlap between run_audit and the specific getter tools (accessibility, SEO, performance), as run_audit likely encompasses all of those. Additionally, get_lcp_opportunities, find_unused_javascript, and analyze_resources all target performance optimization with unclear boundaries.
Most tools follow a clear verb_noun pattern (e.g., get_*, run_audit, compare_mobile_desktop, check_performance_budget). Minor deviations include run_audit vs. get_security_audit (both use 'audit' but different verbs) and find_unused_javascript/analyze_resources not using 'get_' prefix, but the overall convention is consistent.
With 11 tools, the set is well-scoped for a website auditing server. Each tool covers a distinct aspect of Lighthouse auditing (performance, SEO, accessibility, security, resources), and the count is within the ideal 3-15 range without feeling bloated.
The tool surface covers major Lighthouse categories (performance, accessibility, SEO, security, Core Web Vitals, resources) and includes useful extras like budget checks and mobile/desktop comparison. However, it lacks explicit best practices and PWA audits, which are standard Lighthouse categories, creating minor gaps.
Maintenance
Related MCP Connectors
Free MCP server that audits any public URL: technical SEO, Core Web Vitals, indexing checks.
MCP server for building and testing AI agents with multi-model experimentation and insights.
Website QA for your coding agent: audit SEO, performance, security, accessibility over MCP.
Your agent needs to crawl a site and say what is wrong with it — broken tags, duplicate content, pages nothing can index, resources that never load. **What you can ask for** • "Crawl this site and list every page with a duplicate title or missing description." • "Which pages are non-indexable, and why?" • "Run Lighthouse on these URLs and give me the failing audits." • "Show the internal link graph and the orphan pages." • "Give me this page's raw HTML and its microdata." **How to use it** Point any MCP client at https://mcp.aisa.one/seo-onpage/mcp and sign in with OAuth — there is no key to create or paste. 20 tools: submit a crawl and read its summary, pages, resources, links and waterfall; duplicate content and duplicate tags; keyword density; non-indexable and uncrawlable resources; parsed content, raw HTML, microdata, screenshots and Lighthouse. **Why this rather than the source** A crawler you drive from the agent, with the audit results as structured data rather than a PDF. **It is also a door to the rest** The same login reaches 26 sources and 580+ operations. Find the broken pages here, then ask the same agent what those pages used to rank for — without adding a second server. **What it costs** Finding and inspecting an operation is free. Running one is billed per call at API prices, with no seat and no monthly minimum, and every call takes max_price_usd so an agent cannot overspend by accident. **Where else it reaches** https://mcp.aisa.one/seo/mcp for all of it at once — rankings, keywords, backlinks, site health and AI-answer visibility across DataForSEO, Semrush and Ahrefs.
Related MCP Servers
- AlicenseAqualityDmaintenanceA comprehensive MCP server providing 15 web tools including search, scraping, screenshots, SEO audits, and DNS/SSL checks through a single installation. It delivers clean, LLM-optimized outputs so AI agents can focus on reasoning rather than parsing raw HTML.156 npmMIT
- AlicenseAqualityDmaintenanceEnables AI agents to perform comprehensive SEO audits on web pages, including meta tags, headings, links, images, performance, and more, via a CLI or MCP server.182MIT
- AlicenseNot gradedqualityDmaintenanceA comprehensive MCP server for SEO, performance, GEO, and UX audits with 37 tools covering technical SEO, Lighthouse performance, AI search optimization, content analysis, accessibility, security, and more.1MIT
- AlicenseAqualityDmaintenanceAn MCP server that audits websites for accessibility (WCAG 2.1 AA/EAA), performance, SEO, design quality, and mobile responsiveness, providing actionable scores, grades, and prioritized fixes.6MIT