Visitar URL original
feat: Serve the MCP server dual-stack on --host :: by dbbvitor · Pull Request #6977 · feast-dev/feast · GitHub
Skip to content

feat: Serve the MCP server dual-stack on --host :: - #6977

Open
dbbvitor wants to merge 1 commit into
feast-dev:masterfrom
dbbvitor:feat/mcp-dual-stack
Open

dbbvitor wants to merge 1 commit into
feast-dev:masterfrom
dbbvitor:feat/mcp-dual-stack

Conversation

@dbbvitor

@dbbvitor dbbvitor commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

feast mcp --host :: did not serve IPv4 and IPv6 clients correctly:

  • uvicorn (default): uvicorn.run(host="::") makes asyncio set IPV6_V6ONLY=1, so the server becomes IPv6-only and silently drops IPv4 clients. It now pre-binds a dual-stack socket with feast.utils._make_dual_stack_socket, the same approach fix: Bind metrics, REST registry, ui, and lineage servers dual-stack #6886 used for the ui and lineage servers.
  • gunicorn (--workers): the bind string was f"{host}:{port}", so :: produced the invalid :::8000. A new _gunicorn_bind() turns :: into [::] (dual-stack; checked with a real gunicorn serving 127.0.0.1 and ::1), or 0.0.0.0 where IPv6 is unavailable.

The default host stays 0.0.0.0; nothing changes unless --host :: (or server.host: "::" in feast_mcp.yaml) is set. Docs updated.

The Operator half (rendering --host :: for mcpServer.dualStack: true) is a separate follow-up that depends on #6887.

Which issue(s) this PR fixes:

Part of #6862 (don't let this auto-close the issue on merge).

Checks

  • I've made sure the tests are passing.
  • My commits are signed off (git commit -s)
  • My PR title follows conventional commits format

Testing Strategy

  • Unit tests

Misc

New unit tests in sdk/python/tests/unit/mcp/test_dual_stack.py (uvicorn dual-stack socket, the plain-run fallback for other hosts, and four gunicorn bind cases).

@dbbvitor
dbbvitor requested a review from a team as a code owner October 8, 2026 13:03
@codecov-commenter

codecov-commenter commented Oct 8, 2026 •

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 49.93%. Comparing base (66c55e3) to head (c6418f6).
⚠️ Report is 2 commits behind head on master.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #6977   +/-   ##
=======================================
  Coverage   49.93%   49.93%           
=======================================
  Files         443      443           
  Lines       55498    55496    -2     
  Branches     8095     8095           
=======================================
  Hits        27711    27711           
+ Misses      25864    25862    -2     
  Partials     1923     1923           
Flag Coverage Δ *Carryforward flag
go-feature-server 30.58% <ø> (ø)
python-unit 51.36% <ø> (+<0.01%) ⬆️ Carriedforward from 66c55e3

*This pull request uses carry forward flags. Click here to find out more.

Files with missing lines Coverage Δ
sdk/python/feast/mcp/server.py 37.62% <ø> (+0.73%) ⬆️

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 66c55e3...c6418f6. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

dbbvitor added a commit to dbbvitor/feast that referenced this pull request Oct 8, 2026
Route the MCP --host through withBindHost, so mcpServer.dualStack renders :: instead of 0.0.0.0. The MCP server itself needs feast mcp --host :: support (feast-dev#6977).

Signed-off-by: dbbvitor <vitor.diniz@gympass.com>
ntkathole added a commit that referenced this pull request Oct 9, 2026
* feat: Add dualStack server option to the Feast operator

Add a DualStack field to ServerConfigs that binds server processes to
the IPv6 wildcard address instead of 0.0.0.0, so they also accept IPv4
clients on dual-stack or IPv6-only clusters. Online and offline servers
use the bracketed [::] form required by gunicorn and Arrow Flight; ui,
lineage, and registry keep their existing behavior or use the bare ::
form uvicorn expects. The registry server always binds dual-stack and
ignores this setting.

Signed-off-by: dbbvitor <vitor.diniz@gympass.com>

* test: Cover -h boundary positions in withBindHost

Mutation testing found survivors in withBindHost's loop bounds: an -h
flag as the very last argument (no value to replace) and one as the
first argument were both untested edge cases.

Signed-off-by: dbbvitor <vitor.diniz@gympass.com>

* fix: Let the registry opt out of its dual-stack REST bind

The registry's REST server binds dual-stack by default in the SDK
CLI. Render -h 0.0.0.0 only when the shared DualStack field is
explicitly set to false, so nil/true keep today's dual-stack default
instead of silently going IPv4-only.

Signed-off-by: dbbvitor <vitor.diniz@gympass.com>

* chore: Refresh secrets baseline timestamp to match master

Only the generated_at metadata field diverged from master, which was
enough for GitHub to report this PR as unmergeable and apparently
skip queuing CI. No scan content changed.

Signed-off-by: dbbvitor <vitor.diniz@gympass.com>

* fix(operator): Make default registry REST to IPv4 and dualStack opt-in

Make unset or false dualStack render an explicit 0.0.0.0 host flag.
Only dualStack=true selects the bare IPv6 wildcard, aligning
registry REST defaults with other host-flag servers.

Signed-off-by: dbbvitor <vitor.diniz@gympass.com>

* feat: Bind the standalone MCP server dual-stack with dualStack

Route the MCP --host through withBindHost, so mcpServer.dualStack renders :: instead of 0.0.0.0. The MCP server itself needs feast mcp --host :: support (#6977).

Signed-off-by: dbbvitor <vitor.diniz@gympass.com>

---------

Signed-off-by: dbbvitor <vitor.diniz@gympass.com>
Co-authored-by: Nikhil Kathole <nikhilkathole2683@gmail.com>
@ntkathole
ntkathole force-pushed the feat/mcp-dual-stack branch from a85785f to bd07723 Compare October 9, 2026 07:28
@ntkathole
ntkathole force-pushed the feat/mcp-dual-stack branch from bd07723 to 53b793b Compare October 9, 2026 07:48
@ntkathole
ntkathole force-pushed the feat/mcp-dual-stack branch from 53b793b to 0779d7a Compare October 9, 2026 08:37
feast mcp now takes --host :: and serves IPv4 and IPv6: a pre-bound dual-stack socket for uvicorn (as for ui and lineage), [::] for gunicorn.

Signed-off-by: dbbvitor <vitor.diniz@gympass.com>
@ntkathole
ntkathole force-pushed the feat/mcp-dual-stack branch from 0779d7a to c6418f6 Compare October 9, 2026 09:11

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants