Closed4
Google Cloud Run MCPを試す

事前準備
npakaさんの記事が参考になりました。

MCPの登録
Cursorの場合は以下のように登録
{
"mcpServers": {
"cloud-run": {
"command": "npx",
"args": ["-y", "https://github.com/GoogleCloudPlatform/cloud-run-mcp"]
}
}
}

APIエラー対応
この状態で実行すると以下のエラーが発生。
Error deploying to Cloud Run: Failed to ensure API [iam.googleapis.com] is enabled. Please check manually.
ChatGPTに聞いて以下の有効化を実施
Service Usage API
gcloud services enable serviceusage.googleapis.com --project=YOUR_PROJECT_ID
IAM API
gcloud services enable iam.googleapis.com --project=YOUR_PROJECT_ID
その他の有効化
- run.googleapis.com (Cloud Run Admin API)
- cloudresourcemanager.googleapis.com (Cloud Resource Manager API)
- cloudbuild.googleapis.com (Cloud Build API)
gcloud services enable run.googleapis.com cloudresourcemanager.googleapis.com cloudbuild.googleapis.com --project=YOUR_PROJECT_ID

デプロイ
Cloud RunへのデプロイをCursorくんにお願いすると、MCPを実行してくれます。
何も言わないと、変なフォルダパス (e.g. "/c%3A/Users/<username>/<folder_path>"
) を指定されることがあるので、Windows上で実行している方はパスの形式も指定するほうが良いかも。
このスクラップは3ヶ月前にクローズされました