Skip to content

Commit 601043a

Browse files
committed
feat(meta-tools): consolidate FeatureSet writes into manage_feature_set; bind upsert
Keeps the per-client meta-tool surface flat while giving the agent full self-service CRUD (it could previously only create, never fix or remove). - Replace `mcpmux_create_feature_set` with `mcpmux_manage_feature_set` (`action`: create | update | delete) — one tool covers all of CRUD on custom FeatureSets. Built-in/Starter sets are not mutable via MCP; cross-Space, unknown-tool-name, empty-name, and unknown-action inputs are rejected with actionable errors so the model can self-correct. - Make `mcpmux_bind_current_workspace` idempotent (upsert): re-binding the same workspace REBINDS it instead of erroring, and `feature_set_id` is now optional (omit → bind the folder to no Space tools; built-ins still apply). No separate unbind — that's just a bind-config change, and deleting a binding row stays UI-only. - Update the Tool Optimization built-in descriptor + dev docs to the new name. - Tests: create / update (add+remove+rename) / delete, reject-builtin, unknown-action, rebind-on-second-call, bind-to-empty. Signed-off-by: Mohammod Al Amin Ashik <maa.ashik00@gmail.com>
1 parent 0f5b9f8 commit 601043a

7 files changed

Lines changed: 587 additions & 141 deletions

File tree

apps/desktop/src-tauri/src/commands/meta_tool_approval.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ pub async fn revoke_meta_tool_grant(
112112

113113
/// DEBUG/dev only: toggle auto-approval of all write meta tools.
114114
///
115-
/// When on, every `mcpmux_*` write tool (create_feature_set,
115+
/// When on, every `mcpmux_*` write tool (manage_feature_set,
116116
/// bind_current_workspace, …) is approved without a dialog. This exists so a
117117
/// developer (or the in-app assistant) can self-create feature sets / bindings
118118
/// and exercise the routing end-to-end without clicking through approvals.

apps/desktop/src/lib/api/metaTools.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export async function revokeMetaToolGrant(clientId: string, toolName: string): P
3636
/**
3737
* DEBUG/dev only: toggle auto-approval of every write meta tool.
3838
*
39-
* When on, `mcpmux_create_feature_set` / `mcpmux_bind_current_workspace` and
39+
* When on, `mcpmux_manage_feature_set` / `mcpmux_bind_current_workspace` and
4040
* friends are approved without a dialog — so a developer can self-create
4141
* feature sets and bindings and exercise routing end-to-end. Session-only:
4242
* resets on gateway restart (to the `MCPMUX_DEBUG_AUTO_APPROVE` env default).

crates/mcpmux-core/src/domain/builtin.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,14 @@ pub fn builtin_servers() -> Vec<BuiltinServerDescriptor> {
6767
write: false,
6868
},
6969
BuiltinToolDescriptor {
70-
name: "mcpmux_create_feature_set",
71-
description: "Build a focused feature set from chosen tools.",
70+
name: "mcpmux_manage_feature_set",
71+
description: "Create, update, or delete a custom feature set of chosen tools.",
7272
write: true,
7373
},
7474
BuiltinToolDescriptor {
7575
name: "mcpmux_bind_current_workspace",
76-
description: "Map the current folder to a feature set so it persists.",
76+
description:
77+
"Map the current folder to a feature set so it persists (re-run to rebind).",
7778
write: true,
7879
},
7980
],

crates/mcpmux-gateway/src/services/meta_tools/approval.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ pub struct ApprovalBroker {
119119
publisher: Mutex<Option<ApprovalPublisher>>,
120120
timeout: Duration,
121121
/// DEBUG/dev only: when set, every write meta-tool is auto-approved without
122-
/// a dialog. Lets self-tests drive `mcpmux_create_feature_set` /
122+
/// a dialog. Lets self-tests drive `mcpmux_manage_feature_set` /
123123
/// `mcpmux_bind_current_workspace` headlessly. Off by default; enabled via
124124
/// `MCPMUX_DEBUG_AUTO_APPROVE=1` at startup or the
125125
/// `set_meta_tools_auto_approve` command at runtime.

crates/mcpmux-gateway/src/services/meta_tools/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ pub fn build_default_registry(
8383
// user request — the read surface is just the two list_* tools above,
8484
// which an LLM can stitch into the same picture without an extra hop.
8585
// Writes — gated by ApprovalBroker.
86-
registry.register(Box::new(tools::CreateFeatureSetTool));
86+
registry.register(Box::new(tools::ManageFeatureSetTool));
8787
registry.register(Box::new(tools::BindCurrentWorkspaceTool));
8888
std::sync::Arc::new(registry)
8989
}

0 commit comments

Comments
 (0)