mcpField
A
axiom-xcode-mcp-ref

axiom-xcode-mcp-ref

github.com/charleswiltgen開発1.2k119 回インストール今日更新
リポジトリ

axiom-xcode-mcp-ref について

XcodeのMCPサーバーのツールを使う開発者向けのリファレンススキルです。各ツールの引数と戻り値を記載し、多くのツールの使用前にXcodeウィンドウを一覧する必要があることを示します。

主な機能

  1. 01Xcode MCPツールのリファレンス
  2. 02引数と戻り値の説明
  3. 03ファイルとプロジェクトの操作
  4. 04ビルド、テスト、問題の診断
  5. 05コード実行とプレビュー描画
  6. 06Xcodeウィンドウの確認案内

活用シーン

  1. 01Xcodeツール呼び出し前の引数確認
  2. 02プロジェクトファイルの読み取りや編集
  3. 03プロジェクトのビルドとテスト実行
  4. 04問題の確認やSwiftUIプレビューの描画

MCP 対応

XcodeのMCPサーバーが公開するツールの引数と戻り値を説明します。多くのツールでtabIdentifierが必要なため、先にXcodeListWindowsを呼び出して値を取得するよう案内します。

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/charleswiltgen/axiom --skill axiom-xcode-mcp-ref

インストール後、Claude Code で/axiom-xcode-mcp-refを入力して読み込まれたか確認します。

詳細

Xcode MCP ツールリファレンス

Xcode の MCP サーバー(xcrun mcpbridge)が公開する全 20 個のツールの完全なリファレンスです。

出典:Xcode 26.3 の tools/list レスポンス。Keith Smiley の gist(2025-07-15)と照合済みです。

重要:20 個のツールのうち 18 個で tabIdentifier が必須です。必ず最初に XcodeListWindows を呼び出してください。

検出

XcodeListWindows

開いている Xcode ウィンドウを返します。tabIdentifier の値を取得するため、最初にこれを呼び出してください。

  • パラメーター:なし
  • 戻り値:{ message: string } — 開いているウィンドウの説明
  • 注記:tabIdentifier を必要としない唯一のツールです。

ファイル操作

XcodeRead

ファイルの内容を読み取ります(cat -n 形式、デフォルトで 600 行)。

  • パラメーター:
    • tabIdentifier(string、必須)
    • filePath(string、必須)— プロジェクト相対パスまたは絶対パス
    • limit(integer、任意)— 返す最大行数
    • offset(integer、任意)— 開始行番号
  • 戻り値:{ content, filePath, fileSize, linesRead, startLine, totalLines }
XcodeWrite

ファイルを作成または上書きします。新しいファイルは自動的にプロジェクト構造に追加されます。

  • パラメーター:
    • tabIdentifier(string、必須)
    • filePath(string、必須)
    • content(string、必須)
  • 戻り値:{ success, filePath, absolutePath, bytesWritten, linesWritten, wasExistingFile, message }
XcodeUpdate

テキスト置換で既存ファイルを編集します。

  • パラメーター:
    • tabIdentifier(string、必須)
    • filePath(string、必須)
    • oldString(string、必須)— 検索するテキスト
    • newString(string、必須)— 置換後のテキスト
    • replaceAll(boolean、任意、デフォルトは false)— すべての出現箇所を置換
  • 戻り値:{ filePath, editsApplied, success, originalContentLength, modifiedContentLength, message }
  • 注記:デフォルトでは 1 か所のみ置換します。replaceAll が true でない限り、各 oldString は一意である必要があります。既存ファイルの編集には XcodeWrite よりこちらを優先してください。
XcodeGlob

