feat: add deploy and deploy_status tools#10262
feat: add deploy and deploy_status tools#10262joehan wants to merge 13 commits intomcp-sse-supportfrom
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces two new MCP tools: 'deploy' for initiating background Firebase resource deployments and 'deploy_status' for monitoring their progress via a job tracker. The implementation includes necessary logic for handling deployment targets and progress reporting. Feedback was provided regarding the use of 'any' types, the need for safer error handling in asynchronous blocks, and the potential for code duplication regarding deployment targets. I have suggested improvements to align the code with the repository's strict TypeScript standards.
| return { | ||
| ...contentRes, | ||
| structuredContent: job as any, | ||
| }; |
There was a problem hiding this comment.
The style guide rule "Never use any or unknown as an escape hatch" is violated. The job object is cast to any. The structuredContent property expects a type compatible with Record<string, unknown>, and the job object appears to be a plain serializable object that should be assignable to this type without needing an any cast.
| return { | |
| ...contentRes, | |
| structuredContent: job as any, | |
| }; | |
| return { | |
| ...contentRes, | |
| structuredContent: job, | |
| }; |
References
- The style guide states to never use
anyorunknownas an escape hatch, and instead define proper interfaces/types or use type guards. (link)
09132bc to
316c49b
Compare
### Description - Adds mcpapps experiment flag to src/experiments.ts. - Adds applyAppMeta helper function to src/mcp/util.ts to conditionally add UI metadata. - Adds unit tests for applyAppMeta in src/mcp/util.spec.ts. ### Scenarios Tested - Unit tests passed. - Build succeeds.
### Description - Fixes applyAppMeta to preserve existing metadata. - Moves mcpapps flag to be grouped with other MCP experiments. - Removes as any in util.spec.ts by importing CallToolResult. ### Scenarios Tested - Build succeeds. - Lint passes for modified files (ignoring pre-existing warnings). - Unit tests for applyAppMeta pass.
Adds support for returning structured content from tools, which is used by MCP Apps to pass complex data to the host. Also updates the resource index. - Verified build and file changes.
### Description Adds the Update Environment MCP App, allowing users to switch projects and directories from the UI. ### Scenarios Tested - Verified build and file changes.
### Description Adds the Init MCP App for interactive initialization of Firestore and Auth products. Includes support for Google Sign-In configuration and project selection. ### Scenarios Tested - Verified build and file changes.
- Remove non-existent login_ui and deploy_ui from resources index to fix build. - Avoid using any in mcp-app.ts, use specific interfaces. - Check isError on tool results. - Reduce page_size to 1000. - Fix lint warnings for catch blocks.
### Description Adds firebase_deploy and deploy_status tools to support asynchronous deployment and status polling. ### Scenarios Tested - Verified file changes.
### Description - Updates deploy tool to use applyAppMeta to conditionally return UI resource URI. - Recovers missing src/mcp/util/jobs.ts from compiled version. ### Scenarios Tested - Build succeeds. - Lint passes for these files.
- Export TARGETS from src/deploy/index.ts to avoid duplication. - Fix any usages in deploy.ts and deploy_status.ts. - Add index signature to Job interface in jobs.ts. - Fix lint warnings and errors.
Adds firebase_deploy and deploy_status tools. (Chained off #10258)