logcat-mcp
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
logcat-mcp
Android Studio が出力する JSON 形式の logcat ファイルを解析・フィルタリング・検索するための MCP サーバーです。
LLM がログファイルを効率的に分析し、デバッグ支援を行えるようにすることを目的としています。巨大なログファイル (数MB~) を直接 LLM に渡すのではなく、サーバー側でフィルタ・集計した結果のみを返します。
セットアップ
必要環境
Python 3.10+
インストール
git clone <repository-url>
cd logcat-mcp
uv syncログファイルの配置
~/logcat-mcp/ ディレクトリに .logcat ファイルを配置してください。
mkdir -p ~/logcat-mcp
cp /path/to/your/exported.logcat ~/logcat-mcp/Android Studio からの logcat エクスポート: Logcat ウィンドウ > 右クリック > Export to Text File で JSON 形式を選択
Related MCP server: Log MCP Server
MCP クライアントへの設定
Claude Desktop
claude_desktop_config.json に以下を追加:
{
"mcpServers": {
"logcat-mcp": {
"command": "uv",
"args": [
"--directory", "/path/to/logcat-mcp",
"run", "python", "-m", "logcat_mcp.server"
]
}
}
}Claude Code
.mcp.json に以下を追加:
{
"mcpServers": {
"logcat-mcp": {
"command": "uv",
"args": [
"--directory", "/path/to/logcat-mcp",
"run", "python", "-m", "logcat_mcp.server"
]
}
}
}/path/to/logcat-mcp は実際のクローン先パスに置き換えてください。
Tools
logcat_list_files
~/logcat-mcp/ 内の .logcat ファイル一覧を取得します。ファイル名、サイズ、更新日時を返します。
logcat_read
ログファイルを読み込み、フィルタを適用してエントリを返します。
パラメータ | 型 | 必須 | 説明 |
| string | Yes | ファイル名 |
| string | No | 最低ログレベル ( |
| string | No | タグ名 (部分一致) |
| int | No | プロセス ID |
| string | No | アプリケーション ID (部分一致) |
| string | No | 開始時刻 (ISO 8601) |
| string | No | 終了時刻 (ISO 8601) |
| int | No | 上限数 (default: 50, max: 200) |
| int | No | オフセット (default: 0) |
logcat_search
ログメッセージを正規表現で検索します。
パラメータ | 型 | 必須 | 説明 |
| string | Yes | ファイル名 |
| string | Yes | 検索パターン (正規表現、大文字小文字区別なし) |
| string | No | 最低ログレベル |
| string | No | タグ名 (部分一致) |
| string | No | アプリケーション ID (部分一致) |
| string | No | 開始時刻 (ISO 8601) |
| string | No | 終了時刻 (ISO 8601) |
| int | No | 上限数 (default: 30, max: 100) |
logcat_summary
ログファイル全体の統計サマリーを返します。ログレベル別件数、頻出タグ TOP 10、頻出 applicationId、時間範囲、エラー件数、デバイス情報を含みます。
パラメータ | 型 | 必須 | 説明 |
| string | Yes | ファイル名 |
logcat_errors
ERROR レベルのログとスタックトレースを抽出します。
パラメータ | 型 | 必須 | 説明 |
| string | Yes | ファイル名 |
| string | No | タグ名 (部分一致) |
| string | No | アプリケーション ID (部分一致) |
| int | No | 上限数 (default: 30, max: 100) |
Resources
logcat://files
~/logcat-mcp/ 内の利用可能なファイル一覧とメタデータを JSON で返します。
Prompts
analyze-crash
クラッシュ解析プロンプト。ERROR ログとスタックトレースを抽出し、根本原因の分析を行うワークフローを生成します。
debug-performance
パフォーマンスデバッグプロンプト。特定アプリのログサマリーと警告/エラーを抽出し、ボトルネック分析を行うワークフローを生成します。
推奨ワークフロー
logcat_list_filesでファイル一覧を確認logcat_summaryでファイルの概要を把握目的に応じて以下を使い分け:
エラー調査:
logcat_errorsでスタックトレースを確認キーワード検索:
logcat_searchで正規表現検索ログ閲覧:
logcat_readでフィルタ付きページネーション
開発
MCP Inspector でテスト
uv run mcp dev src/logcat_mcp/server.py対応するログファイル形式
Android Studio が出力する JSON 形式の .logcat ファイルに対応しています。
{
"metadata": {
"device": { ... },
"filter": "package:mine",
"projectApplicationIds": ["com.example.app"]
},
"logcatMessages": [
{
"header": {
"logLevel": "ERROR",
"pid": 1000,
"tid": 1001,
"applicationId": "com.example.app",
"processName": "com.example.app",
"tag": "CrashHandler",
"timestamp": { "seconds": 1766305183, "nanos": 400000000 }
},
"message": "java.lang.NullPointerException: ..."
}
]
}セキュリティ
ファイルアクセスは
~/logcat-mcp/ディレクトリ内に限定 (..によるパストラバーサル防止)filenameパラメータは相対パスのみ受け付け、resolve 後にベースディレクトリ内であることを検証すべてのツールは読み取り専用 (
readOnlyHint=True)
ライセンス
MIT License - 詳細は LICENSE を参照してください。
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Cloud Android devices for AI agents: install an APK, read the screen, tap, type, read logcat.
Ingest and search LogsLoom logs from coding agents.
Production runtime data for Android and KMP apps (startup, ANRs, slow screens) for coding agents
Give your AI agent a real cloud Android phone: push APKs, drive it, get screenshots and logs.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables monitoring and analysis of local application log files with real-time tailing, error tracking, and search capabilities. Perfect for debugging Node.js applications, web servers, or any application that writes to log files through natural language commands.65MIT
- AlicenseAqualityDmaintenanceEnables AI assistants to automatically inspect and analyze application runtime log files for debugging and troubleshooting. Supports monitoring multiple log directories simultaneously with tools for listing, reading, searching, and paginating through log files.8MIT
- AlicenseNot gradedqualityFmaintenanceEnables LLMs to analyze logs by extracting patterns, redacting secrets, and providing token-efficient summaries from files, Docker containers, or journald.5MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to read and analyze Linux system logs—including systemd journal, syslog, kernel, application, and Docker container logs—for diagnostics and predictive analysis.MIT