on main help sign in
feat(mcp-config): add list of disabled_tools (#1533)
commit6219de7ca9a8625fa88b02414477f4fe7cc891a8 authorAmolith <amolith@secluded.site> dateWed 10 Dec 2025, 11:36 (1 year ago) parent47b50d4
4 files changed+54−14
README.md+22 internal/agent/coordinator.go+6 internal/config/config.go+9−8 schema.json+17−6
README.md+22
@@ -275,6 +275,7 @@ using `$(echo $VAR)` syntax.
275275 "args": ["/path/to/mcp-server.js"],
276276 "timeout": 120,
277277 "disabled": false,
278+ "disabled_tools": ["some-tool-name"],
278279 "env": {
279280 "NODE_ENV": "production"
280281 }
@@ -284,6 +285,7 @@ using `$(echo $VAR)` syntax.
284285 "url": "https://api.githubcopilot.com/mcp/",
285286 "timeout": 120,
286287 "disabled": false,
288+ "disabled_tools": ["create_issue", "create_pull_request"],
287289 "headers": {
288290 "Authorization": "Bearer $GH_PAT"
289291 }
@@ -335,6 +337,26 @@ permissions. Use this with care.
335337You can also skip all permission prompts entirely by running Crush with the
336338`--yolo` flag. Be very, very careful with this feature.
337339
340+### Disabling Built-In Tools
341+
342+If you'd like to prevent Crush from using certain built-in tools entirely, you
343+can disable them via the `options.disabled_tools` list. Disabled tools are
344+completely hidden from the agent.
345+
346+```json
347+{
348+ "$schema": "https://charm.land/crush.json",
349+ "options": {
350+ "disabled_tools": [
351+ "bash",
352+ "sourcegraph"
353+ ]
354+ }
355+}
356+```
357+
358+To disable tools from MCP servers, see the [MCP config section](#mcps).
359+
338360### Initialization
339361
340362When you initialize a project, Crush analyzes your codebase and creates
internal/agent/coordinator.go+6
@@ -388,6 +388,12 @@ func (c *coordinator) buildTools(ctx context.Context, agent config.Agent) ([]fan
388388 }
389389
390390 for _, tool := range tools.GetMCPTools(c.permissions, c.cfg.WorkingDir()) {
391+ // Check MCP-specific disabled tools.
392+ if mcpCfg, ok := c.cfg.MCP[tool.MCP()]; ok {
393+ if slices.Contains(mcpCfg.DisabledTools, tool.MCPToolName()) {
394+ continue
395+ }
396+ }
391397 if agent.AllowedMCP == nil {
392398 // No MCP restrictions
393399 filteredTools = append(filteredTools, tool)
internal/config/config.go+9−8
@@ -144,13 +144,14 @@ const (
144144)
145145
146146type MCPConfig struct {
147− Command string `json:"command,omitempty" jsonschema:"description=Command to execute for stdio MCP servers,example=npx"`
148− Env map[string]string `json:"env,omitempty" jsonschema:"description=Environment variables to set for the MCP server"`
149− Args []string `json:"args,omitempty" jsonschema:"description=Arguments to pass to the MCP server command"`
150− Type MCPType `json:"type" jsonschema:"required,description=Type of MCP connection,enum=stdio,enum=sse,enum=http,default=stdio"`
151− URL string `json:"url,omitempty" jsonschema:"description=URL for HTTP or SSE MCP servers,format=uri,example=http://localhost:3000/mcp"`
152− Disabled bool `json:"disabled,omitempty" jsonschema:"description=Whether this MCP server is disabled,default=false"`
153− Timeout int `json:"timeout,omitempty" jsonschema:"description=Timeout in seconds for MCP server connections,default=15,example=30,example=60,example=120"`
147+ Command string `json:"command,omitempty" jsonschema:"description=Command to execute for stdio MCP servers,example=npx"`
148+ Env map[string]string `json:"env,omitempty" jsonschema:"description=Environment variables to set for the MCP server"`
149+ Args []string `json:"args,omitempty" jsonschema:"description=Arguments to pass to the MCP server command"`
150+ Type MCPType `json:"type" jsonschema:"required,description=Type of MCP connection,enum=stdio,enum=sse,enum=http,default=stdio"`
151+ URL string `json:"url,omitempty" jsonschema:"description=URL for HTTP or SSE MCP servers,format=uri,example=http://localhost:3000/mcp"`
152+ Disabled bool `json:"disabled,omitempty" jsonschema:"description=Whether this MCP server is disabled,default=false"`
153+ DisabledTools []string `json:"disabled_tools,omitempty" jsonschema:"description=List of tools from this MCP server to disable,example=get-library-doc"`
154+ Timeout int `json:"timeout,omitempty" jsonschema:"description=Timeout in seconds for MCP server connections,default=15,example=30,example=60,example=120"`
154155
155156 // TODO: maybe make it possible to get the value from the env
156157 Headers map[string]string `json:"headers,omitempty" jsonschema:"description=HTTP headers for HTTP/SSE MCP servers"`
@@ -221,7 +222,7 @@ type Options struct {
221222 DebugLSP bool `json:"debug_lsp,omitempty" jsonschema:"description=Enable debug logging for LSP servers,default=false"`
222223 DisableAutoSummarize bool `json:"disable_auto_summarize,omitempty" jsonschema:"description=Disable automatic conversation summarization,default=false"`
223224 DataDirectory string `json:"data_directory,omitempty" jsonschema:"description=Directory for storing application data (relative to working directory),default=.crush,example=.crush"` // Relative to the cwd
224− DisabledTools []string `json:"disabled_tools" jsonschema:"description=Tools to disable"`
225+ DisabledTools []string `json:"disabled_tools,omitempty" jsonschema:"description=List of built-in tools to disable and hide from the agent,example=bash,example=sourcegraph"`
225226 DisableProviderAutoUpdate bool `json:"disable_provider_auto_update,omitempty" jsonschema:"description=Disable providers auto-update,default=false"`
226227 Attribution *Attribution `json:"attribution,omitempty" jsonschema:"description=Attribution settings for generated content"`
227228 DisableMetrics bool `json:"disable_metrics,omitempty" jsonschema:"description=Disable sending metrics,default=false"`
schema.json+17−6
@@ -229,6 +229,16 @@
229229 "description": "Whether this MCP server is disabled",
230230 "default": false
231231 },
232+ "disabled_tools": {
233+ "items": {
234+ "type": "string",
235+ "examples": [
236+ "get-library-doc"
237+ ]
238+ },
239+ "type": "array",
240+ "description": "List of tools from this MCP server to disable"
241+ },
232242 "timeout": {
233243 "type": "integer",
234244 "description": "Timeout in seconds for MCP server connections",
@@ -386,10 +396,14 @@
386396 },
387397 "disabled_tools": {
388398 "items": {
389− "type": "string"
399+ "type": "string",
400+ "examples": [
401+ "bash",
402+ "sourcegraph"
403+ ]
390404 },
391405 "type": "array",
392− "description": "Tools to disable"
406+ "description": "List of built-in tools to disable and hide from the agent"
393407 },
394408 "disable_provider_auto_update": {
395409 "type": "boolean",
@@ -418,10 +432,7 @@
418432 }
419433 },
420434 "additionalProperties": false,
421− "type": "object",
422− "required": [
423− "disabled_tools"
424− ]
435+ "type": "object"
425436 },
426437 "Permissions": {
427438 "properties": {