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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

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
- GET `/v1/mcp/server/{server_id}/tools` - Get all the tools from the mcp server specified by the `server_id` 
  - (stubbed)
- 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 9, 2025 8:23pm

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


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

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