Add ability to register tools in McpServer (#35068)

Makes it easier to add tools to a server by implementing a trait

Release Notes:

- N/A
This commit is contained in:
Agus Zubiaga 2025-07-24 23:19:20 -03:00 committed by GitHub
parent b446d66be7
commit 15c9da4ea4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 408 additions and 244 deletions

View file

@ -2,6 +2,7 @@ mod mcp_server;
pub mod tools;
use collections::HashMap;
use context_server::listener::McpServerTool;
use project::Project;
use settings::SettingsStore;
use smol::process::Child;
@ -332,10 +333,16 @@ async fn spawn_claude(
&format!(
"mcp__{}__{}",
mcp_server::SERVER_NAME,
mcp_server::PERMISSION_TOOL
mcp_server::PermissionTool::NAME,
),
"--allowedTools",
"mcp__zed__Read,mcp__zed__Edit",
&format!(
"mcp__{}__{},mcp__{}__{}",
mcp_server::SERVER_NAME,
mcp_server::EditTool::NAME,
mcp_server::SERVER_NAME,
mcp_server::ReadTool::NAME
),
"--disallowedTools",
"Read,Edit",
])