Skip to content

fix(mcp): default available_on_public_internet to true#22331

Merged
ishaan-jaff merged 4 commits intomainfrom
litellm_mcp_public_default
Feb 28, 2026
Merged

fix(mcp): default available_on_public_internet to true#22331
ishaan-jaff merged 4 commits intomainfrom
litellm_mcp_public_default

Conversation

@ishaan-jaff
Copy link
Member

@ishaan-jaff ishaan-jaff commented Feb 28, 2026

Relevant issues

Default Toggle

image

Pre-Submission checklist

  • I have Added testing in the tests/litellm/ directory, Adding at least 1 test is a hard requirement - see details
  • My PR passes all unit tests on make test-unit
  • My PR's scope is as isolated as possible, it only solves 1 specific problem
  • I have requested a Greptile review by commenting @greptileai and received a Confidence Score of at least 4/5 before requesting a maintainer review

CI (LiteLLM team)

  • Branch creation CI run
    Link:

  • CI run for the last commit
    Link:

  • Merge / cherry-pick CI run
    Links:

Type

🐛 Bug Fix

Changes

available_on_public_internet was defaulting to false, making all new MCP servers private by default. This was a breaking change — servers created via the UI or YAML config would silently be invisible to external callers.

Changed the default to true in:

  • _types.pyAddMCPServerRequest, UpdateMCPServerRequest, LiteLLM_MCPServerTable
  • schema.prisma@default(false)@default(true) for new DB rows
  • mcp_server_manager.py — YAML config fallback and DB loading fallback
  • MCPPermissionManagement.tsx — form initialValue and setFieldValue defaults

MCPs were defaulting to private (available_on_public_internet=false) which
was a breaking change. This reverts the default to public (true) across:
- Pydantic models (AddMCPServerRequest, UpdateMCPServerRequest, LiteLLM_MCPServerTable)
- Prisma schema @default
- mcp_server_manager.py YAML config + DB loading fallbacks
- UI form initialValue and setFieldValue defaults
@vercel
Copy link

vercel bot commented Feb 28, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
litellm Ready Ready Preview, Comment Feb 28, 2026 4:00am

Request Review

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 28, 2026

Greptile Summary

This PR changes the default value of available_on_public_internet from false to true for MCP servers across the entire stack — Pydantic models, Prisma schemas, YAML config fallbacks, DB loading fallbacks, and the UI form. This reverts what was effectively a breaking change: previously, newly created MCP servers were private by default, silently making them invisible to external callers (e.g., ChatGPT) unless explicitly toggled. The PR also includes unrelated model pricing updates (new OpenAI audio/realtime models, OpenRouter entries, xAI deprecation dates, publicai function-calling corrections).

  • All three Prisma schema copies are now in sync at @default(true)
  • MCPServer, NewMCPServerRequest, UpdateMCPServerRequest, and LiteLLM_MCPServerTable Pydantic models all default to True
  • YAML config and DB-loading fallback paths in mcp_server_manager.py updated to True
  • UI form defaults and forceRender on the Collapse.Panel ensure the toggle renders with the correct initial state
  • Note: Existing DB rows that were created with available_on_public_internet=false (from the previous default) will remain false — this PR does not include a data migration to flip them, which is the correct conservative approach
  • Missing: No new tests were added covering the default-value change, which doesn't meet the PR checklist requirement

Confidence Score: 4/5

  • This PR is safe to merge — it restores the intended default behavior for MCP server visibility and all schema copies are now in sync.
  • The change is straightforward and consistent across all layers (DB schema, Pydantic models, manager fallbacks, UI). All three Prisma schema copies are in sync. The only concern is the lack of tests covering the new defaults, which the PR checklist explicitly requires.
  • No files require special attention — the changes are simple default-value flips that are consistent across the stack.

Important Files Changed

Filename Overview
litellm/proxy/_types.py Changed default of available_on_public_internet from False to True in NewMCPServerRequest, UpdateMCPServerRequest, and LiteLLM_MCPServerTable — aligns all Pydantic models with the new default-public behavior.
litellm/types/mcp_server/mcp_server_manager.py Changed MCPServer model default for available_on_public_internet from False to True, consistent with the other type definitions.
litellm/proxy/_experimental/mcp_server/mcp_server_manager.py Updated fallback defaults for available_on_public_internet in YAML config loading and DB loading paths from False to True.
litellm/proxy/schema.prisma Changed Prisma @default(false) to @default(true) for available_on_public_internet column in LiteLLM_MCPServerTable.
schema.prisma Root schema copy updated to @default(true) for available_on_public_internet, now in sync with the other copies.
litellm-proxy-extras/litellm_proxy_extras/schema.prisma Proxy-extras schema copy updated to @default(true) for available_on_public_internet, now in sync with the other copies.
ui/litellm-dashboard/src/components/mcp_tools/MCPPermissionManagement.tsx Updated UI defaults to true for available_on_public_internet and added forceRender to Collapse.Panel so toggle defaults render correctly even before panel expansion.
litellm/model_prices_and_context_window_backup.json Added new model entries (gpt-audio-1.5, gpt-realtime-1.5, openrouter/anthropic/claude-opus-4.6, openrouter/openrouter/auto

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[MCP Server Created] --> B{Source?}
    B -->|UI Form| C[MCPPermissionManagement.tsx\ninitialValue: true]
    B -->|API Request| D[NewMCPServerRequest\ndefault: True]
    B -->|YAML Config| E[mcp_server_manager.py\nfallback: True]
    B -->|DB Row| F[schema.prisma\ndefault true]
    C --> G[MCPServer Model\navailable_on_public_internet: True]
    D --> G
    E --> G
    F --> G
    G --> H{External Client IP?}
    H -->|Internal IP| I[Access Allowed]
    H -->|Public IP| J{available_on_public_internet?}
    J -->|true - default| K[Access Allowed]
    J -->|false - explicit| L[Access Blocked]
Loading

Last reviewed commit: afe86bd

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

8 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 28, 2026

Additional Comments (1)

litellm/types/mcp_server/mcp_server_manager.py
Missed default update in MCPServer class

The MCPServer class in this file still has available_on_public_internet: bool = False, but all other type definitions (NewMCPServerRequest, UpdateMCPServerRequest, LiteLLM_MCPServerTable) were updated to default to True in this PR. This inconsistency means that when an MCPServer object is constructed without explicitly setting this field (e.g., via build_mcp_server_from_table if getattr returns the default), the MCPServer instance will default to False — contradicting the intent of this change.

    available_on_public_internet: bool = True

…correctly

Ant Design's Collapse.Panel lazy-renders children by default. Without
forceRender, the Form.Item for 'Available on Public Internet' isn't
mounted when the useEffect fires form.setFieldValue, causing the Switch
to visually show OFF even though the intended default is true.

Co-authored-by: Ishaan Jaff <ishaan-jaff@users.noreply.github.com>
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ ishaan-jaff
❌ cursoragent
You have signed the CLA already but the status is still pending? Let us recheck it.

…o true

Missed in previous commit per Greptile review:
- schema.prisma (root)
- litellm-proxy-extras/litellm_proxy_extras/schema.prisma
- litellm/types/mcp_server/mcp_server_manager.py MCPServer class
@ishaan-jaff
Copy link
Member Author

Migration script for existing deployments

If you upgraded to a version where available_on_public_internet defaulted to false, run this against your DB to restore public visibility for all MCP servers that were never explicitly set to private:

-- Set all MCP servers to public that were created after the breaking change
-- (i.e. they have available_on_public_internet=false but were not intentionally set that way)
-- Safe to run — only flips servers that are currently false back to true.
-- If you have servers you INTENTIONALLY set to private, exclude them by server_id first.

UPDATE "LiteLLM_MCPServerTable"
SET available_on_public_internet = true
WHERE available_on_public_internet = false;

Or via Python/Prisma if you prefer:

import asyncio
from litellm.proxy.db.prisma_client import prisma_client

async def migrate():
    await prisma_client.connect()
    updated = await prisma_client.db.litellm_mcpservertable.update_many(
        where={"available_on_public_internet": False},
        data={"available_on_public_internet": True},
    )
    print(f"Updated {updated.count} MCP servers to public")
    await prisma_client.disconnect()

asyncio.run(migrate())

Run this once after upgrading to this fix. Servers you explicitly want private can be flipped back via the UI or API afterward.

ishaan-jaff added a commit that referenced this pull request Feb 28, 2026
Fixes breaking change where new MCP servers were private by default,
causing k8s/cross-cluster deployments to have their servers silently
stripped by IP filtering.

Changes all defaults to true across:
- litellm/proxy/_types.py (3 Pydantic models)
- litellm/types/mcp_server/mcp_server_manager.py (MCPServer class)
- litellm/proxy/schema.prisma + schema.prisma + litellm-proxy-extras schema
- mcp_server_manager.py YAML + DB loading fallbacks
- UI MCPPermissionManagement.tsx form defaults

See migration script in #22331 for
existing deployments that need to flip existing servers back to public.
@ishaan-jaff
Copy link
Member Author

@greptileai review

Replace scary 'Available on Public Internet' toggle with 'Internal network only'
opt-in restriction. Toggle OFF (default) = all networks allowed. Toggle ON =
restricted to internal network only. Auth is always required either way.

- MCPPermissionManagement: new label/tooltip/description, invert display via
  getValueProps/getValueFromEvent so underlying available_on_public_internet
  value is unchanged
- mcp_server_view: 'Public' → 'All networks', 'Internal' → 'Internal only' (orange)
- mcp_server_columns: same badge updates
@ishaan-jaff ishaan-jaff merged commit eea083f into main Feb 28, 2026
31 of 35 checks passed
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.

3 participants