Skip to content

feat: MCP Servers with CRUD operations #10699

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 20 commits into from
May 28, 2025

Conversation

wagnerjt
Copy link
Contributor

@wagnerjt wagnerjt commented May 9, 2025

Title

MCP Server CRUD operations for the following endpoints and operations:

  1. Allow proxy admin to perform create, update, and delete operations on MCP servers in the db.
  2. Allows users to view the mcp servers they have access to.

It works following the Least-Privilege Principle, where if no mcp servers are included at the token level, then the user won't have access (with the exception of admin-like users).

  • We first find all access by token and if there is the special all-team-mcpservers, then we additionally grab all the team's mcp server list.

Endpoints here:

- GET `/v1/mcp/server` - Returns all of the configured mcp servers in the db filtered by requestor's access
- GET `/v1/mcp/server/{server_id}` - Returns the the specific mcp server in the db given `server_id` filtered by requestor's access
- PUT `/v1/mcp/server` - Updates an existing external mcp server.
- POST `/v1/mcp/server` - Add a new external mcp server.
- DELETE `/v1/mcp/server/{server_id}` - Deletes the mcp server given `server_id`.

Note: Tests will be added shortly. I wanted to get feedback on the endpoint difference since these are not consistent with LiteLLM's info requests and the update will be a PUT instead of the POST

I am going to add the additional team + token CRUD operations in another PR, but have it stubbed out for now.

Relevant issues

MCP Server Discussion

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have Added testing in the tests/litellm/ directory, Adding at least 1 test is a hard requirement - see details
  • I have added a screenshot of my new test passing locally
  • 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

Type

🆕 New Feature
📖 Documentation
✅ Test

Copy link

vercel bot commented May 9, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
litellm ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 28, 2025 3:28pm

@CLAassistant
Copy link

CLAassistant commented May 9, 2025

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
❌ wagnerjt


wagnerjt seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copy link
Contributor

@ishaan-jaff ishaan-jaff left a comment

Choose a reason for hiding this comment

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

LGTM, but please add testing

@wagnerjt
Copy link
Contributor Author

wagnerjt commented May 9, 2025

Some UI snippets included.

The tools view and usage haven't been connected with the global mcp store, so at the moment the tools list returns nothing, but on click still shows the same component

image

image

image

@wagnerjt
Copy link
Contributor Author

For #11010

@ishaan-jaff ishaan-jaff changed the base branch from main to litellm_mcp_staging_v2 May 28, 2025 15:27
@ishaan-jaff
Copy link
Contributor

merging into staging for testing

@ishaan-jaff ishaan-jaff merged commit 7aa6858 into BerriAI:litellm_mcp_staging_v2 May 28, 2025
2 of 4 checks passed
ishaan-jaff added a commit that referenced this pull request May 28, 2025
* feat: MCP Servers with CRUD operations (#10699)

* feat: mcp CRUD operations with authn/authz

* feat: mcp server UI

* mcp server page with overview, mcp tools, and settings page

* Adding MCP Server flow

* prisma generate before test

* UI callbacks add/remove with api server refetch

* test fix: poetry run prisma

* feat: mcp server db and config connection

* fix: MCPTool filter on description when not present

* feat: mcp on UI and integrated with list tools

* feat: Update mcp server endpoint

* tests: Unit and integration tests for mcp management endpoints

* fix: docs and ensuring global_mcp_manage up to date

* ui: remove the mcp tools view

* fix: ruff lint

* fix: unit -> integration test area

* fix(ui): remove left nav menu of previous tools

---------

Co-authored-by: wagnerjt <[email protected]>
Co-authored-by: Ishaan Jaff <[email protected]>

* fix: sync DB MCP tools with in memory

* fix: sync DB MCP tools with in memory

* fix: stop using prisma.models

* fix: code qa check

* fix: import MCP

* fix: code QA checks

* fix: code QA checks

* fixes - only list tools for the specific MCP server

* fix: only list MCP tools for selected server

* fix linting error

---------

Co-authored-by: Tyler Wagner <[email protected]>
Co-authored-by: wagnerjt <[email protected]>
stefan-- pushed a commit to stefan--/litellm that referenced this pull request Jun 12, 2025
* feat: MCP Servers with CRUD operations (BerriAI#10699)

* feat: mcp CRUD operations with authn/authz

* feat: mcp server UI

* mcp server page with overview, mcp tools, and settings page

* Adding MCP Server flow

* prisma generate before test

* UI callbacks add/remove with api server refetch

* test fix: poetry run prisma

* feat: mcp server db and config connection

* fix: MCPTool filter on description when not present

* feat: mcp on UI and integrated with list tools

* feat: Update mcp server endpoint

* tests: Unit and integration tests for mcp management endpoints

* fix: docs and ensuring global_mcp_manage up to date

* ui: remove the mcp tools view

* fix: ruff lint

* fix: unit -> integration test area

* fix(ui): remove left nav menu of previous tools

---------

Co-authored-by: wagnerjt <[email protected]>
Co-authored-by: Ishaan Jaff <[email protected]>

* fix: sync DB MCP tools with in memory

* fix: sync DB MCP tools with in memory

* fix: stop using prisma.models

* fix: code qa check

* fix: import MCP

* fix: code QA checks

* fix: code QA checks

* fixes - only list tools for the specific MCP server

* fix: only list MCP tools for selected server

* fix linting error

---------

Co-authored-by: Tyler Wagner <[email protected]>
Co-authored-by: wagnerjt <[email protected]>
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