Revert "mcp: wire extra server allowedTools into --allowedTools arg"
This reverts commit e0b18ff3c2ec5a7f771ab9a1a247ff4a24a8c475.
This commit is contained in:
parent
caa495aeda
commit
286da8980e
1 changed files with 1 additions and 17 deletions
|
|
@ -544,8 +544,6 @@ impl ManagerServer {
|
||||||
)]
|
)]
|
||||||
impl ServerHandler for ManagerServer {}
|
impl ServerHandler for ManagerServer {}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// Name of the hyperhive MCP server inside claude's view. Claude prefixes
|
/// Name of the hyperhive MCP server inside claude's view. Claude prefixes
|
||||||
/// tools as `mcp__<this>__<tool>` (e.g. `mcp__hyperhive__send`).
|
/// tools as `mcp__<this>__<tool>` (e.g. `mcp__hyperhive__send`).
|
||||||
pub const SERVER_NAME: &str = "hyperhive";
|
pub const SERVER_NAME: &str = "hyperhive";
|
||||||
|
|
@ -608,9 +606,7 @@ pub fn allowed_mcp_tools(flavor: Flavor) -> Vec<String> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Combined allow-list passed to `--allowedTools` (auto-approve) — covers
|
/// Combined allow-list passed to `--allowedTools` (auto-approve) — covers
|
||||||
/// the built-ins, the hyperhive MCP surface, and any extra MCP servers.
|
/// both the built-ins and the MCP surface.
|
||||||
/// Extra server tools are read from the same `/etc/hyperhive/extra-mcp.json`
|
|
||||||
/// file that `render_claude_config` uses, so the two are always in sync.
|
|
||||||
#[must_use]
|
#[must_use]
|
||||||
pub fn allowed_tools_arg(flavor: Flavor) -> String {
|
pub fn allowed_tools_arg(flavor: Flavor) -> String {
|
||||||
let mut all: Vec<String> = ALLOWED_BUILTIN_TOOLS
|
let mut all: Vec<String> = ALLOWED_BUILTIN_TOOLS
|
||||||
|
|
@ -618,18 +614,6 @@ pub fn allowed_tools_arg(flavor: Flavor) -> String {
|
||||||
.map(|s| (*s).to_owned())
|
.map(|s| (*s).to_owned())
|
||||||
.collect();
|
.collect();
|
||||||
all.extend(allowed_mcp_tools(flavor));
|
all.extend(allowed_mcp_tools(flavor));
|
||||||
for (name, spec) in load_extra_mcp() {
|
|
||||||
if name == SERVER_NAME {
|
|
||||||
continue; // already covered above
|
|
||||||
}
|
|
||||||
for tool in &spec.allowed_tools {
|
|
||||||
if tool == "*" {
|
|
||||||
all.push(format!("mcp__{name}__*"));
|
|
||||||
} else {
|
|
||||||
all.push(format!("mcp__{name}__{tool}"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
all.join(",")
|
all.join(",")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue