{"slug": "getting-the-litellm-proxy-and-mcp-gateway-running-the-steps-that-work-today", "title": "Getting the LiteLLM proxy and MCP gateway running: the steps that work today", "summary": "A developer documented nine configuration failures encountered while setting up LiteLLM 1.110.1 and 1.111.0, publishing a corrected quickstart for running the proxy on port 4000 and the MCP gateway against HTTP, SSE and stdio servers. The writeup notes that the proxy now refuses to start without a master key, that the documented Hugging Face starcoder model is no longer served, and that stdio MCP servers stay disabled unless LITELLM_ENABLE_MCP_STDIO is set, with only a single startup warning as notice.", "body_md": "I installed LiteLLM 1.110.1 on the day it came out and followed the CLI quickstart and the MCP gateway page exactly as written. The proxy had changed faster than the docs. A master key is now required, a few sample requests predate that, and the example model is gone upstream. I hit nine walls before everything worked.\n\nThis post is the version of the quickstart I wish I'd had. Each step is the one that works today. Where the docs say something different, there's a note on what you'll see if you follow them, so you can recognise the error when you hit it.\n\n**Tested on:** LiteLLM 1.110.1 (19 Nov 2026) and again on 1.111.0 (28 Nov 2026). macOS, Python 3.12. Every command below was run on 1.111.0.\n\n**You'll end up with:** the LiteLLM proxy on port 4000, a working chat request, and the MCP gateway serving tools from an HTTP server, an SSE server and a stdio server.\n\n```\npython3 -m venv .venv && source .venv/bin/activate\npip install 'litellm[proxy]'\nexport LITELLM_MASTER_KEY=\"sk-$(openssl rand -hex 32)\"\n```\n\nThe proxy now refuses to start without one. The CLI quickstart doesn't mention it, so the first command on the page exits with:\n\n```\nLiteLLM proxy refused to start: no master key is set\n```\n\nThe error itself is good. It tells you exactly what to run.\n\n**Don't use `sk-1234`.** It's the sample key in a lot of older LiteLLM examples, and the proxy rejects it on purpose as \"a publicly known default\". Generate a real one.\n\nWith an OpenAI key:\n\n```\nexport OPENAI_API_KEY=\"sk-...\"\nlitellm --model gpt-4o-mini\n```\n\nOr with no API key at all, using a local model through [Ollama](https://ollama.com):\n\n```\nollama pull llama3.2:3b\nlitellm --model ollama/llama3.2:3b\n```\n\nThe quickstart uses `huggingface/bigcode/starcoder`. Hugging Face's router doesn't serve that model any more, so the request comes back as:\n\n```\nlitellm.AuthenticationError: HuggingfaceException ...\n```\n\nfollowed by about 300 lines of HTML. That HTML is the huggingface.co home page. It's labelled as an auth error, so you'll probably start checking your Hugging Face token, like I did. The token is fine. The model is gone.\n\n```\ncurl http://0.0.0.0:4000/v1/chat/completions \\\n  -H \"Authorization: Bearer $LITELLM_MASTER_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"model\": \"gpt-4o-mini\", \"messages\": [{\"role\": \"user\", \"content\": \"Say hi\"}]}'\n```\n\n(Use `\"model\": \"ollama/llama3.2:3b\"` if you started with Ollama.)\n\nThe curl on the quickstart page has no `Authorization` header, and the OpenAI Python sample passes `api_key=\"anything\"`. Both were written before the master key was required, and both now return:\n\n```\n{\"error\":{\"message\":\"Authentication Error, No api key passed in.\"}}\n```\n\nIn Python, pass the real key:\n\n``` python\nimport os\nfrom openai import OpenAI\n\nclient = OpenAI(api_key=os.environ[\"LITELLM_MASTER_KEY\"], base_url=\"http://0.0.0.0:4000\")\nprint(client.chat.completions.create(\n    model=\"gpt-4o-mini\",\n    messages=[{\"role\": \"user\", \"content\": \"Say hi\"}],\n).choices[0].message.content)\n```\n\n**Skip `litellm --test`.** The page tells you to run it in a second shell. Without an argument it crashes with `ValueError: Invalid test value`. `--help` says it takes a URL, but `litellm --test http://0.0.0.0:4000` gives `Unknown command: http://0.0.0.0:4000`, because click reads the URL as a command instead of the option's value. The curl above does the same job.\n\nI used three kinds of MCP server: DeepWiki over streamable HTTP (the one the docs use), the official filesystem server over stdio, and a small SSE server I wrote with the `mcp` SDK, so I could check the SSE path against something I controlled.\n\n```\nexport LITELLM_ENABLE_MCP_STDIO=true\n```\n\nWithout this, stdio servers are disabled. The proxy logs one warning at startup:\n\n```\nMCP server 'fs_mcp' will not start: stdio MCP servers are disabled on this proxy.\n```\n\nAfter that, nothing else tells you. The server is missing from the tool list, and `GET /v1/mcp/server` shows `\"status\": null` for it, the same as for the servers that work. The docs say a disabled stdio server is reported as unhealthy. It isn't. If a stdio server's tools are missing, check this flag before you debug the server.\n\n`transport`\n\n```\nmodel_list:\n  - model_name: gpt-4o-mini\n    litellm_params:\n      model: openai/gpt-4o-mini\n      api_key: os.environ/OPENAI_API_KEY\n\nmcp_servers:\n  deepwiki_mcp:\n    url: \"https://mcp.deepwiki.com/mcp\"\n    transport: \"http\"\n  my_sse_server:\n    url: \"http://localhost:8001/sse\"\n    transport: \"sse\"          # required: the default is http\n  fs_mcp:\n    transport: \"stdio\"\n    command: \"npx\"\n    args: [\"-y\", \"@modelcontextprotocol/server-filesystem\", \"/tmp\"]\n\nlitellm_settings:\n  mcp_aliases:\n    deepwiki: deepwiki_mcp    # must match a key under mcp_servers exactly\nlitellm --config config.yaml\n```\n\nTwo lines in that file are there because of the docs.\n\n**`transport: \"sse\"`.** The Zapier example on the MCP page is a URL ending in `/sse`, with the comment `# SSE Server` and no `transport` key. The same page says transport \"defaults to `http` in `config.yaml`\". Both are true, and together they break. With no transport, the proxy talks HTTP to the SSE server and logs:\n\n``` php\nPOST http://localhost:8001/ -> HTTP 405\n```\n\nThe server's tools never show up, and calling one returns `Tool ping not found`. Adding `transport: \"sse\"` fixes it.\n\n**The alias target.** The page's `mcp_aliases` example maps `deepwiki` to `deepwiki_mcp_server`, but the DeepWiki server defined on the same page is called `deepwiki_mcp`. If you copy both, requests using the alias fail with a 403:\n\n```\nThe key is not allowed to access the requested MCP servers: deepwiki\n```\n\nThat reads like a permissions problem, so I went through key settings first. The real problem is that the alias points at a server that doesn't exist, and nothing warns you at startup. If you see this error, put the alias target and the server name side by side.\n\nOver REST:\n\n```\ncurl http://0.0.0.0:4000/mcp-rest/tools/list \\\n  -H \"x-litellm-api-key: Bearer $LITELLM_MASTER_KEY\"\n```\n\nWith the config above this returns 20 tools: 3 from DeepWiki, 1 from the SSE server and 16 from the filesystem server. The `Bearer` prefix is optional on this header. Both forms work.\n\nTo get one server's tools over REST, add `?server_id=deepwiki_mcp`. The `x-mcp-servers` header doesn't filter this endpoint. It does filter the MCP endpoint at `/mcp`, where `x-mcp-servers: deepwiki` (the alias) returns only DeepWiki's three tools. There the tool names are prefixed with the alias, as in `deepwiki-read_wiki_structure`.\n\n`server_id`\n\n```\ncurl http://0.0.0.0:4000/mcp-rest/tools/call \\\n  -H \"x-litellm-api-key: Bearer $LITELLM_MASTER_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"name\": \"read_wiki_structure\", \"server_id\": \"deepwiki_mcp\", \"arguments\": {\"repoName\": \"BerriAI/litellm\"}}'\n```\n\nThis returns the table of contents of LiteLLM's own DeepWiki. `server_id` takes the server name or the alias, and it's required on this endpoint, even if you use a prefixed tool name.\n\nI tested the gateway directly, over REST and the `/mcp` endpoint, because that's where the config and docs problems were. I didn't put a model in the loop with `/v1/responses` and `server_url: \"litellm_proxy\"`. Doing that with the Ollama model from step 2 is next.\n\nFound on 1.110.1 and re-checked on 1.111.0 against the docs as of 28 Nov 2026. Each is a small docs change, and a few have a product fix that would have saved me the most time.\n\n`LITELLM_MASTER_KEY`.` export` line above the start command.`sk-1234` from older examples is rejected as a known default.`Authorization: Bearer $LITELLM_MASTER_KEY`.` litellm --test` fails with and without a URL.`gpt-3.5-turbo` routing to starcoder, since that alias is never set up.`huggingface/bigcode/starcoder` is gone upstream.`transport: \"sse\"`. Product: warn at startup when a URL ends in `/sse` and transport is `http`.` mcp_aliases` example points at a server name the page never defines, and the error blames the key.`\"status\": null`, like a working server. Report it as `disabled`, as the docs say.\n**Already fixed:** on 19 Nov, the REST docs said `server_id` was optional with a prefixed tool name, but the endpoint required it. The REST page now lists `server_id` as required, so the docs and the endpoint agree.\n\nOnce I got past these, the gateway was solid. Most of the fixes are one line each.", "url": "https://wpnews.pro/news/getting-the-litellm-proxy-and-mcp-gateway-running-the-steps-that-work-today", "canonical_source": "https://dev.to/parth_dagia/getting-the-litellm-proxy-and-mcp-gateway-running-the-steps-that-work-today-11l2", "published_at": "2026-11-28 07:33:18+00:00", "updated_at": "2026-11-28 07:43:34.845407+00:00", "lang": "en", "topics": ["ai-tools", "agent-protocols", "ai-agents", "developer-tools", "large-language-models"], "entities": ["LiteLLM", "Ollama", "OpenAI", "Hugging Face", "DeepWiki", "llama3.2:3b", "gpt-4o-mini"], "also_reported_by": [], "takeaway": "LiteLLM 1.110.1+ requires a generated LITELLM_MASTER_KEY (the sample sk-1234 is rejected) and LITELLM_ENABLE_MCP_STDIO=true to start stdio MCP servers, which otherwise fail silently with only one startup warning.", "recommendation": {"advice": "Set a generated LITELLM_MASTER_KEY and LITELLM_ENABLE_MCP_STDIO=true before starting the LiteLLM proxy, and verify each MCP server's status via GET /v1/mcp/server rather than trusting the startup log.", "playbook": "agent-architecture", "playbook_url": "https://wpnews.pro/playbooks/agent-architecture"}, "alternates": {"html": "https://wpnews.pro/news/getting-the-litellm-proxy-and-mcp-gateway-running-the-steps-that-work-today", "markdown": "https://wpnews.pro/news/getting-the-litellm-proxy-and-mcp-gateway-running-the-steps-that-work-today.md", "text": "https://wpnews.pro/news/getting-the-litellm-proxy-and-mcp-gateway-running-the-steps-that-work-today.txt", "jsonld": "https://wpnews.pro/news/getting-the-litellm-proxy-and-mcp-gateway-running-the-steps-that-work-today.jsonld"}}