Skip to content

Tools filtering #62

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Tools filtering #62

wants to merge 5 commits into from

Conversation

Daniel-Kolev
Copy link
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
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
Contributor Author

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?

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.

1 participant