docs: refresh MCP preview evidence at the final tip

This commit is contained in:
Joshua Valluru 2026-09-09 18:15:41 -07:00
parent 38bf963826
commit 3b3f004e2e
20 changed files with 335 additions and 145 deletions

View file

@ -21,6 +21,8 @@ The hidden server tools tab can retry GET requests against the broken saved reco
## Checks
regression-tests.log: 125 dashboard tests pass. backend-tests.log: 131 mapped REST endpoint tests pass. The corresponding before logs demonstrate four failing UI regressions and seven failing backend cases at the merge base
regression-tests.log: 129 dashboard tests pass. backend-tests.log: 139 mapped REST endpoint tests pass. The corresponding before logs demonstrate four failing UI regressions and ten failing backend cases at the merge base
check-final.log: full make check passes, including Ruff formatting/lint, test-tree lint, strict-rule, type-discipline, test-quality, basedpyright budget, dashboard lint budgets and generated API type sync. ui-build.log: production dashboard build passes. Full backend suites are left to CI
verify-origin.py checks live host-change credential handling. origin-boundary.json records zero UI preview requests before credential entry, followed by a successful tool list after explicit entry

View file

@ -1,17 +1,18 @@
# Local test results for LIT-7135
# LIT-7135 verification results
- 125 affected dashboard tests passed: edit preview rules, edit form integration and existing OAuth cases, tool configuration
- Four new dashboard integration cases fail against merge base 6b721de3e530bc97758d59621e57e3a75a9ebadf: corrected Basic Auth, corrected static header, rapid URL edits with stale responses, saved-response races and reverting changes
- 131 tests passed in tests/test_litellm/proxy/_experimental/mcp_server/test_rest_endpoints.py, including seven new cases that exercise real MCP client configuration and the saved-server registry
- The seven backend regressions fail at the merge base: the client uses the saved URL, HTTP transport and Basic scheme despite the edited SSE configuration and auth choice
- Production Next.js build passed; Docker source builds compile the dashboard too
- Full Ruff, test-tree lint, strict-rule, type-discipline, test-quality and basedpyright gates passed against the merge base, in Python 3.12 with proxy-dev/e2e-dev and a generated Prisma client
- Dashboard formatting, ESLint and whole-dashboard warning budgets pass without increasing budgets
Final tip: 493c98f9bffbcf2ea1d5ba30e324427daa9a173b
Merge base: 6b721de3e530bc97758d59621e57e3a75a9ebadf
Live before/after evidence and final check logs are attached separately. The fixture is an actual MCP SDK server over HTTP, with a Basic credential or X-Preview-Key header requirement. Its rejection uses HTTP 403 so browser HTTP-auth prompts do not intercept fetch requests. No mocks or model calls are used in this live test.
129 affected dashboard tests pass. 139 tests in the mapped backend REST endpoint file pass. Four new UI integration cases fail at the merge base. The backend regression subset at the merge base has ten expected failures: seven stale connection cases and three cross-origin inherited-credential cases; five other cases pass
Final tip: 245369764e80d113e80ec8269846e5257692b8bc
Production dashboard build and both source Docker builds pass. Full make check passes all applicable gates: Ruff lint/format, test-tree lint, strict-rule, type-discipline, test-quality, basedpyright budgets, dashboard lint/budgets and generated API-type sync. No budgets or blanket suppressions were added. Existing diagnostics remain within the repository budgets
Live cases: Basic Auth correction, URL correction with inherited credential, and static-header correction all return echo before Save. Saving the corrected Basic record returns 202; real tool-list and echo tool-call both return 200. See happy-path.json
Live screenshots and sanitized network traces demonstrate Basic Auth correction, same-origin URL correction with a blank credential field, and static-header correction. Each final-tip POST returns echo and clears the stale failure before Save. Before screenshots show the same corrections leaving Unable to load tools, without preview POSTs
Additional public MCP happy path: https://learn.microsoft.com/api/mcp returned three tools; microsoft_docs_search with query Azure Functions overview returned 200 and documentation content. See public-happy-path.json
The origin-boundary run changes the hostname. The UI shows an actionable instruction and sends zero preview requests until an explicit credential is entered, then lists echo. A direct preview request with a saved ID but no explicit credential does not inherit the saved secret across hosts; an explicit credential succeeds. Unit coverage also verifies scheme changes, non-default ports and same-origin default-port normalization
After saving corrected Basic Auth, Save returns 202, listing returns 200 with echo, and the echo tool call returns 200 with the expected message. Public Microsoft Learn MCP also returns three tools and a successful read-only documentation search on the final tip
The fixture is an actual MCP SDK server over HTTP. It rejects invalid credentials with 403 so a browser HTTP-auth challenge does not intercept fetch requests. No mocks or model calls are used in live verification. The browser waits for the initial form load before editing fields
Files: check-final.log, regression-tests.log, regression-before.log, backend-tests.log, backend-regression-before.log, ui-build.log, happy-path.json, public-happy-path.json, origin-boundary.json and matching before/after screenshots/network JSON

View file

@ -1,5 +1,5 @@
{
"commit": "245369764e80d113e80ec8269846e5257692b8bc",
"commit": "493c98f9bffbcf2ea1d5ba30e324427daa9a173b",
"case": "auth",
"requestsAfterEdit": [
{
@ -18,14 +18,6 @@
],
"error": null,
"message": "Successfully retrieved tools"
},
{
"method": "GET",
"url": "http://localhost:47135/mcp-rest/tools/list?server_id=9b6bd048-e6c8-4501-972c-1fc1c73944bd",
"status": 403,
"tools": [],
"error": null,
"message": null
}
],
"visibleTools": 1,

Binary file not shown.

Before

Width:  |  Height:  |  Size: 200 KiB

After

Width:  |  Height:  |  Size: 200 KiB

View file

@ -1,5 +1,5 @@
{
"commit": "245369764e80d113e80ec8269846e5257692b8bc",
"commit": "493c98f9bffbcf2ea1d5ba30e324427daa9a173b",
"case": "headers",
"requestsAfterEdit": [
{
@ -20,14 +20,6 @@
],
"error": null,
"message": "Successfully retrieved tools"
},
{
"method": "GET",
"url": "http://localhost:47135/mcp-rest/tools/list?server_id=e9d70a72-41b3-4875-8a1e-baf4cc6fff48",
"status": 403,
"tools": [],
"error": null,
"message": null
}
],
"visibleTools": 1,

