litellm/tests/integration/mcp
devin-ai-integration[bot] ce582affaa
fix(mcp): reject duplicate MCP server names and aliases (#42791)
* fix(mcp): reject duplicate MCP server names and aliases

MCP server_name and alias were unchecked at write time, so two servers
could share one tool prefix and tool routing resolved to an arbitrary
winner. Writes now run inside an advisory-locked transaction that
rejects a collision on either column case-insensitively with a 400
naming the colliding identifier, covering create, edit, connector
import and restricted-admin submission. Server reload logs one warning
per identifier already shared in the database.

Co-Authored-By: bot_apk <apk@cognition.ai>

* fix(ui): block duplicate MCP server names and aliases before submit

The create and edit forms now check the normalized name/alias against
the loaded server list (case-insensitive, spaces to underscores, own
row excluded on edit) and show a field error instead of submitting.
Structured proxy error bodies are unwrapped so a 400 no longer renders
as 'Error: [object Object]'.

Co-Authored-By: bot_apk <apk@cognition.ai>

* fix(mcp): check identifier conflicts when an alias is cleared

Clearing an alias drops the tool prefix to the stored server_name, so
that name must go through the conflict check too; an explicit alias:null
is now treated as an identifier write. Also narrows the new db tests to
behavioral assertions instead of pinning prisma where shapes.

Co-Authored-By: bot_apk <apk@cognition.ai>

* fix(mcp): treat an empty alias as a clear in conflict checks

An empty-string alias was written unchecked even though the prefix falls
back to server_name; the update path now treats any falsy alias like a
clear. The edit form likewise compares a cleared alias as empty instead
of re-checking the alias being removed.

Co-Authored-By: bot_apk <apk@cognition.ai>

* test(mcp): cover clearing an alias to an empty string

Co-Authored-By: bot_apk <apk@cognition.ai>

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: bot_apk <apk@cognition.ai>
2026-09-23 17:50:27 -07:00
..
test_mcp_access_matrix.py test(integration): add MCP gateway coverage wave 1 with a dedicated mcp shard and proxy coverage artifact (#42711) 2026-09-23 07:48:46 -07:00
test_mcp_accounting_guardrails.py fix(mcp): keep tool attribution on guardrail-blocked REST calls (#42790) 2026-09-23 15:40:56 -07:00
test_mcp_credentials.py test(integration): add MCP gateway coverage wave 1 with a dedicated mcp shard and proxy coverage artifact (#42711) 2026-09-23 07:48:46 -07:00
test_mcp_lifecycle.py fix(key_management): invalidate cached object permissions on key update (#36719) 2026-09-23 15:55:09 -07:00
test_mcp_llm_endpoints.py fix(anthropic): preserve MCP tool results in the non-Anthropic Messages bridge (#42783) 2026-09-23 13:03:25 -07:00
test_mcp_management.py fix(mcp): reject duplicate MCP server names and aliases (#42791) 2026-09-23 17:50:27 -07:00
test_mcp_oauth_flows.py fix(mcp): forward caller bearer on REST oauth_delegate tool calls (#42787) 2026-09-23 14:27:54 -07:00
test_mcp_protocol_errors.py test: add extension and browser integration contracts 2026-09-16 13:15:53 -07:00
test_mcp_resilience.py test(integration): add MCP gateway coverage wave 1 with a dedicated mcp shard and proxy coverage artifact (#42711) 2026-09-23 07:48:46 -07:00
test_mcp_transports.py test(integration): add MCP gateway coverage wave 1 with a dedicated mcp shard and proxy coverage artifact (#42711) 2026-09-23 07:48:46 -07:00
test_mcp_user_env_vars.py fix(ui): keep per-user MCP credentials updatable and clearable after setup (#42652) 2026-09-23 11:51:05 -07:00
test_oauth_configuration.py test(mcp): restore scoped execution and credential isolation regressions 2026-09-19 16:41:31 -07:00