Skip to content

Tools filtering#62

Merged
Daniel-Kolev merged 10 commits intomainfrom
enable-disable-tools
Jul 30, 2025
Merged

Tools filtering#62
Daniel-Kolev merged 10 commits intomainfrom
enable-disable-tools

Conversation

@Daniel-Kolev
Copy link
Copy Markdown
Contributor

@Daniel-Kolev Daniel-Kolev commented Jul 18, 2025

What I did

Tool filtering

Add new commands: docker mcp tools enable <toolName> and docker mcp tools disable <toolName>. They auto-discover the first matching server using the catalog. Also they accept a --server flag. It helps with duplicate tool names where the auto-discover might fail to find the server the user wants.

The enabled tools are stored in a tools.yaml file which contains all the enabled tools grouped by server. Example file:

curl: []
filesystem:
  - directory_tree
  - get_file_info
  - list_allowed_directories
  - list_directory
  - read_file
  - read_multiple_files
  - search_files

read as:

curl has all of its tools disabled
filesystem has some of its tools enabled
if a server is not mentioned in the file, then all of its tools are enabled

The gateway reads and respects this file. When launching the gateway, the existing --tools option (which accepts the tools names) takes precedence over the tools.yaml file. This works the same way as the --servers option and the registry.yaml.

Nice to haves:

  • remove the server entry in the tools.yaml if all of the server's tools are enabled
  • report if duplicate tools exist in the catalog and prompt the user to use the --server flag

Related issue

(not mandatory) A picture of a cute animal, if possible in relation to what you did

@Daniel-Kolev Daniel-Kolev requested a review from a team as a code owner July 18, 2025 13:51
Copy link
Copy Markdown
Contributor Author

@Daniel-Kolev Daniel-Kolev Jul 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could probably give this file a bit more love but this should be good enough for a first iteration of tool filtering

@Daniel-Kolev
Copy link
Copy Markdown
Contributor Author

Daniel-Kolev commented Jul 18, 2025

Something I haven't discussed with anyone but want to do is:
Add an "enabled" attribute under each tool in so we could know which tool is enabled/disabled in clients like Docker Desktop. At a first glance, the most appropriate place is docker mcp server inspect which is also what we currently use to list the tools in Docker Desktop. Any thoughts?

EDIT1: We might need another approach if we want to show just the enabled tools count in the servers tab table or the count in the Tools tab when viewing a server

@dgageot
Copy link
Copy Markdown
Member

dgageot commented Jul 28, 2025

Hey @cmrigney, I didn't have time to look at Daniel's PR. Could you? Thanks!

Copy link
Copy Markdown
Contributor

@cmrigney cmrigney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice addition! lgtm, just left a couple optional suggestions.

@Daniel-Kolev Daniel-Kolev merged commit 5722077 into main Jul 30, 2025
8 checks passed
@Daniel-Kolev Daniel-Kolev deleted the enable-disable-tools branch July 30, 2025 12:49
null-runner pushed a commit to null-runner/mcp-gateway that referenced this pull request Dec 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants