Skip to content

[Bug]: Unique Constraint is not allowing Users to create servers/tools/resources/prompts with Names already used by another User #945

@MohanLaksh

Description

@MohanLaksh

🐞 Bug Summary

Description

Currently, the database enforces a unique constraint on name fields for servers, tools, resources, and prompts.
This means that if one user creates an item named example-server, no other user can use that name, even though these objects should logically be user-scoped.

This behavior blocks multiple users from independently creating items with the same name.

🧩 Affected Component

Select the area of the project impacted:

  • mcpgateway - API
  • mcpgateway - UI (admin panel)
  • mcpgateway.wrapper - stdio wrapper
  • Federation or Transports
  • CLI, Makefiles, or shell scripts
  • Container setup (Docker/Podman/Compose)
  • Other (explain below)

🔁 Steps to Reproduce

  1. Log in as User A
  2. Create a new server with the name test-server
  3. Log in as User B
  4. Attempt to create a server with the same name test-server

🤔 Expected Behavior

Each user should be able to create items (servers/tools/resources/prompts) with names that may already exist for other users.
The uniqueness should only be enforced per user, at team level, not globally.

The system throws a Unique Constraint Violation error, preventing creation.

Impact

Prevents multiple users from using common or descriptive names.
Reduces usability in multi-tenant scenarios.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingtriageIssues / Features awaiting triage

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions