From a4f2a0f61da8da5ae86e8fff34cd747a8bb26339 Mon Sep 17 00:00:00 2001 From: Haroon Chaudhry Date: Sun, 15 Mar 2026 13:52:35 -0400 Subject: [PATCH] Rename MCP tools for compatibility with Antigravity --- README.md | 28 ++++++------ commands/devops/deploy.toml | 10 ++--- devops-mcp-server/REFERENCE.md | 28 ++++++------ .../artifactregistry/artifactregistry.go | 2 +- devops-mcp-server/bm25/bm25.go | 4 +- devops-mcp-server/cloudbuild/cloudbuild.go | 12 ++--- devops-mcp-server/cloudrun/cloudrun.go | 6 +-- .../cloudstorage/cloudstorage.go | 4 +- devops-mcp-server/devconnect/devconnect.go | 4 +- devops-mcp-server/integration_tests/main.go | 44 +++++++++---------- devops-mcp-server/osv/osv.go | 2 +- devops-mcp-server/prompts/deploy_prompt.md | 10 ++--- skills/gcp-cicd-deploy/SKILL.md | 10 ++--- 13 files changed, 82 insertions(+), 82 deletions(-) diff --git a/README.md b/README.md index f6e0bdd..2f07adb 100644 --- a/README.md +++ b/README.md @@ -90,24 +90,24 @@ The goal is to produce a functional, production-ready CI/CD pipeline configurati The extension exposes the following tools to Gemini CLI, enabling interaction with Google Cloud services: #### CI/CD Service Tools -* `artifactregistry.setup_repository`: Creates a new Artifact Registry repository. Optionally grants Artifact Registry Writer permissions to a specified service account. -* `cloudbuild.create_trigger`: Creates a new Cloud Build trigger. -* `cloudbuild.list_triggers`: Lists all Cloud Build triggers in a given project and location. -* `cloudbuild.run_trigger`: Manually runs an existing Cloud Build trigger. -* `devconnect.add_git_repo_link`: Creates a Developer Connect Git repository link under an existing connection. -* `devconnect.setup_connection`: Sets up a new Developer Connect connection (e.g., to GitHub). +* `create_artifact_repository`: Creates a new Artifact Registry repository. Optionally grants Artifact Registry Writer permissions to a specified service account. +* `create_build_trigger`: Creates a new Cloud Build trigger. +* `list_build_triggers`: Lists all Cloud Build triggers in a given project and location. +* `run_build_trigger`: Manually runs an existing Cloud Build trigger. +* `create_git_repository_link`: Creates a Developer Connect Git repository link under an existing connection. +* `create_git_connection`: Sets up a new Developer Connect connection (e.g., to GitHub). #### Deployment Tools -* `cloudrun.deploy_to_cloud_run_from_image`: Deploys a container image to Cloud Run, creating a new service or updating an existing one. -* `cloudrun.deploy_to_cloud_run_from_source`: Deploys to Cloud Run directly from source code, typically using Cloud Build and BuildPacks. -* `cloudrun.list_services`: Lists Cloud Run services in a specified project and location. -* `cloudstorage.list_buckets`: Lists Cloud Storage buckets in a specified project. -* `cloudstorage.upload_source`: Uploads files from the local workspace to a GCS bucket. Can create a new public bucket if specified. -* `osv.scan_secrets`: Scans a specified directory for potential secrets and keys using OSV-Scanner. +* `deploy_cloudrun_service_from_image`: Deploys a container image to Cloud Run, creating a new service or updating an existing one. +* `deploy_cloudrun_service_from_source`: Deploys to Cloud Run directly from source code, typically using Cloud Build and BuildPacks. +* `list_cloudrun_services`: Lists Cloud Run services in a specified project and location. +* `list_storage_buckets`: Lists Cloud Storage buckets in a specified project. +* `upload_storage_object`: Uploads files from the local workspace to a GCS bucket. Can create a new public bucket if specified. +* `scan_code_for_secrets`: Scans a specified directory for potential secrets and keys using OSV-Scanner. #### Knowledge Retrieval Tools -* `bm25.query_knowledge`: Retrieves relevant snippets from the extension's knowledge base to answer questions. -* `bm25.search_common_cicd_patterns`: Finds common CI/CD pipeline patterns and best practices. +* `search_knowledge_base`: Retrieves relevant snippets from the extension's knowledge base to answer questions. +* `search_cicd_patterns`: Finds common CI/CD pipeline patterns and best practices. ## 📚 Resources diff --git a/commands/devops/deploy.toml b/commands/devops/deploy.toml index b169fa1..e0a0de9 100644 --- a/commands/devops/deploy.toml +++ b/commands/devops/deploy.toml @@ -34,7 +34,7 @@ Your job is to deploy the users application to a Google Cloud Storage bucket. 1. **Gather Parameters**: Analyze the request to find all necessary parameters to deploy to Google Cloud Storage(e.g., `project_ID: "my-project"`). 2. **Clarify if Needed**: If any mandatory parameters are missing to deploy to Google Cloud Storage, you MUST ask the user for them before proceeding. Do not guess or make assumptions. -3. **Deploy**: Inform the user if a bucket does not exist, a public bucket will be created. Deploy the users application to Google Cloud Storage using the `cloudstorage.upload_source` tool and return the URL of the deployed application. +3. **Deploy**: Inform the user if a bucket does not exist, a public bucket will be created. Deploy the users application to Google Cloud Storage using the `upload_storage_object` tool and return the URL of the deployed application. ## Workflow B: Google Cloud Run With Buildpacks @@ -47,7 +47,7 @@ Your job is to deploy the user's applications to Cloud Run using buildpacks. 2. **Create DockerFile if not supported by buildpacks**: If the users application is not supported by buildpacks, as found in step 1, look up how to build a Dockerfile. Then create a multistage Dockerfile to containerize the application. Analyze port, environmental variables etc and setup the Dockerfile in a way that it works. After that, ensure the Dockerfile can be built locally using the Docker cli. 3. **Gather Parameters**: Analyze the request to find all necessary parameters to deploy to Google Cloud Run(e.g., `repo_name: "my-app-images"`). 4. **Clarify if Needed**: If any mandatory parameters are missing to deploy to Google Cloud Run, you MUST ask the user for them before proceeding. Do not guess or make assumptions. Ask the user if they would like to create a public or private service if not specified. -5. **Deploy**: Deploy the users application to Google Cloud Run using the `cloudrun.deploy_to_cloud_run_from_source` tool and return the URL of the deployed application. +5. **Deploy**: Deploy the users application to Google Cloud Run using the `deploy_cloudrun_service_from_source` tool and return the URL of the deployed application. ## Workflow C: Google Cloud Run From Image @@ -57,18 +57,18 @@ Your job is to deploy the user's applications to Cloud Run from an image. 1. **Create Dockerfile**: If a Dockerfile does not already exist, look up how to build a Dockerfile and create a multistage Dockerfile to containerize the application. Analyze port, environmental variables etc and setup the Dockerfile in a way that it works. Ensure the Dockerfile can be built locally using the Docker cli. 2. **Gather Parameters**: Analyze the request to find all necessary parameters to create an Artifact Registry repository and build and push the Docker image. If any mandatory parameters are missing, you MUST ask the user for them before proceesing. Do not guess or make assumptions. -3. **Create Artifact Registry Repository** Create the Artifact Registry repository using the `artifactregistry.setup_repository` tool. +3. **Create Artifact Registry Repository** Create the Artifact Registry repository using the `create_artifact_repository` tool. 4. **Build and Push Image**: Using the Docker cli, build the Docker image locally using the created Dockerfile and push the image to the created Artifact Registry repository. 5. **Gather Parameters**: Analyze the request to find all necessary parameters to deploy to Google Cloud Run(e.g., `repo_name: "my-app-images"`). 6. **Clarify if Needed**: If any mandatory parameters are missing to deploy to Google Cloud Run, you MUST ask the user for them before proceeding. Do not guess or make assumptions. Ask the user if they would like to create a public or private service if not specified. -7. **Deploy**: Deploy the built application to Google Cloud Run using the `cloudrun.deploy_to_cloud_run_from_image` tool and return the URL of the deployed application. +7. **Deploy**: Deploy the built application to Google Cloud Run using the `deploy_cloudrun_service_from_image` tool and return the URL of the deployed application. ## Universal Protocols & Constraints These rules apply to all workflows. -Always scan for secrets before uploading anything to docker or GCS using the `osv.scan_secrets` tool. Always ignore directories where scanning is not useful e.g. dependencies which the user has no control over e.g. .venv or go_modules etc. Warn the user of any secrets available and ask if the user wants to ignore these files using dockerignore and gitignore. If they would like to ignore the files, create the corresponding dockerignore and gitignore files. Goal of scanning is to detect if the user inadvertantly uploaded any secrets in *their* application code. +Always scan for secrets before uploading anything to docker or GCS using the `scan_code_for_secrets` tool. Always ignore directories where scanning is not useful e.g. dependencies which the user has no control over e.g. .venv or go_modules etc. Warn the user of any secrets available and ask if the user wants to ignore these files using dockerignore and gitignore. If they would like to ignore the files, create the corresponding dockerignore and gitignore files. Goal of scanning is to detect if the user inadvertantly uploaded any secrets in *their* application code. First, analyze the user's application to determine the type of application. Proceed to the workflow only after analyzing the application. ### **Error Handling Protocol** diff --git a/devops-mcp-server/REFERENCE.md b/devops-mcp-server/REFERENCE.md index 39ec5ec..c4f65c3 100644 --- a/devops-mcp-server/REFERENCE.md +++ b/devops-mcp-server/REFERENCE.md @@ -4,7 +4,7 @@ This document provides detailed information about the tools available in the Goo ## Artifact Registry -### `artifactregistry.setup_repository` +### `create_artifact_repository` Sets up a new Artifact Registry repository. Optionally, it can grant Artifact Registry Writer permissions to a service account. **Arguments:** @@ -16,14 +16,14 @@ Sets up a new Artifact Registry repository. Optionally, it can grant Artifact Re ## Cloud Build -### `cloudbuild.list_triggers` +### `list_build_triggers` Lists all Cloud Build triggers in a given location. **Arguments:** - `project_id` (string, required): The Google Cloud project ID. - `location` (string, required): The Google Cloud location for the triggers. -### `cloudbuild.create_trigger` +### `create_build_trigger` Creates a new Cloud Build trigger. **Arguments:** @@ -35,7 +35,7 @@ Creates a new Cloud Build trigger. - `branch` (string, optional): Create builds on push to branch (regex, e.g., `^main$`). - `tag` (string, optional): Create builds on new tag push (regex, e.g., `^nightly$`). -### `cloudbuild.run_trigger` +### `run_build_trigger` Runs a Cloud Build trigger. **Arguments:** @@ -48,14 +48,14 @@ Runs a Cloud Build trigger. ## Cloud Run -### `cloudrun.list_services` +### `list_cloudrun_services` Lists the Cloud Run services in a specified GCP project and location. **Arguments:** - `project_id` (string, required): The Google Cloud project ID. - `location` (string, required): The Google Cloud location. -### `cloudrun.deploy_to_cloud_run_from_image` +### `deploy_cloudrun_service_from_image` Creates a new Cloud Run service or updates an existing one from a container image. **Arguments:** @@ -67,7 +67,7 @@ Creates a new Cloud Run service or updates an existing one from a container imag - `port` (integer, optional): The port the container listens on. - `allow_public_access` (boolean, optional): If the service should be public. Default is `false`. -### `cloudrun.deploy_to_cloud_run_from_source` +### `deploy_cloudrun_service_from_source` Creates a new Cloud Run service or updates an existing one from source. **Arguments:** @@ -80,13 +80,13 @@ Creates a new Cloud Run service or updates an existing one from source. ## Cloud Storage -### `cloudstorage.list_buckets` +### `list_storage_buckets` Lists Cloud Storage buckets in a specified project. **Arguments:** - `project_id` (string, required): The Google Cloud project ID. -### `cloudstorage.upload_source` +### `upload_storage_object` Uploads source to a GCS bucket. If a new bucket is created, it will be public. **Arguments:** @@ -97,7 +97,7 @@ Uploads source to a GCS bucket. If a new bucket is created, it will be public. ## Developer Connect -### `devconnect.setup_connection` +### `create_git_connection` Sets up a Developer Connect connection. **Arguments:** @@ -105,7 +105,7 @@ Sets up a Developer Connect connection. - `location` (string, required): The Google Cloud location. - `git_repo_uri` (string, required): The URI of the git repository to connect to. -### `devconnect.add_git_repo_link` +### `create_git_repository_link` Creates a Developer Connect git repository link when a connection already exists. **Arguments:** @@ -116,7 +116,7 @@ Creates a Developer Connect git repository link when a connection already exists ## OSV -### `osv.scan_secrets` +### `scan_code_for_secrets` Scans the specified root directory for secrets using OSV. **Arguments:** @@ -125,13 +125,13 @@ Scans the specified root directory for secrets using OSV. ## BM25 (Search) -### `bm25.search_common_cicd_patterns` +### `search_cicd_patterns` Finds common CI/CD patterns in the database. **Arguments:** - `query` (string, required): The query to search for. -### `bm25.query_knowledge` +### `search_knowledge_base` Finds knowledge snippets in the knowledge database. **Arguments:** diff --git a/devops-mcp-server/artifactregistry/artifactregistry.go b/devops-mcp-server/artifactregistry/artifactregistry.go index 2f1c502..5ce3ed3 100644 --- a/devops-mcp-server/artifactregistry/artifactregistry.go +++ b/devops-mcp-server/artifactregistry/artifactregistry.go @@ -69,5 +69,5 @@ func addSetupRepositoryTool(server *mcp.Server, arClient artifactregistryclient. return &mcp.CallToolResult{}, res, nil } - mcp.AddTool(server, &mcp.Tool{Name: "artifactregistry.setup_repository", Description: "Sets up a new Artifact Registry repository. Optionally, it can grant Artifact Registry Writer permissions to a service account."}, setupRepositoryToolFunc) + mcp.AddTool(server, &mcp.Tool{Name: "create_artifact_repository", Description: "Sets up a new Artifact Registry repository. Optionally, it can grant Artifact Registry Writer permissions to a service account."}, setupRepositoryToolFunc) } diff --git a/devops-mcp-server/bm25/bm25.go b/devops-mcp-server/bm25/bm25.go index 1a9528e..07fbfa9 100644 --- a/devops-mcp-server/bm25/bm25.go +++ b/devops-mcp-server/bm25/bm25.go @@ -49,7 +49,7 @@ func addQueryPatternTool(server *mcp.Server, bm25Client bm25client.BM25Client) { } return &mcp.CallToolResult{}, map[string]any{"cicd-patterns": res}, nil } - mcp.AddTool(server, &mcp.Tool{Name: "bm25.search_common_cicd_patterns", Description: "Find common CICD patterns in the database."}, queryPatternToolFunc) + mcp.AddTool(server, &mcp.Tool{Name: "search_cicd_patterns", Description: "Find common CICD patterns in the database."}, queryPatternToolFunc) } func addQueryKnowledgeTool(server *mcp.Server, bm25Client bm25client.BM25Client) { @@ -60,5 +60,5 @@ func addQueryKnowledgeTool(server *mcp.Server, bm25Client bm25client.BM25Client) } return &mcp.CallToolResult{}, map[string]any{"knowledge": res}, nil } - mcp.AddTool(server, &mcp.Tool{Name: "bm25.query_knowledge", Description: "Find knowledge snippets in the knowledge database."}, queryKnowledgeToolFunc) + mcp.AddTool(server, &mcp.Tool{Name: "search_knowledge_base", Description: "Find knowledge snippets in the knowledge database."}, queryKnowledgeToolFunc) } diff --git a/devops-mcp-server/cloudbuild/cloudbuild.go b/devops-mcp-server/cloudbuild/cloudbuild.go index d0e0ea4..7d238f0 100644 --- a/devops-mcp-server/cloudbuild/cloudbuild.go +++ b/devops-mcp-server/cloudbuild/cloudbuild.go @@ -65,7 +65,7 @@ func addRunTriggerTool(server *mcp.Server, cbClient cloudbuildclient.CloudBuildC } return &mcp.CallToolResult{}, res, nil } - mcp.AddTool(server, &mcp.Tool{Name: "cloudbuild.run_trigger", Description: "Runs a Cloud Build trigger."}, runTriggerToolFunc) + mcp.AddTool(server, &mcp.Tool{Name: "run_build_trigger", Description: "Runs a Cloud Build trigger."}, runTriggerToolFunc) } type ListTriggersArgs struct { @@ -83,7 +83,7 @@ func addListTriggersTool(server *mcp.Server, cbClient cloudbuildclient.CloudBuil } return &mcp.CallToolResult{}, map[string]any{"triggers": res}, nil } - mcp.AddTool(server, &mcp.Tool{Name: "cloudbuild.list_triggers", Description: "Lists all Cloud Build triggers in a given location."}, listTriggersToolFunc) + mcp.AddTool(server, &mcp.Tool{Name: "list_build_triggers", Description: "Lists all Cloud Build triggers in a given location."}, listTriggersToolFunc) } type CreateTriggerArgs struct { @@ -116,7 +116,7 @@ func addCreateTriggerTool(server *mcp.Server, cbClient cloudbuildclient.CloudBui } return &mcp.CallToolResult{}, res, nil } - mcp.AddTool(server, &mcp.Tool{Name: "cloudbuild.create_trigger", Description: "Creates a new Cloud Build trigger."}, createTriggerToolFunc) + mcp.AddTool(server, &mcp.Tool{Name: "create_build_trigger", Description: "Creates a new Cloud Build trigger."}, createTriggerToolFunc) } // setPermissionsForSA resolves the SA (if default) and grants it a role. @@ -178,7 +178,7 @@ func addListBuildsTool(server *mcp.Server, cbClient cloudbuildclient.CloudBuildC } return &mcp.CallToolResult{}, map[string]any{"builds": res}, nil } - mcp.AddTool(server, &mcp.Tool{Name: "cloudbuild.list_builds", Description: "Lists all Cloud Builds in a given location and project."}, listBuildsToolFunc) + mcp.AddTool(server, &mcp.Tool{Name: "list_builds", Description: "Lists all Cloud Builds in a given location and project."}, listBuildsToolFunc) } func addGetBuildInfoTool(server *mcp.Server, cbClient cloudbuildclient.CloudBuildClient) { @@ -189,7 +189,7 @@ func addGetBuildInfoTool(server *mcp.Server, cbClient cloudbuildclient.CloudBuil } return &mcp.CallToolResult{}, res, nil } - mcp.AddTool(server, &mcp.Tool{Name: "cloudbuild.get_build_info", Description: "Gets information about a specific Cloud Build."}, getBuildInfoToolFunc) + mcp.AddTool(server, &mcp.Tool{Name: "get_build_details", Description: "Gets information about a specific Cloud Build."}, getBuildInfoToolFunc) } func addStartBuildTool(server *mcp.Server, cbClient cloudbuildclient.CloudBuildClient) { @@ -208,5 +208,5 @@ func addStartBuildTool(server *mcp.Server, cbClient cloudbuildclient.CloudBuildC } return &mcp.CallToolResult{}, res, nil } - mcp.AddTool(server, &mcp.Tool{Name: "cloudbuild.start_build", Description: "Starts a new Cloud Build from a source in Google Cloud Storage."}, startBuildToolFunc) + mcp.AddTool(server, &mcp.Tool{Name: "start_build", Description: "Starts a new Cloud Build from a source in Google Cloud Storage."}, startBuildToolFunc) } diff --git a/devops-mcp-server/cloudrun/cloudrun.go b/devops-mcp-server/cloudrun/cloudrun.go index a174223..9d1d04a 100644 --- a/devops-mcp-server/cloudrun/cloudrun.go +++ b/devops-mcp-server/cloudrun/cloudrun.go @@ -53,7 +53,7 @@ func addListServicesTool(server *mcp.Server, crClient cloudrunclient.CloudRunCli } return &mcp.CallToolResult{}, map[string]any{"services": services}, nil } - mcp.AddTool(server, &mcp.Tool{Name: "cloudrun.list_services", Description: "Lists the Cloud Run service in a specified GCP project and location."}, listServicesToolFunc) + mcp.AddTool(server, &mcp.Tool{Name: "list_cloudrun_services", Description: "Lists the Cloud Run service in a specified GCP project and location."}, listServicesToolFunc) } @@ -106,7 +106,7 @@ func addDeployToCloudRunFromImageTool(server *mcp.Server, crClient cloudrunclien } return &mcp.CallToolResult{}, revision, nil } - mcp.AddTool(server, &mcp.Tool{Name: "cloudrun.deploy_to_cloud_run_from_image", Description: "Creates a new Cloud Run service or updates an existing one from a container image. This tool may take a couple minutes to finish running."}, deployToCloudRunFromImageToolFunc) + mcp.AddTool(server, &mcp.Tool{Name: "deploy_cloudrun_service_from_image", Description: "Creates a new Cloud Run service or updates an existing one from a container image. This tool may take a couple minutes to finish running."}, deployToCloudRunFromImageToolFunc) } type DeployToCloudRunFromSourceArgs struct { @@ -132,5 +132,5 @@ func addDeployToCloudRunFromSourceTool(server *mcp.Server, crClient cloudrunclie } return &mcp.CallToolResult{}, service, nil } - mcp.AddTool(server, &mcp.Tool{Name: "cloudrun.deploy_to_cloud_run_from_source", Description: "Creates a new Cloud Run service or updates an existing one from source. This tool may take a couple minutes to finish running."}, deployToCloudRunFromSourceToolFunc) + mcp.AddTool(server, &mcp.Tool{Name: "deploy_cloudrun_service_from_source", Description: "Creates a new Cloud Run service or updates an existing one from source. This tool may take a couple minutes to finish running."}, deployToCloudRunFromSourceToolFunc) } diff --git a/devops-mcp-server/cloudstorage/cloudstorage.go b/devops-mcp-server/cloudstorage/cloudstorage.go index 42ca79e..afa2a1b 100644 --- a/devops-mcp-server/cloudstorage/cloudstorage.go +++ b/devops-mcp-server/cloudstorage/cloudstorage.go @@ -55,7 +55,7 @@ func addListBucketsTool(server *mcp.Server, csClient cloudstorageclient.CloudSto return &mcp.CallToolResult{}, map[string]any{"buckets": res}, nil } - mcp.AddTool(server, &mcp.Tool{Name: "cloudstorage.list_buckets", Description: "Lists Cloud Storage buckets in a specified project."}, listBucketsToolFunc) + mcp.AddTool(server, &mcp.Tool{Name: "list_storage_buckets", Description: "Lists Cloud Storage buckets in a specified project."}, listBucketsToolFunc) } type UploadSourceArgs struct { @@ -127,5 +127,5 @@ func addUploadSourceTool(server *mcp.Server, csClient cloudstorageclient.CloudSt return nil }) } - mcp.AddTool(server, &mcp.Tool{Name: "cloudstorage.upload_source", Description: "Uploads source to a GCS bucket. If a new bucket is created, it will create a public bucket."}, uploadSourceToolFunc) + mcp.AddTool(server, &mcp.Tool{Name: "upload_storage_object", Description: "Uploads source to a GCS bucket. If a new bucket is created, it will create a public bucket."}, uploadSourceToolFunc) } diff --git a/devops-mcp-server/devconnect/devconnect.go b/devops-mcp-server/devconnect/devconnect.go index 43c5fbe..ff193f2 100644 --- a/devops-mcp-server/devconnect/devconnect.go +++ b/devops-mcp-server/devconnect/devconnect.go @@ -54,7 +54,7 @@ func addAddDevConnectGitRepoLinkTool(server *mcp.Server, dcClient devconnectclie } return &mcp.CallToolResult{}, newLink, nil } - mcp.AddTool(server, &mcp.Tool{Name: "devconnect.add_git_repo_link", Description: "Creates a Developer Connect git repository link when a connection already exists."}, addDevConnectGitRepoLinkToolFunc) + mcp.AddTool(server, &mcp.Tool{Name: "create_git_repository_link", Description: "Creates a Developer Connect git repository link when a connection already exists."}, addDevConnectGitRepoLinkToolFunc) } type ResultWrapper struct { @@ -88,5 +88,5 @@ func addSetupDevConnectConnectionTool(server *mcp.Server, dcClient devconnectcli return &mcp.CallToolResult{}, ResultWrapper{Message: "Created connection, authorize the connection by visiting the `installationUri`. After authorizing, call the AddDevConnectGitRepoLink to finalize.", Result: newConnection}, nil } - mcp.AddTool(server, &mcp.Tool{Name: "devconnect.setup_connection", Description: "Sets up a Developer Connect connection."}, setupDevConnectConnectionToolFunc) + mcp.AddTool(server, &mcp.Tool{Name: "create_git_connection", Description: "Sets up a Developer Connect connection."}, setupDevConnectConnectionToolFunc) } diff --git a/devops-mcp-server/integration_tests/main.go b/devops-mcp-server/integration_tests/main.go index cf37590..85919ca 100644 --- a/devops-mcp-server/integration_tests/main.go +++ b/devops-mcp-server/integration_tests/main.go @@ -68,8 +68,8 @@ func main() { testUploadSource(ctx, csClient) // Cloud Run Tests testListServices(ctx, crClient) - testDeployToCloudRunFromImage(ctx, crClient) // Tests the cloudrun.deploy_to_cloud_run_from_image tool with a new service. - testDeployToCloudRunFromImageNewRevision(ctx, crClient) // Tests the cloudrun.deploy_to_cloud_run_from_image tool with a preexisting service. + testDeployToCloudRunFromImage(ctx, crClient) // Tests the deploy_cloudrun_service_from_image tool with a new service. + testDeployToCloudRunFromImageNewRevision(ctx, crClient) // Tests the deploy_cloudrun_service_from_image tool with a preexisting service. testDeployToCloudRunFromSource(ctx, crClient) // OSV Tests testScanSecrets(ctx, osvClient) @@ -162,10 +162,10 @@ func testSetupRepository(ctx context.Context, arClient artifactregistryclient.Ar } var req mcp.CallToolRequest - req.Params.Name = "artifactregistry.setup_repository" + req.Params.Name = "create_artifact_repository" req.Params.Arguments = args - log.Println("Calling tool 'artifactregistry.setup_repository'...") + log.Println("Calling tool 'create_artifact_repository'...") resp, err := mcpClient.CallTool(ctx, req) if err != nil { @@ -287,10 +287,10 @@ func testListBuckets(ctx context.Context, csClient cloudstorageclient.CloudStora } var req mcp.CallToolRequest - req.Params.Name = "cloudstorage.list_buckets" + req.Params.Name = "list_storage_buckets" req.Params.Arguments = args - log.Println("Calling tool 'cloudstorage.list_buckets'...") + log.Println("Calling tool 'list_storage_buckets'...") resp, err := mcpClient.CallTool(ctx, req) if err != nil { @@ -398,10 +398,10 @@ func testUploadSource(ctx context.Context, csClient cloudstorageclient.CloudStor } var req mcp.CallToolRequest - req.Params.Name = "cloudstorage.upload_source" + req.Params.Name = "upload_storage_object" req.Params.Arguments = args - log.Println("Calling tool 'cloudstorage.upload_source'...") + log.Println("Calling tool 'upload_storage_object'...") resp, err := mcpClient.CallTool(ctx, req) if err != nil { @@ -518,10 +518,10 @@ func testListServices(ctx context.Context, crClient cloudrunclient.CloudRunClien } var req mcp.CallToolRequest - req.Params.Name = "cloudrun.list_services" + req.Params.Name = "list_cloudrun_services" req.Params.Arguments = args - log.Println("Calling tool 'cloudrun.list_services'...") + log.Println("Calling tool 'list_cloudrun_services'...") resp, err := mcpClient.CallTool(ctx, req) if err != nil { @@ -571,7 +571,7 @@ func testListServices(ctx context.Context, crClient cloudrunclient.CloudRunClien log.Println("Services verification successful.") } -// Tests the cloudrun.deploy_to_cloud_run_from_image tool with a new private service. +// Tests the deploy_cloudrun_service_from_image tool with a new private service. func testDeployToCloudRunFromImage(ctx context.Context, crClient cloudrunclient.CloudRunClient) { log.Println("--- Running test: CreateService ---") const serverURL = "http://localhost:8080" @@ -612,10 +612,10 @@ func testDeployToCloudRunFromImage(ctx context.Context, crClient cloudrunclient. } var req mcp.CallToolRequest - req.Params.Name = "cloudrun.deploy_to_cloud_run_from_image" + req.Params.Name = "deploy_cloudrun_service_from_image" req.Params.Arguments = args - log.Println("Calling tool 'cloudrun.deploy_to_cloud_run_from_image'...") + log.Println("Calling tool 'deploy_cloudrun_service_from_image'...") resp, err := mcpClient.CallTool(ctx, req) if err != nil { @@ -647,7 +647,7 @@ func testDeployToCloudRunFromImage(ctx context.Context, crClient cloudrunclient. log.Println("Service verification successful.") } -// Tests the cloudrun.deploy_to_cloud_run_from_image tool with a preexisting service (private service). +// Tests the deploy_cloudrun_service_from_image tool with a preexisting service (private service). func testDeployToCloudRunFromImageNewRevision(ctx context.Context, crClient cloudrunclient.CloudRunClient) { log.Println("--- Running test: CreateServiceRevision ---") const serverURL = "http://localhost:8080" @@ -705,10 +705,10 @@ func testDeployToCloudRunFromImageNewRevision(ctx context.Context, crClient clou } var req mcp.CallToolRequest - req.Params.Name = "cloudrun.deploy_to_cloud_run_from_image" + req.Params.Name = "deploy_cloudrun_service_from_image" req.Params.Arguments = args - log.Println("Calling tool 'cloudrun.deploy_to_cloud_run_from_image'...") + log.Println("Calling tool 'deploy_cloudrun_service_from_image'...") resp, err := mcpClient.CallTool(ctx, req) if err != nil { @@ -818,10 +818,10 @@ func handler(w http.ResponseWriter, r *http.Request) { } var req mcp.CallToolRequest - req.Params.Name = "cloudrun.deploy_to_cloud_run_from_source" + req.Params.Name = "deploy_cloudrun_service_from_source" req.Params.Arguments = args - log.Println("Calling tool 'cloudrun.deploy_to_cloud_run_from_source'...") + log.Println("Calling tool 'deploy_cloudrun_service_from_source'...") resp, err := mcpClient.CallTool(ctx, req) if err != nil { @@ -896,10 +896,10 @@ func testScanSecrets(ctx context.Context, oClient osvclient.OsvClient) { } var req mcp.CallToolRequest - req.Params.Name = "osv.scan_secrets" + req.Params.Name = "scan_code_for_secrets" req.Params.Arguments = args - log.Println("Calling tool 'osv.scan_secrets'...") + log.Println("Calling tool 'scan_code_for_secrets'...") resp, err := mcpClient.CallTool(ctx, req) if err != nil { @@ -958,10 +958,10 @@ func testScanSecretsWithSecret(ctx context.Context, oClient osvclient.OsvClient) } var req mcp.CallToolRequest - req.Params.Name = "osv.scan_secrets" + req.Params.Name = "scan_code_for_secrets" req.Params.Arguments = args - log.Println("Calling tool 'osv.scan_secrets'...") + log.Println("Calling tool 'scan_code_for_secrets'...") resp, err := mcpClient.CallTool(ctx, req) if err != nil { diff --git a/devops-mcp-server/osv/osv.go b/devops-mcp-server/osv/osv.go index 5dcc78a..6ef0b57 100644 --- a/devops-mcp-server/osv/osv.go +++ b/devops-mcp-server/osv/osv.go @@ -49,5 +49,5 @@ func addScanSecretsTool(server *mcp.Server, oClient osvclient.OsvClient) { return &mcp.CallToolResult{}, map[string]any{"report": res}, nil } - mcp.AddTool(server, &mcp.Tool{Name: "osv.scan_secrets", Description: "Scans the specified root directory for secrets using OSV."}, scanSecretsToolFunc) + mcp.AddTool(server, &mcp.Tool{Name: "scan_code_for_secrets", Description: "Scans the specified root directory for secrets using OSV."}, scanSecretsToolFunc) } diff --git a/devops-mcp-server/prompts/deploy_prompt.md b/devops-mcp-server/prompts/deploy_prompt.md index d741a0b..34439af 100644 --- a/devops-mcp-server/prompts/deploy_prompt.md +++ b/devops-mcp-server/prompts/deploy_prompt.md @@ -17,7 +17,7 @@ Your job is to deploy the users application to a Google Cloud Storage bucket. 1. **Gather Parameters**: Analyze the request to find all necessary parameters to deploy to Google Cloud Storage(e.g., `project_ID: "my-project"`). 2. **Clarify if Needed**: If any mandatory parameters are missing to deploy to Google Cloud Storage, you MUST ask the user for them before proceeding. Do not guess or make assumptions. -3. **Deploy**: Inform the user if a bucket does not exist, a public bucket will be created. Deploy the users application to Google Cloud Storage using the `cloudstorage.upload_source` tool and return the URL of the deployed application. +3. **Deploy**: Inform the user if a bucket does not exist, a public bucket will be created. Deploy the users application to Google Cloud Storage using the `upload_storage_object` tool and return the URL of the deployed application. ## Workflow B: Google Cloud Run With Buildpacks @@ -29,7 +29,7 @@ Your job is to deploy the user's applications to Cloud Run using buildpacks. 2. **Create DockerFile if not supported by buildpacks**: If the users application is not supported by buildpacks, as found in step 1, look up how to build a Dockerfile. Then create a multistage Dockerfile to containerize the application. Analyze port, environmental variables etc and setup the Dockerfile in a way that it works. After that, ensure the Dockerfile can be built locally using the Docker cli. 3. **Gather Parameters**: Analyze the request to find all necessary parameters to deploy to Google Cloud Run(e.g., `repo_name: "my-app-images"`). 4. **Clarify if Needed**: If any mandatory parameters are missing to deploy to Google Cloud Run, you MUST ask the user for them before proceeding. Do not guess or make assumptions. Ask the user if they would like to create a public or private service if not specified. -5. **Deploy**: Deploy the users application to Google Cloud Run using the `cloudrun.deploy_to_cloud_run_from_source` tool and return the URL of the deployed application. +5. **Deploy**: Deploy the users application to Google Cloud Run using the `deploy_cloudrun_service_from_source` tool and return the URL of the deployed application. ## Workflow C: Google Cloud Run From Image @@ -39,18 +39,18 @@ Your job is to deploy the user's applications to Cloud Run from an image. 1. **Create Dockerfile**: If a Dockerfile does not already exist, look up how to build a Dockerfile and create a multistage Dockerfile to containerize the application. Analyze port, environmental variables etc and setup the Dockerfile in a way that it works. Ensure the Dockerfile can be built locally using the Docker cli. 2. **Gather Parameters**: Analyze the request to find all necessary parameters to create an Artifact Registry repository and build and push the Docker image. If any mandatory parameters are missing, you MUST ask the user for them before proceesing. Do not guess or make assumptions. -3. **Create Artifact Registry Repository** Create the Artifact Registry repository using the `artifactregistry.setup_repository` tool. +3. **Create Artifact Registry Repository** Create the Artifact Registry repository using the `create_artifact_repository` tool. 4. **Build and Push Image**: Using the Docker cli, build the Docker image locally using the created Dockerfile and push the image to the created Artifact Registry repository. 5. **Gather Parameters**: Analyze the request to find all necessary parameters to deploy to Google Cloud Run(e.g., `repo_name: "my-app-images"`). 6. **Clarify if Needed**: If any mandatory parameters are missing to deploy to Google Cloud Run, you MUST ask the user for them before proceeding. Do not guess or make assumptions. Ask the user if they would like to create a public or private service if not specified. -7. **Deploy**: Deploy the built application to Google Cloud Run using the `cloudrun.deploy_to_cloud_run_from_image` tool and return the URL of the deployed application. +7. **Deploy**: Deploy the built application to Google Cloud Run using the `deploy_cloudrun_service_from_image` tool and return the URL of the deployed application. ## Universal Protocols & Constraints These rules apply to all workflows. -Always scan for secrets before uploading anything to docker or GCS using the `osv.scan_secrets` tool. Always ignore directories where scanning is not useful e.g. dependencies which the user has no control over e.g. .venv or go_modules etc. Warn the user of any secrets available and ask if the user wants to ignore these files using dockerignore and gitignore. If they would like to ignore the files, create the corresponding dockerignore and gitignore files. Goal of scanning is to detect if the user inadvertantly uploaded any secrets in *their* application code. +Always scan for secrets before uploading anything to docker or GCS using the `scan_code_for_secrets` tool. Always ignore directories where scanning is not useful e.g. dependencies which the user has no control over e.g. .venv or go_modules etc. Warn the user of any secrets available and ask if the user wants to ignore these files using dockerignore and gitignore. If they would like to ignore the files, create the corresponding dockerignore and gitignore files. Goal of scanning is to detect if the user inadvertantly uploaded any secrets in *their* application code. ### **Error Handling Protocol** diff --git a/skills/gcp-cicd-deploy/SKILL.md b/skills/gcp-cicd-deploy/SKILL.md index 35f8cc8..7940ead 100644 --- a/skills/gcp-cicd-deploy/SKILL.md +++ b/skills/gcp-cicd-deploy/SKILL.md @@ -38,7 +38,7 @@ Your job is to deploy the users application to a Google Cloud Storage bucket. 1. **Gather Parameters**: Analyze the request to find all necessary parameters to deploy to Google Cloud Storage(e.g., `project_ID: "my-project"`). 2. **Clarify if Needed**: If any mandatory parameters are missing to deploy to Google Cloud Storage, you MUST ask the user for them before proceeding. Do not guess or make assumptions. -3. **Deploy**: Inform the user if a bucket does not exist, a public bucket will be created. Deploy the users application to Google Cloud Storage using the `cloudstorage.upload_source` tool and return the URL of the deployed application. +3. **Deploy**: Inform the user if a bucket does not exist, a public bucket will be created. Deploy the users application to Google Cloud Storage using the `upload_storage_object` tool and return the URL of the deployed application. ## Workflow B: Google Cloud Run With Buildpacks @@ -51,7 +51,7 @@ Your job is to deploy the user's applications to Cloud Run using buildpacks. 2. **Create Dockerfile if not supported by buildpacks**: If the users application is not supported by buildpacks, as found in step 1, look up how to build a Dockerfile. Then create a multistage Dockerfile to containerize the application. Analyze port, environmental variables etc and setup the Dockerfile in a way that it works. After that, ensure the Dockerfile can be built locally using the Docker cli. 3. **Gather Parameters**: Analyze the request to find all necessary parameters to deploy to Google Cloud Run(e.g., `repo_name: "my-app-images"`). 4. **Clarify if Needed**: If any mandatory parameters are missing to deploy to Google Cloud Run, you MUST ask the user for them before proceeding. Do not guess or make assumptions. Ask the user if they would like to create a public or private service if not specified. -5. **Deploy**: Deploy the users application to Google Cloud Run using the `cloudrun.deploy_to_cloud_run_from_source` tool and return the URL of the deployed application. +5. **Deploy**: Deploy the users application to Google Cloud Run using the `deploy_cloudrun_service_from_source` tool and return the URL of the deployed application. ## Workflow C: Google Cloud Run From Image @@ -61,18 +61,18 @@ Your job is to deploy the user's applications to Cloud Run from an image. 1. **Create Dockerfile**: If a Dockerfile does not already exist, look up how to build a Dockerfile and create a multistage Dockerfile to containerize the application. Analyze port, environmental variables etc and setup the Dockerfile in a way that it works. Ensure the Dockerfile can be built locally using the Docker cli. 2. **Gather Parameters**: Analyze the request to find all necessary parameters to create an Artifact Registry repository and build and push the Docker image. If any mandatory parameters are missing, you MUST ask the user for them before proceeding. Do not guess or make assumptions. -3. **Create Artifact Registry Repository** Create the Artifact Registry repository using the `artifactregistry.setup_repository` tool. +3. **Create Artifact Registry Repository** Create the Artifact Registry repository using the `create_artifact_repository` tool. 4. **Build and Push Image**: Using the Docker cli, build the Docker image locally using the created Dockerfile and push the image to the created Artifact Registry repository. 5. **Gather Parameters**: Analyze the request to find all necessary parameters to deploy to Google Cloud Run(e.g., `repo_name: "my-app-images"`). 6. **Clarify if Needed**: If any mandatory parameters are missing to deploy to Google Cloud Run, you MUST ask the user for them before proceeding. Do not guess or make assumptions. Ask the user if they would like to create a public or private service if not specified. -7. **Deploy**: Deploy the built application to Google Cloud Run using the `cloudrun.deploy_to_cloud_run_from_image` tool and return the URL of the deployed application. +7. **Deploy**: Deploy the built application to Google Cloud Run using the `deploy_cloudrun_service_from_image` tool and return the URL of the deployed application. ## Universal Protocols & Constraints These rules apply to all workflows. -Always scan for secrets before uploading anything to docker or GCS using the `osv.scan_secrets` tool. Always ignore directories where scanning is not useful e.g. dependencies which the user has no control over e.g. .venv or go_modules etc. Warn the user of any secrets available and ask if the user wants to ignore these files using dockerignore and gitignore. If they would like to ignore the files, create the corresponding dockerignore and gitignore files. Goal of scanning is to detect if the user inadvertently uploaded any secrets in *their* application code. +Always scan for secrets before uploading anything to docker or GCS using the `scan_code_for_secrets` tool. Always ignore directories where scanning is not useful e.g. dependencies which the user has no control over e.g. .venv or go_modules etc. Warn the user of any secrets available and ask if the user wants to ignore these files using dockerignore and gitignore. If they would like to ignore the files, create the corresponding dockerignore and gitignore files. Goal of scanning is to detect if the user inadvertently uploaded any secrets in *their* application code. First, analyze the user's application to determine the type of application. Proceed to the workflow only after analyzing the application. ### **Error Handling Protocol**