Skip to content

feat(orchestrator): give spec.mcp.servers tool filters and a timeout - #332

Merged
edenreich merged 1 commit into
mainfrom
feat/orchestrator-mcp-tool-filters
Nov 9, 2026
Merged

edenreich merged 1 commit into
mainfrom
feat/orchestrator-mcp-tool-filters

Conversation

@edenreich

@edenreich edenreich commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Summary

An Orchestrator MCP server now narrows and bounds what the pod gets from it, as a server in the CLI's own mcp.yaml can:

  • spec.mcp.servers[].includeTools limits the pod to the listed tools, named as the server lists them.
  • spec.mcp.servers[].excludeTools hides the listed tools. When both are set, includeTools wins, as it does in the CLI.
  • spec.mcp.servers[].timeoutSeconds bounds one request to the server. It must be at least 1, and unset the pod's default applies.

The pod's mcp.yaml carries them under the CLI's keys, include_tools, exclude_tools and timeout, and leaves out the unset ones. mcpYAMLServer now names the CLI's keys itself instead of embedding OrchestratorMCPServer, whose camelCase names the CLI does not read. A change to any of them rolls the pod through the mcps-config-hash annotation, like any other server change.

  • examples/orchestrator/05-orchestrator.yaml gives time-direct only get_time and a 10s timeout. The discovered time server keeps both of its tools.
  • The README's Orchestrator MCP section documents the three fields with an example. The infer image it already requires (v0.248.0) reads them: the CLI has read include_tools since v0.79.0 and applied the per-server timeout since v0.216.0.

Closes #331

Verification

  • task test passes, with a case that strict-decodes the rendered mcp.yaml into the CLI's keys, so a field written under its API name fails it.
  • On a k3d cluster with the controller running from this branch, an Orchestrator with includeTools: [get_time] and timeoutSeconds: 10 against the example time server:
    • its ConfigMap held include_tools: [get_time] and timeout: 10.
    • infer mcp list (v0.249.0) in the pod showed Timeout 10s and time-direct include: get_time.
    • swapping the filter for excludeTools: [convert_time] changed the mcps-config-hash, rolled the pod, and the new pod's infer mcp list showed time-direct exclude: convert_time.
    • timeoutSeconds: -1 is refused as below the minimum.
  • Every manifest under examples/ passes a server dry run against the regenerated CRDs.

The pod's filtering itself was not exercised: infer tools execute does not start MCP servers, and an agent turn needs a model gateway. The CLI's tests cover it (MCPTool.IsEnabled with include and exclude lists).

Cross-repo impact

An Orchestrator MCP server takes includeTools, excludeTools and
timeoutSeconds. The pod's mcp.yaml carries them under the CLI's keys,
include_tools, exclude_tools and timeout, so the pod gets only the tools a
server is narrowed to and bounds each request to it. includeTools wins over
excludeTools, and an unset timeout keeps the pod's default.

mcpYAMLServer now names the CLI's keys itself instead of embedding the API
type, whose camelCase names the CLI does not read.
@edenreich
edenreich requested a review from a team as a code owner November 8, 2026 23:39
@edenreich
edenreich merged commit 9fd2f47 into main Nov 9, 2026
1 check passed
@edenreich
edenreich deleted the feat/orchestrator-mcp-tool-filters branch November 9, 2026 00:02
inference-gateway-releaser Bot added a commit that referenced this pull request Nov 9, 2026
## [0.34.0](v0.33.0...v0.34.0) (2026-11-09)

### ✨ Features

* **orchestrator:** give spec.mcp.servers tool filters and a timeout ([#332](#332)) ([9fd2f47](9fd2f47))
@inference-gateway-releaser

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.34.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@inference-gateway-releaser inference-gateway-releaser Bot added the released Shipped in a release label Nov 9, 2026
edenreich added a commit to inference-gateway/cli that referenced this pull request Nov 9, 2026
…pods (#1774)

## Summary

A Kubernetes workspace wrote each of its `mcp_servers` into the
session's Orchestrator with only its name, URL and headers. A server's
`include_tools`, `exclude_tools` and `timeout` applied on this machine
but not in the pod, so a server narrowed to two tools exposed every tool
once a session moved to the cluster. Operator v0.34.0 takes them
(inference-gateway/operator#332), and the workspace now forwards them:

- `include_tools` and `exclude_tools` go into the Orchestrator as
`includeTools` and `excludeTools`, as written.
- `timeout` goes in as `timeoutSeconds` when it is above 0. The CLI
treats 0 or less as unset, and the operator refuses anything below 1, so
those stay unset.
- A server with none of them is written exactly as before.

Each entry is built from the operator's `OrchestratorMCPServer` type and
converted with `DefaultUnstructuredConverter`, so its field names come
from the operator's API instead of copied strings. `go.mod` moves the
operator module from v0.33.0 to v0.34.0 for the new fields.

The "may predate ..., upgrade it" error of a workspace with
`mcp_servers` names v0.34.0, and `binding_service` alone still names
v0.33.0. This is simpler than the issue's split by whether a server sets
a filter: a workspace whose servers set none still runs on v0.33.0,
since its Orchestrator carries no new field, and the version only shows
in the error of a create the operator already refused.

- `docs/daemon.md` says the pods get a server's tool filters and timeout
and that they need operator v0.34.0, with v0.33.0 still enough for a
server without them.
- `examples/session-teleport` gives the `k8s-mcp` workspace's demo
server `include_tools: [get_time, calculate]`, so the pod gets none of
its file and environment tools, and its walkthrough installs operator
v0.34.0.

Closes #1773

## Verification

- `task test` passes, with a case that forwards a server's tool filters
and a 10s timeout and drops a negative timeout.
- The Orchestrators the workspace builds, one with a filtered server and
one with headers only, were dumped and dry-run with strict field
validation on a k3d cluster:
  - against operator v0.34.0's CRDs, both are accepted.
- against operator v0.33.0's CRDs, the one without filters is accepted
and the filtered one is refused with `BadRequest`, which `create`
reports as the upgrade error.
- `task precommit:run` passes.
- `task test:e2e` passes.

## Cross-repo impact

- docs: inference-gateway/docs#1152 documents the forwarded settings.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released Shipped in a release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Orchestrator MCP servers carry tool filters and a timeout

1 participant