You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update mcp command to setup the remote Bucket MCP connection (#403)
Draft until the remote MCP server is generally available.
## 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.
https://github.com/user-attachments/assets/9c48dd42-1ce3-4b66-a380-e89bbfe797c4
## 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]](diffhunk://#diff-15986190ef9581ab59bcd5483b2c09e7fd0bd439d6f6cddbc94b0b1de094ee51L102-R102)
[[2]](diffhunk://#diff-15986190ef9581ab59bcd5483b2c09e7fd0bd439d6f6cddbc94b0b1de094ee51L141-R141)
[[3]](diffhunk://#diff-15986190ef9581ab59bcd5483b2c09e7fd0bd439d6f6cddbc94b0b1de094ee51L208-R208)
* **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](diffhunk://#diff-15986190ef9581ab59bcd5483b2c09e7fd0bd439d6f6cddbc94b0b1de094ee51L269-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]](diffhunk://#diff-62cb1138f98fd9620a8f451d3171b4558f8690fa8fad668d98cd60a507f04315L57-R64)
[[2]](diffhunk://#diff-62cb1138f98fd9620a8f451d3171b4558f8690fa8fad668d98cd60a507f04315L145-R158)
[[3]](diffhunk://#diff-62cb1138f98fd9620a8f451d3171b4558f8690fa8fad668d98cd60a507f04315L205-R223)
* **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]](diffhunk://#diff-bfb1192584bcb365fdd137d53b596b850d601a2beb7ad959d33d13ce7bd737cdL14-R14)
`packages/cli/commands/features.ts`:
[[2]](diffhunk://#diff-62cb1138f98fd9620a8f451d3171b4558f8690fa8fad668d98cd60a507f04315L39-R39)
### 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](diffhunk://#diff-76aae8c1424cc73067ec33d08cef49f3f8745b2827c72ed4d1e408b1141ed2d8L45-R53))
---------
Co-authored-by: Ron Cohen <ron@bucket.co>
@@ -252,7 +252,7 @@ Bucket provides powerful AI-assisted development capabilities through rules and
252
252
The `rules` command helps you set up AI-specific rules for your project. These rules enable AI tools to better understand how to work with Bucket and feature flags and how they should be used in your codebase.
@@ -266,67 +266,36 @@ This command will add rules to your project that provide AI tools with context a
266
266
267
267
## Model Context Protocol
268
268
269
-
The Model Context Protocol (MCP) is an open protocol that provides a standardized way to connect AI models to different data sources and tools. In the context of Bucket, MCP enables your development environment to understand your feature flags, their states, and their relationships within your codebase. This creates a seamless bridge between your feature management workflow and AI-powered development tools. MCP is in a very early stage of development and changes are frequent, if something isn't working please check out the [Model Context Protocol Website](https://modelcontextprotocol.io/) and open an [issue ticket here](https://github.com/bucketco/bucket-javascript-sdk/issues).
269
+
The Model Context Protocol (MCP) is an open protocol that provides a standardized way to connect AI models to different data sources and tools. In the context of Bucket, MCP enables your code editor to understand your feature flags, their states, and their relationships within your codebase. This creates a seamless bridge between your feature management workflow and AI-powered development tools. The MCP server is hosted by Bucket, so it's very easy to get started.
270
+
271
+
_\*\*Note: The Bucket `mcp` CLI command was previously used for a \_local_ server. However, in recent versions of the Bucket CLI, the `mcp` command has been repurposed to help you connect to the new remote MCP server.\*\*\_
270
272
271
273
### Setting up MCP
272
274
273
-
MCP servers currently run locally on your machine. To start the MCP server run the CLI command from your Bucket initialized project directory:
275
+
The `mcp` command helps you configure your editor or AI client to connect with Bucket's remote MCP server. This allows your AI tools to understand your feature flags and provide more contextual assistance.
-`--port`: Port to run the SSE server on (defaults to 8050, "auto" for random port).
282
-
-`--app-id`: App ID to use.
283
-
284
-
This will start an SSE server at `http://localhost:8050/sse` by default which you can connect to using your [client of choice](https://modelcontextprotocol.io/clients). Below are examples that work for [Cursor IDE](https://www.cursor.com/) and [Claude Desktop](https://claude.ai/download).
285
-
286
-
#### Server-Side Events (SSE)
287
-
288
-
```json
289
-
{
290
-
"mcpServers": {
291
-
"Bucket": {
292
-
"url": "http://localhost:8050/sse"
293
-
}
294
-
}
295
-
}
296
-
```
297
-
298
-
#### STDIO Proxy
299
-
300
-
Some clients don't support SSE and can instead interface with the MCP server over a STDIO proxy.
-`--scope`: Whether to configure settings globally or locally for the project.
321
290
322
-
### Claude Desktop
291
+
The command will guide you through:
323
292
324
-
To enable MCP features in [Claude Desktop](https://claude.ai/download):
293
+
1. Selecting which editor/client to configure.
294
+
2. Choosing which Bucket app to connect to.
295
+
3. Deciding between global or project-local configuration.
296
+
4. Setting up the appropriate configuration file for your chosen editor .
325
297
326
-
1. Open Claude Desktop.
327
-
2. Go to `Settings > Developer`.
328
-
3. Click `Edit config` and paste the `STDIO` config.
329
-
4. Save and restart Claude Desktop.
298
+
_**Note: The setup uses [mcp-remote](https://github.com/geelen/mcp-remote) as a compatibility layer allowing the remote hosted Bucket MCP server to work with all editors/clients that support MCP STDIO servers. If your editor/client supports HTTP Streaming with OAuth you can connect to the Bucket MCP server directly.**_
0 commit comments