Binary file not shown.

Before

Width:  |  Height:  |  Size: 209 KiB

After

Width:  |  Height:  |  Size: 209 KiB

View file

@ -1 +1 @@
245369764e80d113e80ec8269846e5257692b8bc
493c98f9bffbcf2ea1d5ba30e324427daa9a173b

View file

@ -1,5 +1,5 @@
{
"commit": "245369764e80d113e80ec8269846e5257692b8bc",
"commit": "493c98f9bffbcf2ea1d5ba30e324427daa9a173b",
"case": "url",
"requestsAfterEdit": [
{
@ -18,14 +18,6 @@
],
"error": null,
"message": "Successfully retrieved tools"
},
{
"method": "GET",
"url": "http://localhost:47135/mcp-rest/tools/list?server_id=8bc75227-7652-4790-b16f-db47809c94b3",
"status": 500,
"tools": [],
"error": null,
"message": null
}
],
"visibleTools": 1,

Binary file not shown.

Before

Width:  |  Height:  |  Size: 203 KiB

After

Width:  |  Height:  |  Size: 204 KiB

View file

@ -1,9 +1,164 @@
FFFFFFF [100%]
FF.F....FFFFFFF [100%]
=================================== FAILURES ===================================
_ TestExecuteWithMcpClient.test_static_preview_respects_origin_when_inheriting_credentials[None-http://stored.example/mcp-False] _
self = <test_rest_endpoints.TestExecuteWithMcpClient object at 0x11a4ea750>
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x11bfb4f20>
url = 'http://stored.example/mcp', same_origin = False
explicit_credential = None
@pytest.mark.parametrize(
("url", "same_origin"),
(
("https://other.example/mcp", False),
("http://stored.example/mcp", False),
("https://stored.example:8443/mcp", False),
("https://stored.example:443/mcp", True),
),
)
@pytest.mark.parametrize("explicit_credential", (None, "preview:explicit"))
def test_static_preview_respects_origin_when_inheriting_credentials(
self, monkeypatch: pytest.MonkeyPatch, url: str, same_origin: bool, explicit_credential: str | None
) -> None:
from starlette.datastructures import Headers
from litellm.proxy._experimental.mcp_server.mcp_server_manager import MCPServerManager
from litellm.proxy.management_endpoints import mcp_management_endpoints
saved: Final = MCPServer(
server_id="saved-preview-server",
name="saved",
url="https://stored.example/mcp",
transport=MCPTransport.http,
auth_type=MCPAuth.basic,
authentication_token="preview:stored",
)
manager: Final = MCPServerManager()
manager.registry = {saved.server_id: saved}
monkeypatch.setattr(rest_endpoints, "global_mcp_server_manager", manager)
monkeypatch.setattr(mcp_management_endpoints, "global_mcp_server_manager", manager)
payload: Final = NewMCPServerRequest(
server_id=saved.server_id,
url=url,
transport=MCPTransport.http,
auth_type=MCPAuth.basic,
credentials={"auth_value": explicit_credential} if explicit_credential else None,
)
staged: Final = rest_endpoints._stage_server_test(payload, Headers())
expected: Final = explicit_credential or ("preview:stored" if same_origin else None)
> assert staged.mcp_auth_header == expected
E AssertionError: assert 'preview:stored' == None
E + where 'preview:stored' = _StagedServerTest(request=NewMCPServerRequest(server_id='saved-preview-server', server_name=None, alias=None, descript...ne, approval_status=None, submitted_by=None, submitted_at=None), mcp_auth_header='preview:stored', oauth2_headers=None).mcp_auth_header
tests/test_litellm/proxy/_experimental/mcp_server/test_rest_endpoints.py:195: AssertionError
---------------------------- Captured stdout setup -----------------------------
[conftest] Module setup complete (worker: master)
_ TestExecuteWithMcpClient.test_static_preview_respects_origin_when_inheriting_credentials[None-https://other.example/mcp-False] _
self = <test_rest_endpoints.TestExecuteWithMcpClient object at 0x11a4ea7b0>
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x11cba77a0>
url = 'https://other.example/mcp', same_origin = False
explicit_credential = None
@pytest.mark.parametrize(
("url", "same_origin"),
(
("https://other.example/mcp", False),
("http://stored.example/mcp", False),
("https://stored.example:8443/mcp", False),
("https://stored.example:443/mcp", True),
),
)
@pytest.mark.parametrize("explicit_credential", (None, "preview:explicit"))
def test_static_preview_respects_origin_when_inheriting_credentials(
self, monkeypatch: pytest.MonkeyPatch, url: str, same_origin: bool, explicit_credential: str | None
) -> None:
from starlette.datastructures import Headers
from litellm.proxy._experimental.mcp_server.mcp_server_manager import MCPServerManager
from litellm.proxy.management_endpoints import mcp_management_endpoints
saved: Final = MCPServer(
server_id="saved-preview-server",
name="saved",
url="https://stored.example/mcp",
transport=MCPTransport.http,
auth_type=MCPAuth.basic,
authentication_token="preview:stored",
)
manager: Final = MCPServerManager()
manager.registry = {saved.server_id: saved}
monkeypatch.setattr(rest_endpoints, "global_mcp_server_manager", manager)
monkeypatch.setattr(mcp_management_endpoints, "global_mcp_server_manager", manager)
payload: Final = NewMCPServerRequest(
server_id=saved.server_id,
url=url,
transport=MCPTransport.http,
auth_type=MCPAuth.basic,
credentials={"auth_value": explicit_credential} if explicit_credential else None,
)
staged: Final = rest_endpoints._stage_server_test(payload, Headers())
expected: Final = explicit_credential or ("preview:stored" if same_origin else None)
> assert staged.mcp_auth_header == expected
E AssertionError: assert 'preview:stored' == None
E + where 'preview:stored' = _StagedServerTest(request=NewMCPServerRequest(server_id='saved-preview-server', server_name=None, alias=None, descript...ne, approval_status=None, submitted_by=None, submitted_at=None), mcp_auth_header='preview:stored', oauth2_headers=None).mcp_auth_header
tests/test_litellm/proxy/_experimental/mcp_server/test_rest_endpoints.py:195: AssertionError
_ TestExecuteWithMcpClient.test_static_preview_respects_origin_when_inheriting_credentials[None-https://stored.example:8443/mcp-False] _
self = <test_rest_endpoints.TestExecuteWithMcpClient object at 0x11a4eaa20>
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x11cf95bb0>
url = 'https://stored.example:8443/mcp', same_origin = False
explicit_credential = None
@pytest.mark.parametrize(
("url", "same_origin"),
(
("https://other.example/mcp", False),
("http://stored.example/mcp", False),
("https://stored.example:8443/mcp", False),
("https://stored.example:443/mcp", True),
),
)
@pytest.mark.parametrize("explicit_credential", (None, "preview:explicit"))
def test_static_preview_respects_origin_when_inheriting_credentials(
self, monkeypatch: pytest.MonkeyPatch, url: str, same_origin: bool, explicit_credential: str | None
) -> None:
from starlette.datastructures import Headers
from litellm.proxy._experimental.mcp_server.mcp_server_manager import MCPServerManager
from litellm.proxy.management_endpoints import mcp_management_endpoints
saved: Final = MCPServer(
server_id="saved-preview-server",
name="saved",
url="https://stored.example/mcp",
transport=MCPTransport.http,
auth_type=MCPAuth.basic,
authentication_token="preview:stored",
)
manager: Final = MCPServerManager()
manager.registry = {saved.server_id: saved}
monkeypatch.setattr(rest_endpoints, "global_mcp_server_manager", manager)
monkeypatch.setattr(mcp_management_endpoints, "global_mcp_server_manager", manager)
payload: Final = NewMCPServerRequest(
server_id=saved.server_id,
url=url,
transport=MCPTransport.http,
auth_type=MCPAuth.basic,
credentials={"auth_value": explicit_credential} if explicit_credential else None,
)
staged: Final = rest_endpoints._stage_server_test(payload, Headers())
expected: Final = explicit_credential or ("preview:stored" if same_origin else None)
> assert staged.mcp_auth_header == expected
E AssertionError: assert 'preview:stored' == None
E + where 'preview:stored' = _StagedServerTest(request=NewMCPServerRequest(server_id='saved-preview-server', server_name=None, alias=None, descript...ne, approval_status=None, submitted_by=None, submitted_at=None), mcp_auth_header='preview:stored', oauth2_headers=None).mcp_auth_header
tests/test_litellm/proxy/_experimental/mcp_server/test_rest_endpoints.py:195: AssertionError
_ TestExecuteWithMcpClient.test_static_preview_uses_edited_connection_instead_of_registered_server[api_key-edited-expected_auth4] _
self = <test_rest_endpoints.TestExecuteWithMcpClient object at 0x11a6f9a60>
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x10dfa7e60>
self = <test_rest_endpoints.TestExecuteWithMcpClient object at 0x11a4e9e80>
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x11cf97bc0>
auth_type = <MCPAuth.api_key: 'api_key'>, auth_value = 'edited'
expected_auth = {'X-API-Key': 'edited'}
@ -48,7 +203,7 @@ expected_auth = {'X-API-Key': 'edited'}
payload: Final = NewMCPServerRequest(
server_id=saved.server_id,
server_name="edited",
url="https://edited.example/mcp",
url="https://stored.example/corrected-mcp",
transport=MCPTransport.sse,
auth_type=auth_type,
credentials={"auth_value": auth_value} if auth_value is not None else None,
@ -66,25 +221,23 @@ expected_auth = {'X-API-Key': 'edited'}
oauth2_headers=staged.oauth2_headers,
)
> assert result == {
"url": "https://edited.example/mcp",
"url": "https://stored.example/corrected-mcp",
"transport": MCPTransport.sse,
"headers": {"X-Preview": "edited", **expected_auth},
}
E AssertionError: assert {'headers': {....example/mcp'} == {'headers': {....example/mcp'}
E AssertionError: assert {'headers': {....example/mcp'} == {'headers': {...orrected-mcp'}
E
E Differing items:
E {'transport': <MCPTransport.http: 'http'>} != {'transport': <MCPTransport.sse: 'sse'>}
E {'url': 'https://stored.example/mcp'} != {'url': 'https://stored.example/corrected-mcp'}
E {'headers': {'Authorization': 'Basic ZWRpdGVk', 'X-Preview': 'edited'}} != {'headers': {'X-API-Key': 'edited', 'X-Preview': 'edited'}}
E {'url': 'https://stored.example/mcp'} != {'url': 'https://edited.example/mcp'}
E Use -v to get more diff
tests/test_litellm/proxy/_experimental/mcp_server/test_rest_endpoints.py:148: AssertionError
---------------------------- Captured stdout setup -----------------------------
[conftest] Module setup complete (worker: master)
_ TestExecuteWithMcpClient.test_static_preview_uses_edited_connection_instead_of_registered_server[authorization-Custom edited-expected_auth6] _
self = <test_rest_endpoints.TestExecuteWithMcpClient object at 0x11a6f9c70>
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x11d34d250>
self = <test_rest_endpoints.TestExecuteWithMcpClient object at 0x11a4e9fa0>
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x11cf96b70>
auth_type = <MCPAuth.authorization: 'authorization'>
auth_value = 'Custom edited', expected_auth = {'Authorization': 'Custom edited'}
@ -129,7 +282,7 @@ auth_value = 'Custom edited', expected_auth = {'Authorization': 'Custom edited'}
payload: Final = NewMCPServerRequest(
server_id=saved.server_id,
server_name="edited",
url="https://edited.example/mcp",
url="https://stored.example/corrected-mcp",
transport=MCPTransport.sse,
auth_type=auth_type,
credentials={"auth_value": auth_value} if auth_value is not None else None,
@ -147,23 +300,23 @@ auth_value = 'Custom edited', expected_auth = {'Authorization': 'Custom edited'}
oauth2_headers=staged.oauth2_headers,
)
> assert result == {
"url": "https://edited.example/mcp",
"url": "https://stored.example/corrected-mcp",
"transport": MCPTransport.sse,
"headers": {"X-Preview": "edited", **expected_auth},
}
E AssertionError: assert {'headers': {....example/mcp'} == {'headers': {....example/mcp'}
E AssertionError: assert {'headers': {....example/mcp'} == {'headers': {...orrected-mcp'}
E
E Differing items:
E {'transport': <MCPTransport.http: 'http'>} != {'transport': <MCPTransport.sse: 'sse'>}
E {'url': 'https://stored.example/mcp'} != {'url': 'https://stored.example/corrected-mcp'}
E {'headers': {'Authorization': 'Basic Q3VzdG9tIGVkaXRlZA==', 'X-Preview': 'edited'}} != {'headers': {'Authorization': 'Custom edited', 'X-Preview': 'edited'}}
E {'url': 'https://stored.example/mcp'} != {'url': 'https://edited.example/mcp'}
E Use -v to get more diff
tests/test_litellm/proxy/_experimental/mcp_server/test_rest_endpoints.py:148: AssertionError
_ TestExecuteWithMcpClient.test_static_preview_uses_edited_connection_instead_of_registered_server[basic-None-expected_auth2] _
self = <test_rest_endpoints.TestExecuteWithMcpClient object at 0x11a6f91c0>
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x11a4aaf30>
self = <test_rest_endpoints.TestExecuteWithMcpClient object at 0x11a4e9d60>
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x11cf3c080>
auth_type = <MCPAuth.basic: 'basic'>, auth_value = None
expected_auth = {'Authorization': 'Basic cHJldmlldzpzdG9yZWQ='}
@ -208,7 +361,7 @@ expected_auth = {'Authorization': 'Basic cHJldmlldzpzdG9yZWQ='}
payload: Final = NewMCPServerRequest(
server_id=saved.server_id,
server_name="edited",
url="https://edited.example/mcp",
url="https://stored.example/corrected-mcp",
transport=MCPTransport.sse,
auth_type=auth_type,
credentials={"auth_value": auth_value} if auth_value is not None else None,
@ -226,23 +379,23 @@ expected_auth = {'Authorization': 'Basic cHJldmlldzpzdG9yZWQ='}
oauth2_headers=staged.oauth2_headers,
)
> assert result == {
"url": "https://edited.example/mcp",
"url": "https://stored.example/corrected-mcp",
"transport": MCPTransport.sse,
"headers": {"X-Preview": "edited", **expected_auth},
}
E AssertionError: assert {'headers': {....example/mcp'} == {'headers': {....example/mcp'}
E AssertionError: assert {'headers': {....example/mcp'} == {'headers': {...orrected-mcp'}
E
E Omitting 1 identical items, use -vv to show
E Differing items:
E {'transport': <MCPTransport.http: 'http'>} != {'transport': <MCPTransport.sse: 'sse'>}
E {'url': 'https://stored.example/mcp'} != {'url': 'https://edited.example/mcp'}
E {'url': 'https://stored.example/mcp'} != {'url': 'https://stored.example/corrected-mcp'}
E Use -v to get more diff
tests/test_litellm/proxy/_experimental/mcp_server/test_rest_endpoints.py:148: AssertionError
_ TestExecuteWithMcpClient.test_static_preview_uses_edited_connection_instead_of_registered_server[basic-preview:correct-expected_auth1] _
self = <test_rest_endpoints.TestExecuteWithMcpClient object at 0x11a6f9820>
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x11cbc4ce0>
self = <test_rest_endpoints.TestExecuteWithMcpClient object at 0x11a4e9a60>
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x11cf97ce0>
auth_type = <MCPAuth.basic: 'basic'>, auth_value = 'preview:correct'
expected_auth = {'Authorization': 'Basic cHJldmlldzpjb3JyZWN0'}
@ -287,7 +440,7 @@ expected_auth = {'Authorization': 'Basic cHJldmlldzpjb3JyZWN0'}
payload: Final = NewMCPServerRequest(
server_id=saved.server_id,
server_name="edited",
url="https://edited.example/mcp",
url="https://stored.example/corrected-mcp",
transport=MCPTransport.sse,
auth_type=auth_type,
credentials={"auth_value": auth_value} if auth_value is not None else None,
@ -305,23 +458,23 @@ expected_auth = {'Authorization': 'Basic cHJldmlldzpjb3JyZWN0'}
oauth2_headers=staged.oauth2_headers,
)
> assert result == {
"url": "https://edited.example/mcp",
"url": "https://stored.example/corrected-mcp",
"transport": MCPTransport.sse,
"headers": {"X-Preview": "edited", **expected_auth},
}
E AssertionError: assert {'headers': {....example/mcp'} == {'headers': {....example/mcp'}
E AssertionError: assert {'headers': {....example/mcp'} == {'headers': {...orrected-mcp'}
E
E Omitting 1 identical items, use -vv to show
E Differing items:
E {'transport': <MCPTransport.http: 'http'>} != {'transport': <MCPTransport.sse: 'sse'>}
E {'url': 'https://stored.example/mcp'} != {'url': 'https://edited.example/mcp'}
E {'url': 'https://stored.example/mcp'} != {'url': 'https://stored.example/corrected-mcp'}
E Use -v to get more diff
tests/test_litellm/proxy/_experimental/mcp_server/test_rest_endpoints.py:148: AssertionError
_ TestExecuteWithMcpClient.test_static_preview_uses_edited_connection_instead_of_registered_server[bearer_token-edited-expected_auth3] _
self = <test_rest_endpoints.TestExecuteWithMcpClient object at 0x11a6f99d0>
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x11cab6450>
self = <test_rest_endpoints.TestExecuteWithMcpClient object at 0x11a4e9df0>
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x11cf97770>
auth_type = <MCPAuth.bearer_token: 'bearer_token'>, auth_value = 'edited'
expected_auth = {'Authorization': 'Bearer edited'}
@ -366,7 +519,7 @@ expected_auth = {'Authorization': 'Bearer edited'}
payload: Final = NewMCPServerRequest(
server_id=saved.server_id,
server_name="edited",
url="https://edited.example/mcp",
url="https://stored.example/corrected-mcp",
transport=MCPTransport.sse,
auth_type=auth_type,
credentials={"auth_value": auth_value} if auth_value is not None else None,
@ -384,23 +537,23 @@ expected_auth = {'Authorization': 'Bearer edited'}
oauth2_headers=staged.oauth2_headers,
)
> assert result == {
"url": "https://edited.example/mcp",
"url": "https://stored.example/corrected-mcp",
"transport": MCPTransport.sse,
"headers": {"X-Preview": "edited", **expected_auth},
}
E AssertionError: assert {'headers': {....example/mcp'} == {'headers': {....example/mcp'}
E AssertionError: assert {'headers': {....example/mcp'} == {'headers': {...orrected-mcp'}
E
E Differing items:
E {'transport': <MCPTransport.http: 'http'>} != {'transport': <MCPTransport.sse: 'sse'>}
E {'url': 'https://stored.example/mcp'} != {'url': 'https://stored.example/corrected-mcp'}
E {'headers': {'Authorization': 'Basic ZWRpdGVk', 'X-Preview': 'edited'}} != {'headers': {'Authorization': 'Bearer edited', 'X-Preview': 'edited'}}
E {'url': 'https://stored.example/mcp'} != {'url': 'https://edited.example/mcp'}
E Use -v to get more diff
tests/test_litellm/proxy/_experimental/mcp_server/test_rest_endpoints.py:148: AssertionError
_ TestExecuteWithMcpClient.test_static_preview_uses_edited_connection_instead_of_registered_server[none-None-expected_auth0] _
self = <test_rest_endpoints.TestExecuteWithMcpClient object at 0x11a6f9640>
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x11cab7a40>
self = <test_rest_endpoints.TestExecuteWithMcpClient object at 0x11a498aa0>
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x11cf96060>
auth_type = <MCPAuth.none: 'none'>, auth_value = None, expected_auth = {}
@pytest.mark.asyncio
@ -444,7 +597,7 @@ auth_type = <MCPAuth.none: 'none'>, auth_value = None, expected_auth = {}
payload: Final = NewMCPServerRequest(
server_id=saved.server_id,
server_name="edited",
url="https://edited.example/mcp",
url="https://stored.example/corrected-mcp",
transport=MCPTransport.sse,
auth_type=auth_type,
credentials={"auth_value": auth_value} if auth_value is not None else None,
@ -462,23 +615,23 @@ auth_type = <MCPAuth.none: 'none'>, auth_value = None, expected_auth = {}
oauth2_headers=staged.oauth2_headers,
)
> assert result == {
"url": "https://edited.example/mcp",
"url": "https://stored.example/corrected-mcp",
"transport": MCPTransport.sse,
"headers": {"X-Preview": "edited", **expected_auth},
}
E AssertionError: assert {'headers': {....example/mcp'} == {'headers': {....example/mcp'}
E AssertionError: assert {'headers': {....example/mcp'} == {'headers': {...orrected-mcp'}
E
E Omitting 1 identical items, use -vv to show
E Differing items:
E {'transport': <MCPTransport.http: 'http'>} != {'transport': <MCPTransport.sse: 'sse'>}
E {'url': 'https://stored.example/mcp'} != {'url': 'https://edited.example/mcp'}
E {'url': 'https://stored.example/mcp'} != {'url': 'https://stored.example/corrected-mcp'}
E Use -v to get more diff
tests/test_litellm/proxy/_experimental/mcp_server/test_rest_endpoints.py:148: AssertionError
_ TestExecuteWithMcpClient.test_static_preview_uses_edited_connection_instead_of_registered_server[token-edited-expected_auth5] _
self = <test_rest_endpoints.TestExecuteWithMcpClient object at 0x11a6f9dc0>
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x11cab4cb0>
self = <test_rest_endpoints.TestExecuteWithMcpClient object at 0x11a4e9f10>
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x11cf3fa40>
auth_type = <MCPAuth.token: 'token'>, auth_value = 'edited'
expected_auth = {'Authorization': 'token edited'}
@ -523,7 +676,7 @@ expected_auth = {'Authorization': 'token edited'}
payload: Final = NewMCPServerRequest(
server_id=saved.server_id,
server_name="edited",
url="https://edited.example/mcp",
url="https://stored.example/corrected-mcp",
transport=MCPTransport.sse,
auth_type=auth_type,
credentials={"auth_value": auth_value} if auth_value is not None else None,
@ -541,16 +694,16 @@ expected_auth = {'Authorization': 'token edited'}
oauth2_headers=staged.oauth2_headers,
)
> assert result == {
"url": "https://edited.example/mcp",
"url": "https://stored.example/corrected-mcp",
"transport": MCPTransport.sse,
"headers": {"X-Preview": "edited", **expected_auth},
}
E AssertionError: assert {'headers': {....example/mcp'} == {'headers': {....example/mcp'}
E AssertionError: assert {'headers': {....example/mcp'} == {'headers': {...orrected-mcp'}
E
E Differing items:
E {'transport': <MCPTransport.http: 'http'>} != {'transport': <MCPTransport.sse: 'sse'>}
E {'url': 'https://stored.example/mcp'} != {'url': 'https://stored.example/corrected-mcp'}
E {'headers': {'X-Preview': 'edited'}} != {'headers': {'Authorization': 'token edited', 'X-Preview': 'edited'}}
E {'url': 'https://stored.example/mcp'} != {'url': 'https://edited.example/mcp'}
E Use -v to get more diff
tests/test_litellm/proxy/_experimental/mcp_server/test_rest_endpoints.py:148: AssertionError
@ -575,6 +728,9 @@ tests/test_litellm/proxy/_experimental/mcp_server/test_rest_endpoints.py:148: As
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
FAILED tests/test_litellm/proxy/_experimental/mcp_server/test_rest_endpoints.py::TestExecuteWithMcpClient::test_static_preview_respects_origin_when_inheriting_credentials[None-http://stored.example/mcp-False]
FAILED tests/test_litellm/proxy/_experimental/mcp_server/test_rest_endpoints.py::TestExecuteWithMcpClient::test_static_preview_respects_origin_when_inheriting_credentials[None-https://other.example/mcp-False]
FAILED tests/test_litellm/proxy/_experimental/mcp_server/test_rest_endpoints.py::TestExecuteWithMcpClient::test_static_preview_respects_origin_when_inheriting_credentials[None-https://stored.example:8443/mcp-False]
FAILED tests/test_litellm/proxy/_experimental/mcp_server/test_rest_endpoints.py::TestExecuteWithMcpClient::test_static_preview_uses_edited_connection_instead_of_registered_server[api_key-edited-expected_auth4]
FAILED tests/test_litellm/proxy/_experimental/mcp_server/test_rest_endpoints.py::TestExecuteWithMcpClient::test_static_preview_uses_edited_connection_instead_of_registered_server[authorization-Custom edited-expected_auth6]
FAILED tests/test_litellm/proxy/_experimental/mcp_server/test_rest_endpoints.py::TestExecuteWithMcpClient::test_static_preview_uses_edited_connection_instead_of_registered_server[basic-None-expected_auth2]
@ -582,4 +738,4 @@ FAILED tests/test_litellm/proxy/_experimental/mcp_server/test_rest_endpoints.py:
FAILED tests/test_litellm/proxy/_experimental/mcp_server/test_rest_endpoints.py::TestExecuteWithMcpClient::test_static_preview_uses_edited_connection_instead_of_registered_server[bearer_token-edited-expected_auth3]
FAILED tests/test_litellm/proxy/_experimental/mcp_server/test_rest_endpoints.py::TestExecuteWithMcpClient::test_static_preview_uses_edited_connection_instead_of_registered_server[none-None-expected_auth0]
FAILED tests/test_litellm/proxy/_experimental/mcp_server/test_rest_endpoints.py::TestExecuteWithMcpClient::test_static_preview_uses_edited_connection_instead_of_registered_server[token-edited-expected_auth5]
7 failed, 124 deselected, 4 warnings in 2.97s
10 failed, 5 passed, 124 deselected, 4 warnings in 3.99s

View file

@ -1,5 +1,5 @@
........................................................................ [ 54%]
........................................................... [100%]
........................................................................ [ 51%]
................................................................... [100%]
=============================== warnings summary ===============================
.venv/lib/python3.12/site-packages/fastapi/testclient.py:1
/Users/jvalluru/LiteLLM-work/litellm-lit-7135/.venv/lib/python3.12/site-packages/fastapi/testclient.py:1: StarletteDeprecationWarning: Using `httpx` with `starlette.testclient` is deprecated; install `httpx2` instead.
@ -18,4 +18,4 @@
warnings.warn(
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
131 passed, 4 warnings in 2.52s
139 passed, 4 warnings in 3.38s

View file

@ -17,6 +17,7 @@ async def main():
await page.get_by_title('preview_' + case, exact=True).click()
await page.get_by_role('tab', name='Settings', exact=True).click()
await expect(page.get_by_text('Unable to load tools', exact=True)).to_be_visible(timeout=30000)
await page.wait_for_timeout(1500)
records = []
issued = set()
def note_request(request):

View file

@ -1,15 +1,4 @@
uv sync --inexact --frozen --extra proxy --group proxy-dev --group e2e-dev
Checked 232 packages in 37ms
uv run --no-sync python scripts/prisma_generate_if_needed.py
Prisma client already generated for litellm/proxy/schema.prisma (prisma 0.11.0); skipping prisma generate
cd ui/litellm-dashboard && ../../scripts/with_dashboard_node.sh npm install --no-audit --no-fund
up to date in 541ms
bootstrap: .env left untouched
bootstrap: done
./scripts/pre_commit_lint.sh
check: logging full output to /Users/jvalluru/LiteLLM-work/litellm/.git/worktrees/litellm-lit-7135/pre_commit_lint.log
check: nothing staged; scoping to the working tree's diff against the merge base with 6b721de3e5:
check: nothing staged; scoping to the working tree's diff against the merge base with 6b721de3e530bc97758d59621e57e3a75a9ebadf:
litellm/proxy/_experimental/mcp_server/rest_endpoints.py
tests/test_litellm/proxy/_experimental/mcp_server/test_rest_endpoints.py
ui/litellm-dashboard/src/app/(dashboard)/mcp-servers/_components/editToolPreview.test.ts
@ -19,26 +8,26 @@ check: nothing staged; scoping to the working tree's diff against the merge base
ui/litellm-dashboard/src/app/(dashboard)/mcp-servers/_components/mcp_tool_configuration.tsx
check: linting Python (make lint)
uv sync --inexact --frozen --group proxy-dev --group e2e-dev
Checked 205 packages in 6ms
Checked 205 packages in 5ms
uv run --no-sync python scripts/prisma_generate_if_needed.py
Prisma client already generated for litellm/proxy/schema.prisma (prisma 0.11.0); skipping prisma generate
cd litellm && uv run --no-sync ruff check . && cd ..
uv run --no-sync python scripts/ruff_strict_gate.py --base "6b721de3e5"
uv run --no-sync python scripts/type_discipline_gate.py --base "6b721de3e5"
uv run --no-sync python scripts/test_quality_gate.py --base "6b721de3e5"
uv run --no-sync python scripts/type_check_gate.py --base "6b721de3e5"
uv run --no-sync python scripts/ruff_strict_gate.py --base "6b721de3e530bc97758d59621e57e3a75a9ebadf"
uv run --no-sync python scripts/type_discipline_gate.py --base "6b721de3e530bc97758d59621e57e3a75a9ebadf"
uv run --no-sync python scripts/test_quality_gate.py --base "6b721de3e530bc97758d59621e57e3a75a9ebadf"
uv run --no-sync python scripts/type_check_gate.py --base "6b721de3e530bc97758d59621e57e3a75a9ebadf"
uv run --no-sync basedpyright tests/e2e
cd litellm && uv run --no-sync python ../tests/documentation_tests/test_circular_imports.py && cd ..
No LiteLLM type hints found.
All checks passed!
uv run --no-sync ruff check --config ruff-tests.toml tests
1 file already formatted
All checks passed!
uv run --no-sync ruff check --config ruff-tests.toml tests
All checks passed!
[from litellm import *] OK! no issues!
OK: every strict rule is within its codebase ceiling (base 6b721de3e5)
OK: every strict rule is within its codebase ceiling (base 6b721de3e530bc97758d59621e57e3a75a9ebadf)
0 errors, 0 warnings, 0 notes
OK: every TQ rule is within its test-suite ceiling (base 6b721de3e5)
OK: every LIT rule is within its codebase ceiling (base 6b721de3e5)
OK: every TQ rule is within its test-suite ceiling (base 6b721de3e530bc97758d59621e57e3a75a9ebadf)
OK: every LIT rule is within its codebase ceiling (base 6b721de3e530bc97758d59621e57e3a75a9ebadf)
OK: every rule is within its basedpyright limit or no higher than base (137959 errors total)
check: ruff format --check (scoped litellm files)
1 file already formatted
@ -55,22 +44,22 @@ All matched files use Prettier code style!
254:23 warning Object literal with 6 properties passed inline as an argument; assign it to a named variable first local/no-large-inline-object-arg
448:62 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
451:6 warning React Hook useEffect has a missing dependency: 'form'. Either include it or remove the dependency array react-hooks/exhaustive-deps
585:55 warning Async arrow function has a complexity of 25. Maximum allowed is 20 complexity
680:28 warning Object literal with 5 properties passed inline as an argument; assign it to a named variable first local/no-large-inline-object-arg
705:26 warning Compilation Skipped: Use of incompatible library
588:55 warning Async arrow function has a complexity of 25. Maximum allowed is 20 complexity
683:28 warning Object literal with 5 properties passed inline as an argument; assign it to a named variable first local/no-large-inline-object-arg
708:26 warning Compilation Skipped: Use of incompatible library
This API returns functions which cannot be memoized without leading to stale UI. To prevent this, by default React Compiler will skip memoizing this component/hook. However, you may see issues if values from this API are passed to other components/hooks that are memoized.
/Users/jvalluru/LiteLLM-work/litellm-lit-7135/ui/litellm-dashboard/src/app/(dashboard)/mcp-servers/_components/mcp_server_edit.tsx:705:26
703 |
704 | React.useEffect(() => {
> 705 | const subscription = form.watch((values, { name, type }) => {
/Users/jvalluru/LiteLLM-work/litellm-lit-7135/ui/litellm-dashboard/src/app/(dashboard)/mcp-servers/_components/mcp_server_edit.tsx:708:26
706 |
707 | React.useEffect(() => {
> 708 | const subscription = form.watch((values, { name, type }) => {
| ^^^^ React Hook Form's `useForm()` API returns a `watch()` function which cannot be memoized safely.
706 | if (type !== "change" || name === undefined) {
707 | return;
708 | } react-hooks/incompatible-library
725:52 warning Object literal with 9 properties passed inline as an argument; assign it to a named variable first local/no-large-inline-object-arg
782:21 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
709 | if (type !== "change" || name === undefined) {
710 | return;
711 | } react-hooks/incompatible-library
728:52 warning Object literal with 9 properties passed inline as an argument; assign it to a named variable first local/no-large-inline-object-arg
785:21 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
/Users/jvalluru/LiteLLM-work/litellm-lit-7135/ui/litellm-dashboard/src/app/(dashboard)/mcp-servers/_components/mcp_tool_configuration.tsx
22:30 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
@ -106,7 +95,7 @@ wrote 33 feature fragments to /Users/jvalluru/LiteLLM-work/litellm-lit-7135/lite
> node scripts/gen-api-types.mjs
✨ openapi-typescript 7.13.0
🚀 /var/folders/n4/7jf8qfys5256pzfjlkkcmzj80000gn/T/litellm-openapi-qqevN5/openapi.json → /Users/jvalluru/LiteLLM-work/litellm-lit-7135/ui/litellm-dashboard/src/lib/http/schema.d.ts [690.2ms]
🚀 /var/folders/n4/7jf8qfys5256pzfjlkkcmzj80000gn/T/litellm-openapi-EyadgS/openapi.json → /Users/jvalluru/LiteLLM-work/litellm-lit-7135/ui/litellm-dashboard/src/lib/http/schema.d.ts [620.9ms]
check: summary
ran: Python lint (make lint)
skipped: tests/e2e checks (basedpyright + raw HTTP client ban) (no tests/e2e Python files in scope)
@ -114,4 +103,4 @@ check: summary
ran: dashboard lint (prettier + eslint + lint budgets)
ran: dashboard API-type sync (npm run gen:api)
check: PASS
check: full log: /Users/jvalluru/LiteLLM-work/litellm/.git/worktrees/litellm-lit-7135/pre_commit_lint.log

View file

@ -1,5 +1,5 @@
{
"commit": "245369764e80d113e80ec8269846e5257692b8bc",
"commit": "493c98f9bffbcf2ea1d5ba30e324427daa9a173b",
"saveStatus": 202,
"listStatus": 200,
"tools": [

View file

@ -20,13 +20,13 @@
"tags": [
"litellm-7135:after"
],
"id": "sha256:f061712316ab2897b57ea858626a9d6a433118319ce217f28f4ab4d6cc81fcc1",
"id": "sha256:e2d166e9ad70880c9627b224171a5bfa5152d87e9af821f1891da8e1b7bf54fd",
"labels": {
"dev.chainguard.image.title": "wolfi-base",
"dev.chainguard.package.main": "",
"org.opencontainers.image.authors": "Chainguard Team https://www.chainguard.dev/",
"org.opencontainers.image.created": "2026-08-30T12:58:50Z",
"org.opencontainers.image.revision": "245369764e80d113e80ec8269846e5257692b8bc",
"org.opencontainers.image.revision": "493c98f9bf",
"org.opencontainers.image.source": "https://github.com/chainguard-images/images/tree/main/images/wolfi-base",
"org.opencontainers.image.title": "wolfi-base",
"org.opencontainers.image.url": "https://images.chainguard.dev/directory/image/wolfi-base/overview",

19
origin-boundary.json Normal file
View file

@ -0,0 +1,19 @@
{
"commit": "493c98f9bffbcf2ea1d5ba30e324427daa9a173b",
"withoutExplicitCredential": {
"status": 200,
"toolCount": 0
},
"withExplicitCredential": {
"status": 200,
"tools": [
"echo"
]
},
"ui": {
"guardVisible": true,
"requestsBeforeCredential": 0,
"requestsAfterCredential": 1,
"toolVisible": "echo"
}
}

File diff suppressed because one or more lines are too long

View file

@ -1,18 +1,22 @@
> litellm-dashboard@0.1.0 test
> vitest --run src/app/(dashboard)/mcp-servers/_components/editToolPreview.test.ts src/app/(dashboard)/mcp-servers/_components/mcp_server_edit.integration.test.tsx src/app/(dashboard)/mcp-servers/_components/mcp_tool_configuration.test.tsx src/app/(dashboard)/mcp-servers/_components/mcp_server_edit.test.tsx
Testing types with tsc and vue-tsc is an experimental feature.
Breaking changes might not follow SemVer, please pin Vitest's version when using it.
RUN v4.1.11 /Users/jvalluru/LiteLLM-work/litellm-lit-7135/ui/litellm-dashboard
Importing from "vitest/environments" is deprecated since Vitest 4.1. Please use "vitest/runtime" instead.
The Vitest environment jsdom-fetch defines the "transformMode". This options was deprecated in Vitest 4 and will be removed in the next major version. Please, use "viteEnvironment" instead.
Importing from "vitest/environments" is deprecated since Vitest 4.1. Please use "vitest/runtime" instead.
The Vitest environment jsdom-fetch defines the "transformMode". This options was deprecated in Vitest 4 and will be removed in the next major version. Please, use "viteEnvironment" instead.
Importing from "vitest/environments" is deprecated since Vitest 4.1. Please use "vitest/runtime" instead.
The Vitest environment jsdom-fetch defines the "transformMode". This options was deprecated in Vitest 4 and will be removed in the next major version. Please, use "viteEnvironment" instead.
The Vitest environment jsdom-fetch defines the "transformMode". This options was deprecated in Vitest 4 and will be removed in the next major version. Please, use "viteEnvironment" instead.
Test Files 4 passed (4)
Tests 125 passed (125)
Tests 129 passed (129)
Type Errors no errors
Start at 17:37:15
Duration 12.90s (transform 4.59s, setup 648ms, import 7.53s, tests 16.01s, environment 2.47s)
Start at 18:04:27
Duration 6.70s (transform 844ms, setup 341ms, import 1.85s, tests 10.53s, environment 1.15s)

View file

@ -9,15 +9,15 @@
⨯ useTypeScriptCli
Creating an optimized production build ...
✓ Compiled successfully in 6.8s
✓ Compiled successfully in 2.4s
Running TypeScript ...
Finished TypeScript in 27.4s ...
Finished TypeScript in 27.1s ...
Collecting page data using 17 workers ...
Generating static pages using 17 workers (0/51) ...
Generating static pages using 17 workers (12/51)
Generating static pages using 17 workers (25/51)
Generating static pages using 17 workers (38/51)
✓ Generating static pages using 17 workers (51/51) in 596ms
✓ Generating static pages using 17 workers (51/51) in 435ms
Turbopack build encountered 1 warning:
./public/assets/logos/enkrypt_ai.avif
Warning: AVIF image not supported

42
verify-origin.py Normal file
View file

@ -0,0 +1,42 @@
import asyncio,json
from pathlib import Path
from playwright.async_api import async_playwright,expect
from seed import request,root
from urllib.error import HTTPError
async def check_ui():
async with async_playwright() as pw:
browser=await pw.chromium.connect_over_cdp('http://127.0.0.1:9713')
page=browser.contexts[0].pages[0]
await page.goto('http://localhost:47135/ui/mcp-servers/')
await page.get_by_title('preview_url',exact=True).click()
await page.get_by_role('tab',name='Settings',exact=True).click()
await expect(page.get_by_text('Unable to load tools',exact=True)).to_be_visible(timeout=30000)
calls=[]
def record(req):
if '/mcp-rest/test/tools/list' in req.url: calls.append(req.method)
page.on('request',record)
await page.get_by_label('MCP Server URL',exact=True).fill('http://litellm-7135-upstream-1:8080/mcp')
message=page.get_by_text('The server origin changed. Enter credentials and replace or remove saved static headers to preview tools.',exact=True)
await expect(message).to_be_visible()
await page.wait_for_timeout(1000)
assert calls==[]
await page.get_by_label('Authentication Value',exact=True).fill('preview:correct')
await expect(page.get_by_role('button',name='Flat List',exact=True)).to_be_visible(timeout=15000)
await page.get_by_role('button',name='Flat List',exact=True).click()
await expect(page.get_by_text('echo',exact=True)).to_be_visible()
page.remove_listener('request',record)
await browser.close()
return {'guardVisible':True,'requestsBeforeCredential':0,'requestsAfterCredential':len(calls),'toolVisible':'echo'}
sid=json.loads((root/'servers.json').read_text())['url']
payload={'server_id':sid,'url':'http://litellm-7135-upstream-1:8080/mcp','transport':'http','auth_type':'basic'}
try:
status,result=request('POST','/mcp-rest/test/tools/list',payload)
except HTTPError as error:
status,result=error.code,json.load(error)
assert status != 200 or result.get('error') or not result.get('tools')
explicit_status,explicit=request('POST','/mcp-rest/test/tools/list',{**payload,'credentials':{'auth_value':'preview:correct'}})
assert explicit_status==200 and explicit['tools'][0]['name']=='echo'
evidence={'commit':(root/'after-sha').read_text().strip(),'withoutExplicitCredential':{'status':status,'toolCount':len(result.get('tools',[]))},'withExplicitCredential':{'status':explicit_status,'tools':[t['name'] for t in explicit['tools']]},'ui':asyncio.run(check_ui())}
(root/'origin-boundary.json').write_text(json.dumps(evidence,indent=2));print(json.dumps(evidence))