{
 "schema_version": 1,
 "generated": "2026-10-23",
 "id": "berriai-litellm--give-llm-calls-access-to-mcp-tools",
 "repo": "BerriAI/litellm",
 "repo_url": "https://github.com/BerriAI/litellm",
 "repo_slug": "berriai-litellm",
 "title": "Give LLM calls access to MCP server tools",
 "page_title": "How to give LLM calls access to MCP server tools with Litellm",
 "summary": "Load tools from an MCP server and pass them to any LiteLLM model in OpenAI format.",
 "who": "A developer building an agent or chat app who already runs an MCP server and wants a model to call its tools.",
 "problem": "Each model expects tools in its own format, so wiring MCP server tools into LLM calls takes custom glue code.",
 "outcome": "A model call receives the MCP server's tools in OpenAI format and can request them during a chat.",
 "steps": [
  "Install the SDK with `uv add litellm`",
  "Start a stdio MCP server, such as mcp_server.py, and open a ClientSession to it",
  "Call experimental_mcp_client.load_mcp_tools with format=\"openai\"",
  "Pass the returned tools to Litellm.acompletion with a model such as gpt-4o"
 ],
 "agent_prompt": "Using the litellm repo at <path>, connect to the MCP server at <path>/mcp_server.py, load its tools in OpenAI format, and ask gpt-4o 'What is 3 + 5?' with those tools. Expected output: a model response that uses the MCP tool. Verify the tool list is not empty before the call.",
 "agents": [
  "cursor"
 ],
 "difficulty": "Advanced",
 "time": "45 minutes",
 "basis": "readme",
 "caveat": "For MCP OAuth, the upstream provider must approve the app, and reaching its authorization page does not guarantee that tool calls will succeed.",
 "category": "Software and DevOps",
 "tags": [
  "Software and DevOps"
 ],
 "lang": "python",
 "requirements": [
  "Python and the uv package manager installed",
  "API keys for the LLM providers you plan to call, such as OpenAI or Anthropic",
  "For the gateway use cases: a machine to run the proxy server on and a LiteLLM master key or virtual key for clients"
 ],
 "risk": "none",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [
  {
   "tag": "credentials",
   "notice": "MCP servers that use OAuth may need a pre-registered client_id and client_secret, so store those secrets outside the code and out of version control."
  }
 ],
 "best": false,
 "score": 0.8,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/berriai-litellm/give-llm-calls-access-to-mcp-tools/",
 "md": "https://dedupedai.com/use-cases/berriai-litellm/give-llm-calls-access-to-mcp-tools/index.md",
 "disclaimer": "Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked \"Seen in the wild\", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email hello@dedupedai.com and we will look at it promptly.",
 "api": "https://dedupedai.com/api/v1/usecases/berriai-litellm--give-llm-calls-access-to-mcp-tools.json",
 "api_version": "v1"
}