ワイルドカードパターンに一致するファイルを検索します。

  • パラメーター:
    • tabIdentifier(string、必須)
    • pattern(string、任意、デフォルトは **/*)— glob パターン
    • path(string、任意)— 検索対象のディレクトリ
  • 戻り値:{ matches[], pattern, searchPath, truncated, totalFound, message }
XcodeGrep

正規表現でファイルの内容を検索します。

  • パラメーター:
    • tabIdentifier(string、必須)
    • pattern(string、必須)— 正規表現パターン
    • glob(string、任意)— ファイルパターンフィルター
    • path(string、任意)— ディレクトリの範囲
    • type(string、任意)— ファイルタイプフィルター
    • ignoreCase(boolean、任意)
    • multiline(boolean、任意)
    • outputMode(enum、任意)— content、filesWithMatches、count
    • linesContext(integer、任意)— 前後のコンテキスト行数
    • linesBefore(integer、任意)
    • linesAfter(integer、任意)
    • headLimit(integer、任意)— 結果の最大数
    • showLineNumbers(boolean、任意)
  • 戻り値:{ results[], pattern, searchPath, matchCount, truncated, message }
  • 注記:ripgrep のインターフェースを踏襲しています。outputMode で結果の形式を指定します。
XcodeLS

ディレクトリの内容を一覧表示します。

  • パラメーター:
    • tabIdentifier(string、必須)
    • path(string、必須)
    • recursive(boolean、任意、デフォルトは true)
    • ignore(文字列の配列、任意)— 除外するパターン
  • 戻り値:{ items[], path }
XcodeMakeDir

プロジェクト内にディレクトリを作成します。

  • パラメーター:
    • tabIdentifier(string、必須)
    • directoryPath(string、必須)
  • 戻り値:{ success, message, createdPath }
XcodeRM

プロジェクトからファイルまたはディレクトリを削除します。デフォルトではゴミ箱を使用します。

  • パラメーター:
    • tabIdentifier(string、必須)
    • path(string、必須)
    • deleteFiles(boolean、任意、デフォルトは true)— ゴミ箱に移動
    • recursive(boolean、任意)
  • 戻り値:{ removedPath, success, message }
XcodeMV

ファイルを移動またはコピーします。

  • パラメーター:
    • tabIdentifier(string、必須)
    • sourcePath(string、必須)
    • destinationPath(string、必須)
    • operation(enum、任意)— move または copy
    • overwriteExisting(boolean、任意)
  • 戻り値: { success, operation, message, sourceOriginalPath, destinationFinalPath }
  • 注記: 移動だけでなく、コピーもできます。インポートが壊れる可能性があるため、ユーザーに確認してください。

ビルドとテスト

BuildProject

プロジェクトをビルドし、完了まで待機します。

  • パラメーター:
    • tabIdentifier(string、必須)
  • 戻り値: { buildResult, elapsedTime, errors[] }
  • 注記: 各エラーには classification、filePath、lineNumber、message が含まれます。
GetBuildLog

必要に応じてフィルタリングし、ビルドログを取得します。

  • パラメーター:
    • tabIdentifier(string、必須)
    • severity(enum、任意)— remark、warning、error
    • pattern(string、任意)— 正規表現フィルター
    • glob(string、任意)— ファイルパターンフィルター
  • 戻り値: { buildIsRunning, buildLogEntries[], buildResult, fullLogPath, truncated, totalFound }
  • 注記: 生テキストではなく、構造化されたエントリーを返します。各エントリーには buildTask と emittedIssues[] が含まれます。
RunAllTests

アクティブなスキームのテストプランから、テストスイート全体を実行します。

  • パラメーター:
    • tabIdentifier(string、必須)
  • 戻り値: { summary, counts, results[], schemeName, activeTestPlanName }
  • 注記: counts には total、passed、failed、skipped、expectedFailures、notRun が含まれます。各結果には targetName、identifier、displayName、state が含まれます。
RunSomeTests

識別子を指定して、特定のテストを実行します。

  • パラメーター:
    • tabIdentifier(string、必須)
    • tests(array、必須)— 各要素: { targetName: string, testIdentifier: string }
  • 戻り値: RunAllTestsと同じ形式
  • 注記: 有効なテスト識別子を確認するには、GetTestList を使用してください。
GetTestList

アクティブなテストプランで利用可能なテストを一覧表示します。

  • パラメーター:
    • tabIdentifier(string、必須)
  • 戻り値: { tests[], schemeName, activeTestPlanName }
  • 注記: 各テストには targetName、identifier、displayName、isEnabled、filePath、lineNumber、tags[] が含まれます。

診断

XcodeListNavigatorIssues

XcodeのIssue Navigatorから問題を取得します。

  • パラメーター:
    • tabIdentifier(string、必須)
    • severity(enum、任意)— remark、warning、error
    • pattern(string、任意)— 正規表現フィルター
    • glob(string、任意)— ファイルパターンフィルター
  • 戻り値: { issues[], truncated, totalFound, message }
  • 注記: 各問題には message、severity、path、line、category、vitality(fresh/stale)が含まれます。構造化され、重複は除去されています。
XcodeRefreshCodeIssuesInFile

特定のファイルの診断情報を更新します。

  • パラメーター:
    • tabIdentifier(string、必須)
    • filePath(string、必須)
  • 戻り値: { filePath, diagnosticsCount, content, success }
  • 注記: Xcodeにファイルを再解析させます。

実行とレンダリング

ExecuteSnippet

ソースファイルのコンテキストでコードスニペットをビルドして実行します。

  • パラメーター:
    • tabIdentifier(string、必須)
    • codeSnippet(string、必須)— 実行するコード
    • sourceFilePath(string、必須)— スニペットを実行するコンテキストとなるSwiftファイル(そのファイルの fileprivate 宣言にアクセスできます)
    • timeout(integer、任意、デフォルトは120)— 秒数
  • 戻り値: { executionResults } — print文のコンソール出力
  • 注記: 汎用REPLではありません。特定のファイルのコンテキストで実行します。language パラメーターはなく、Swiftのみです。
RenderPreview

SwiftUI のプレビューのスナップショットをレンダリングします。

  • パラメーター:
    • tabIdentifier(string、必須)
    • sourceFilePath(string、必須)— #Preview を含む Swift ファイル
    • previewDefinitionIndexInFile(integer、任意、デフォルト 0)— レンダリングする #Preview のファイル内インデックス(0 始まり)
    • timeout(integer、任意、デフォルト 120)
  • 戻り値:{ previewSnapshotPath } — レンダリングされた画像のパス
  • 注記:名前ではなくインデックスで指定します。ファイル内の最初の #Preview のインデックスは 0 です。

検索

DocumentationSearch

Apple Developer Documentation を意味的に検索します。

  • パラメーター:
    • query(string、必須)
    • frameworks(文字列の配列、任意)— 特定のフレームワークに範囲を限定します
  • 戻り値:{ documents[] } — 各項目に title、uri、contents、score を含みます
  • 注記:ローカルのセマンティック検索(MLX による高速化)であり、ウェブ検索ではありません。

クイックリファレンス

カテゴリーツール
検出XcodeListWindows
ファイルの読み取りXcodeRead、XcodeGlob、XcodeGrep、XcodeLS
ファイルの書き込みXcodeWrite、XcodeUpdate、XcodeMakeDir
ファイルの破壊的操作XcodeRM、XcodeMV
ビルドBuildProject、GetBuildLog
テストRunAllTests、RunSomeTests、GetTestList
診断XcodeListNavigatorIssues、XcodeRefreshCodeIssuesInFile
実行ExecuteSnippet
プレビューRenderPreview
検索DocumentationSearch

共通のパラメーターパターン

  • tabIdentifier — 20 個中 18 個のツールで必須です。必ず最初に XcodeListWindows を呼び出してください。
  • filePath — XcodeRead、XcodeWrite、XcodeUpdate、XcodeRefreshCodeIssuesInFile で使用します。プロジェクト相対パスまたは絶対パスです。
  • path — XcodeLS、XcodeRM、XcodeGlob で使用します。ディレクトリのパスです。
  • directoryPath — XcodeMakeDir で使用します。
  • sourceFilePath — ExecuteSnippet、RenderPreview で使用します。Swift ソースファイルを指定してください。

リソース

スキル:axiom-xcode-mcp-setup、axiom-xcode-mcp-tools

コメント