Follow-up to #2412, which introduced per-server element filtering in the MCP bundle. Raised by @Toflar there, parked so the PR could land.
The use case
Filtering currently takes service ids, FQCNs, namespace prefixes and *:
mcp:
servers:
public:
http: { path: /mcp }
tools: ['App\Mcp\Public\']
That works when the tools of one server happen to share a namespace. It does not when they are spread across several vendor namespaces, which is the normal case as soon as bundles start shipping tools. @Toflar's proposal is to group by tag instead:
#[McpTool(name: 'current-time', tags: ['foo', 'bar'])]
mcp:
servers:
public:
http: { path: /mcp }
tools: ['foo']
Beyond namespaces, this would let an application tag a third-party tool into a server from a compiler pass, without touching the vendor code.
The open question
@OskarStark's objection is the thing to solve first: nothing makes a tag unique across vendors. foo from two bundles is the same string, whereas an FQCN or a namespace prefix is unambiguous by construction. A tag design therefore needs a naming convention, or a scoping rule, before it is safe to expose.
Worth deciding:
- Whether tags are namespaced by convention (
acme/public) or scoped to the declaring bundle.
- What happens on a collision: union, error, or last one wins.
- Whether a tag can be added from a compiler pass to a tool it does not own, which is the extensibility half of the request.
Why it can wait
The config node is a heterogeneous scalar list, so a tag form can be added additively later, for example as #foo or tag:foo, without changing the meaning of any existing value and without a second BC break. Nothing in #2412 forecloses this.
Follow-up to #2412, which introduced per-server element filtering in the MCP bundle. Raised by @Toflar there, parked so the PR could land.
The use case
Filtering currently takes service ids, FQCNs, namespace prefixes and
*:That works when the tools of one server happen to share a namespace. It does not when they are spread across several vendor namespaces, which is the normal case as soon as bundles start shipping tools. @Toflar's proposal is to group by tag instead:
Beyond namespaces, this would let an application tag a third-party tool into a server from a compiler pass, without touching the vendor code.
The open question
@OskarStark's objection is the thing to solve first: nothing makes a tag unique across vendors.
foofrom two bundles is the same string, whereas an FQCN or a namespace prefix is unambiguous by construction. A tag design therefore needs a naming convention, or a scoping rule, before it is safe to expose.Worth deciding:
acme/public) or scoped to the declaring bundle.Why it can wait
The config node is a heterogeneous scalar list, so a tag form can be added additively later, for example as
#fooortag:foo, without changing the meaning of any existing value and without a second BC break. Nothing in #2412 forecloses this.