feat: add server instructions and document MCP timeout configuration#287
feat: add server instructions and document MCP timeout configuration#28764johnlee wants to merge 1 commit into
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
There was a problem hiding this comment.
Code Review
This pull request adds server instructions to mcp-server.js and documents how to increase the MCP timeout in README.md. The review feedback suggests wrapping the Gemini CLI configuration snippet in the README with the correct "mcpServers" key to ensure it is valid and copy-pasteable.
| "cloud-run": { | ||
| "command": "npx", | ||
| "args": ["-y", "@google-cloud/cloud-run-mcp"], | ||
| "timeout": 300000 | ||
| } |
There was a problem hiding this comment.
In Gemini CLI, the configuration file ~/.gemini/settings.json is a general settings file where MCP servers must be defined under the "mcpServers" key. Providing the configuration without the "mcpServers" wrapper might lead to invalid configurations or the server not being recognized. Wrapping the configuration in "mcpServers" makes it clear and copy-pasteable.
| "cloud-run": { | |
| "command": "npx", | |
| "args": ["-y", "@google-cloud/cloud-run-mcp"], | |
| "timeout": 300000 | |
| } | |
| { | |
| "mcpServers": { | |
| "cloud-run": { | |
| "command": "npx", | |
| "args": ["-y", "@google-cloud/cloud-run-mcp"], | |
| "timeout": 300000 | |
| } | |
| } | |
| } |
|
gcla |
2 similar comments
|
gcla |
|
gcla |
Add an instructions string to the McpServer initialization so MCP clients receive a description of the server's capabilities on connection (MCP spec 2025-06-18 InitializeResult.instructions, closes GoogleCloudPlatform#189). Add a step to the Node.js setup guide explaining how to configure a longer MCP client timeout. Cloud Run deployments trigger a Cloud Build that can take several minutes; the default 60-second timeout in some clients causes premature disconnects even though the build continues on GCP (closes GoogleCloudPlatform#134).
18061cf to
8409c2e
Compare
|
gcla |
| 'Use this server to deploy and manage applications on Google Cloud Run. ' + | ||
| 'Available tools: deploy source code or file contents to Cloud Run, list services, ' + | ||
| 'get service details, and retrieve service logs. ' + | ||
| 'Note: deployments trigger a Cloud Build and can take several minutes to complete.', |
There was a problem hiding this comment.
The note is not correct any more. We are moving away from Cloud Build for Nodejs and Python for now, and most of the cases down the line.
The note should be removed.
|
|
||
| 3. [Optional] Increase the MCP timeout | ||
|
|
||
| Cloud Run deployments trigger a Cloud Build, which can take several minutes to |
There was a problem hiding this comment.
This is not true today for Nodejs and Python. And, we are going to remove Cloud Build for other languages as well in the near future.
Summary
Addresses two related usability issues:
Closes Add support for server instructions #189 — Adds an
instructionsstring to theMcpServerinitialization inmcp-server.js. MCP clients that support the 2025-06-18 spec will now receive a brief description of the server's capabilities and a heads-up about deployment duration on first connection.Closes Add example of setting MCP timeout #134 — Adds a step 3 under the Node.js setup guide in
README.mdexplaining how to configure a longer MCP client timeout. Cloud Run deployments trigger a Cloud Build that can take several minutes; the default 60-second timeout in some clients (notably Gemini CLI) causes premature disconnects. The README now clarifies that the build continues on GCP even after a disconnect, and shows the Gemini CLItimeoutconfig with a 5-minute value.Changes
mcp-server.js— Addedinstructionsfield toMcpServeroptions:README.md— Added optional step 3 under "Using Node.js":Test plan
npm run test:local— existing tests should pass unchanged (no logic modified)npx @modelcontextprotocol/inspector node mcp-server.jsand verify theinstructionsfield appears in theInitializeResultresponse