Skip to content

Update mcp command to setup the remote Bucket MCP connection#403

Merged
Swiftwork merged 13 commits intomainfrom
buc-3537-update-the-cli-mcp-command-to-setup-the-mcp-connection-on
May 13, 2025
Merged

Update mcp command to setup the remote Bucket MCP connection#403
Swiftwork merged 13 commits intomainfrom
buc-3537-update-the-cli-mcp-command-to-setup-the-mcp-connection-on

Conversation

@Swiftwork
Copy link
Contributor

@Swiftwork Swiftwork commented Apr 29, 2025

Changes

Repurposed the mcp command to help set up the connection to the remotely hosted Bucket MCP server instead of creating a local MCP server.

Kapture.2025-04-29.at.15.48.34.mp4

AI Summary

This pull request includes updates to the packages/cli documentation and codebase to improve usability, error handling, and maintainability. The most significant changes involve reordering CLI command arguments for consistency, enhancing error handling in various actions, and updating the MCP setup process to use a remote server.

Documentation Updates:

  • Reordered CLI command arguments for consistency: Updated the order of arguments in commands like bucket new, bucket features create, and others to place --app-id before other options, improving clarity and consistency across the CLI documentation. (packages/cli/README.md: [1] [2] [3]
  • Updated MCP setup instructions: Replaced local MCP server setup with instructions for connecting to a remote MCP server. Added new options like --editor and --scope to configure editors/clients and clarified compatibility with MCP STDIO and HTTP streaming. (packages/cli/README.md: packages/cli/README.mdL269-R298)

Codebase Enhancements:

  • Improved error handling: Added try-catch blocks around calls to getApp in multiple actions (e.g., createFeatureAction, generateTypesAction, featureAccessAction) to handle errors gracefully and provide better feedback to users. (packages/cli/commands/features.ts: [1] [2] [3]
  • Refactored imports for clarity: Renamed path.js to urls.js and updated imports across affected files to better reflect the file's purpose. (packages/cli/commands/companies.ts: [1] packages/cli/commands/features.ts: [2]

Usability Improvements:

  • Simplified app selection in initAction: Automatically defaults to the first non-demo app if available and sets it as the default choice in the app selection prompt, streamlining the initialization process. (packages/cli/commands/init.ts: packages/cli/commands/init.tsL45-R53)

@Swiftwork Swiftwork requested a review from Copilot April 29, 2025 13:51
@Swiftwork Swiftwork self-assigned this Apr 29, 2025
@Swiftwork Swiftwork requested a review from roncohen April 29, 2025 13:52
@Swiftwork Swiftwork added the enhancement New feature or request label Apr 29, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR repurposes the MCP command in the CLI to configure a connection to the remote Bucket MCP server while updating the related documentation and code for better error handling and consistency. Key changes include removing redundant schema utility functions, introducing new options (such as --editor and --scope), and refactoring the MCP command logic to prompt users for editor and app selection.

Reviewed Changes

Copilot reviewed 20 out of 21 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/cli/utils/schemas.ts Removed unused utility functions (withDefaults and withDescriptions)
packages/cli/utils/options.ts Added new editor and scope options; removed the mcpSsePortOption
packages/cli/commands/mcp.ts Overhauled the MCP command to support remote MCP server configuration and interactive prompts
packages/cli/commands/init.ts Simplified app selection by defaulting to the first non-demo app when available
packages/cli/README.md Updated documentation to reflect the new MCP setup process and option changes
Files not reviewed (1)
  • packages/cli/package.json: Language not supported
Comments suppressed due to low confidence (2)

packages/cli/utils/schemas.ts:63

  • The removal of the withDefaults and withDescriptions functions may break any downstream usage. Please ensure that these utility functions are no longer referenced anywhere in the codebase or update the references accordingly.
export const withDefaults = <T extends z.ZodRawShape>( ... ) => {

packages/cli/commands/mcp.ts:189

  • [nitpick] Consider adding a note or additional comment about the hard-coded 'mcp-remote@next' value to remind maintainers to update it when the remote MCP server becomes stable.
"mcp-remote@next", // todo: remove next once stable

@Swiftwork Swiftwork changed the title Buc 3537 update the cli mcp command to setup the mcp connection on Update mcp command to setup the remote Bucket MCP connection Apr 29, 2025
@Swiftwork Swiftwork marked this pull request as ready for review May 13, 2025 09:12
Copy link
Contributor

@roncohen roncohen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a few small docs changes, but otherwise looks good to me. I haven't tested the MCP command with all these different clients though, but I'm good to merge if you have.

Swiftwork and others added 2 commits May 13, 2025 12:31
Co-authored-by: Ron Cohen <ron@bucket.co>
Co-authored-by: Ron Cohen <ron@bucket.co>
@Swiftwork
Copy link
Contributor Author

a few small docs changes, but otherwise looks good to me. I haven't tested the MCP command with all these different clients though, but I'm good to merge if you have.

Cursor, VS Code, and Claude

@Swiftwork Swiftwork added this pull request to the merge queue May 13, 2025
Merged via the queue into main with commit 4e47544 May 13, 2025
6 checks passed
@Swiftwork Swiftwork deleted the buc-3537-update-the-cli-mcp-command-to-setup-the-mcp-connection-on branch May 13, 2025 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants