feat: add allow/block-list of servers to the mcp_catalog tool#2928
Merged
Conversation
docker-agent
left a comment
There was a problem hiding this comment.
Assessment: 🟢 APPROVE
The allow/block-list filtering implementation for mcp_catalog is correct and well-structured. Core logic is sound: block-list takes precedence over allow-list, filtering runs at construction time (no shared-state mutation), unknown server IDs emit a warning at startup, and config validation rejects empty/whitespace entries. Wiring through registry.go and the schema update are both correct. All changes are backward compatible.
Low-severity observations (no action required, noted for awareness):
toIDSetnil-vs-empty-map contract (mcpcatalog.go:237):toIDSet(nil)returnsnilwhiletoIDSet([]string{" "})returns a non-nil empty map. Callers gate onlen(set) > 0so observable behavior is identical today. Validation already rejects whitespace entries upstream, making this path unreachable in production—safe but subtly inconsistent.TestSearchRespectsAllowListsubstring risk (mcpcatalog_test.go:324): The test verifies that searching for the dropped server's ID returns an error. If that ID becomes a substring of an allowed server's title or description as the embedded catalog evolves, the test could produce a false pass. Low risk given the test's controlled server IDs, but worth watching.- Noisy warnings for future-proofed block-lists (
mcpcatalog.go:175): IDs inblocked_serversthat don't exist in today's catalog generate aslog.Warn—intentional for catching typos, but could be noisy for operators who proactively block anticipated-future server IDs.
aheritier
approved these changes
May 29, 2026
rumpl
reviewed
May 29, 2026
| - hugging-face | ||
| - gitmcp | ||
| # ...minus any explicitly blocked one (block wins over allow). | ||
| blocked_servers: |
Member
There was a problem hiding this comment.
This is a bad example because blocked_servers doesn't do anything here since only the allowed ones are allowed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
mcp_catalogbuiltin tool now supports allow-listing and block-listing of MCP servers. This lets agents enforce a curated set of available integrations and prevent access to specific servers—useful for compliance, security policies, or ensuring a focused set of tools in multi-agent deployments.Configuration is straightforward: set
allowed_servers(optional) to whitelist specific catalog server IDs, andblocked_servers(optional) to exclude them. Block-list takes precedence if a server appears in both. Filtering applies to all catalog operations: search, enable, andreset_auth. Empty or whitespace-only entries are rejected at validation time, and a warning is logged if a configuration references unknown server IDs, helping catch typos early.An example configuration can be found in
examples/mcp_catalog_filtered.yaml. All changes are backward compatible—existing configurations without these fields work unchanged.