diff --git a/commands/devops/deploy.toml b/commands/devops/deploy.toml index b169fa1..c41aeef 100644 --- a/commands/devops/deploy.toml +++ b/commands/devops/deploy.toml @@ -69,6 +69,8 @@ Your job is to deploy the user's applications to Cloud Run from an image. 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. + * **Never overwrite existing dockerignore or gitignore files.** + * **Always ignore .git folder if it is present.** 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/commands/devops/design.toml b/commands/devops/design.toml index 39ae464..0642d0a 100644 --- a/commands/devops/design.toml +++ b/commands/devops/design.toml @@ -7,6 +7,11 @@ You are a comprehensive Google Cloud DevOps Assistant. Your primary function is First, analyze the user's request to determine the primary intent. +### **Explain your plan:** + * Before taking any action or seeking approval for any tool call, clearly explain to the user what your going to do. + * Report your findings to the user, after initial analysis of the project. + * Do not call any shell or MCP tools until you have explained your intent and performed basic analysis of the project. + * If the intent is a high-level goal like **"build a pipeline," "design an architecture,"** or **"migrate my Jenkins pipeline,"** you must follow the two-stage **Workflow: Design & Implement**. ## Workflow: Design & Implement @@ -59,6 +64,8 @@ These rules apply to all workflows. ### **Defaults** * **Google Cloud**: If gcloud is installed use `gcloud config list` to get the default *project* and *region*. * **GIT URL**: If git is installed use `git remote get-url origin` to get the git url for Developer Connect tools. +* **Deployment Target:** If the user does not specify a deployment target, use **Cloud Run**. +* **Dockerfile:** If there is a Dockerfile in the project use it, otherwise create one. Use `bm25.query_knowledge` MCP tool to get the best practices for creating a Dockerfile. ## **User Prompt** **If `{{args}}` is NOT empty:** Augment the context with {{args}} diff --git a/devops-mcp-server/main.go b/devops-mcp-server/main.go index 8052bb9..f8704eb 100644 --- a/devops-mcp-server/main.go +++ b/devops-mcp-server/main.go @@ -22,6 +22,7 @@ import ( "net/http" _ "net/http/pprof" "os" + "path/filepath" "runtime" "github.com/modelcontextprotocol/go-sdk/mcp" @@ -30,7 +31,7 @@ import ( var ( httpAddr = flag.String("http", "", "if set, use streamable HTTP at this address, instead of stdin/stdout. e.g. localhost:8080") pprofAddr = flag.String("pprof", "", "if set, host the pprof debugging server at this address") - logFile = "/tmp/devops-mcp-server.log" + logFile = filepath.Join(os.TempDir(), "devops-mcp-server.log") ) func main() { diff --git a/devops-mcp-server/server.go b/devops-mcp-server/server.go index 5da2399..54ee3bf 100644 --- a/devops-mcp-server/server.go +++ b/devops-mcp-server/server.go @@ -49,9 +49,12 @@ import ( //go:embed version.txt var version string +//go:embed server_instructions.md +var serverInstructions string + func createServer() *mcp.Server { opts := &mcp.ServerOptions{ - Instructions: "Google Cloud DevOps MCP Server", + Instructions: serverInstructions, HasResources: false, } server := mcp.NewServer(&mcp.Implementation{ diff --git a/devops-mcp-server/server_instructions.md b/devops-mcp-server/server_instructions.md new file mode 100644 index 0000000..ddec165 --- /dev/null +++ b/devops-mcp-server/server_instructions.md @@ -0,0 +1 @@ +The DevOps MCP serer procide tools to help users deploy applications and manage CI/CD on Google Cloud Platform (GCP). \ No newline at end of file