Menu

Integrations / Frameworks & SDKs

LiteLLM

MillionShort search as an MCP server in the LiteLLM proxy, for every model behind it.

Copy as MarkdownOpen in ChatGPT (opens in a new tab)Open in Claude (opens in a new tab)

MCPProxy config, Python and TypeScript clientsNothing of ours to installWorks with no keyChecked 2026-11-19

The LiteLLM proxy connects to the MillionShort MCP server for you. You add it once to the proxy's config.yaml, with the key; then any client of the proxy can give any model behind it the server's tools (the MCP page lists them), without seeing the key. The LiteLLM Python SDK can also load the tools straight from the server, with no proxy.

1Install

Choose one
Shell
pip install 'litellm[proxy]' openai mcp
export MILLIONSHORT_API_KEY=ms-YOUR_API_KEY

The proxy needs litellm[proxy] (Python 3.10 or later). The clients below use the OpenAI SDK pointed at the proxy, so the TypeScript side needs only openai. Get a MillionShort key in the dashboard; an agent can ask for a trial key by itself.

2Add the server to the proxy

Add an entry under mcp_servers. The name you give it (millionshort) is the server's alias. auth_type: "bearer_token" sends Authorization: Bearer <auth_value>, so put the key alone in auth_value, without the word Bearer. os.environ/ reads it from the proxy's environment.

config.yaml
model_list:
  - model_name: gpt-6.1-sol
    litellm_params:
      model: openai/gpt-6.1-sol
      api_key: os.environ/OPENAI_API_KEY

mcp_servers:
  millionshort:
    url: "https://mcp.millionshort.com/mcp"
    transport: "http"
    description: "MillionShort web search"
    auth_type: "bearer_token"
    auth_value: "os.environ/MILLIONSHORT_API_KEY"

Without a key, leave auth_type and auth_value out. Set transport: "http" (streamable HTTP) explicitly: it is the default in config.yaml, but LiteLLM's management API defaults to SSE. Then start the proxy:

Shell
litellm --config config.yaml

In the Admin UI you can do the same under MCP Servers, Add New MCP Server: the URL, transport Streamable HTTP, then the authentication.

3Use it from a client

Send a request to the proxy's Responses API with an mcp tool whose server_url is litellm_proxy/mcp/millionshort. That tells the proxy to use the server from its config; do not put the proxy's own address there. With require_approval: "never" the proxy runs the tool calls itself. Authenticate with your LiteLLM key (LITELLM_API_KEY here), not the MillionShort key.

Choose one
Python
import os

from openai import OpenAI

client = OpenAI(base_url="https://your-litellm-proxy.example.com", api_key=os.environ["LITELLM_API_KEY"])

response = client.responses.create(
    model="gpt-6.1-sol",
    instructions="Use the millionshort search tool for anything recent or niche, and cite the URLs.",
    input="Find independent blogs about home espresso, without the 1,000 most popular sites.",
    tools=[
        {
            "type": "mcp",
            "server_label": "millionshort",
            "server_url": "litellm_proxy/mcp/millionshort",
            "require_approval": "never",
        }
    ],
)
print(response.output_text)

server_url: "litellm_proxy" gives the model every MCP server the key may use. The proxy's /v1/chat/completions endpoint takes the same mcp tool definition. MCP clients that connect directly (an IDE, an agent framework) use the proxy's gateway address for one server, https://your-litellm-proxy.example.com/millionshort/mcp, with the header x-litellm-api-key: Bearer <your LiteLLM key>.

4Check it works

List the server's tools through the proxy, without a model:

Shell
curl -s "https://your-litellm-proxy.example.com/mcp-rest/tools/list?server_id=millionshort" \
  -H "Authorization: Bearer $LITELLM_API_KEY"

You should see search, get_domain_info, list_sources and the tools of the other endpoints (with no key, fewer, search and list_sources among them). In the Admin UI, MCP Servers lists millionshort. When a model sees tools from several servers, LiteLLM prefixes each with the server's name and a hyphen: millionshort-search. If the model answers from memory, say when to search in its instructions:

Use the MillionShort search tool for anything recent, niche, or that needs a source. To reach lesser-known sites, set remove_top_sites (for example 1000). Cite the URLs it returns.

Without the proxy: the Python SDK

The LiteLLM Python SDK can load MCP tools from a session in OpenAI's format, so any model LiteLLM calls can use them. You run the tool calls with call_openai_tool. This uses the MCP Python SDK 2.x client:

Python
import asyncio
import os

import httpx2
import litellm
from litellm import mcp_client
from mcp import ClientSession
from mcp.client.streamable_http import streamable_http_client


async def main():
    headers = {"Authorization": f"Bearer {os.environ['MILLIONSHORT_API_KEY']}"}
    async with httpx2.AsyncClient(headers=headers, timeout=httpx2.Timeout(30.0, read=300.0)) as http:
        async with streamable_http_client("https://mcp.millionshort.com/mcp", http_client=http) as (read, write):
            async with ClientSession(read, write) as session:
                await session.initialize()
                tools = await mcp_client.load_mcp_tools(session=session, format="openai")
                messages = [{"role": "user", "content": "Find independent blogs about home espresso."}]
                response = await litellm.acompletion(model="gpt-6.1-sol", messages=messages, tools=tools)
                message = response.choices[0].message
                messages.append(message)
                for call in message.tool_calls or []:
                    result = await mcp_client.call_openai_tool(session=session, openai_tool=call)
                    messages.append({"role": "tool", "tool_call_id": call.id, "content": result.content[0].text})
                final = await litellm.acompletion(model="gpt-6.1-sol", messages=messages, tools=tools)
                print(final.choices[0].message.content)


asyncio.run(main())

Without a key, create the httpx2.AsyncClient with no headers. litellm.experimental_mcp_client is the older, deprecated name of litellm.mcp_client.

MCP configuration

The same address for every client: https://mcp.millionshort.com/mcp, streamable HTTP.

ModeHowWhat the agent gets
API keySend Authorization: Bearer ms-YOUR_API_KEYEvery tool, at your plan's limits; calls use your credits
No keySend no Authorization headersearch, list_sources and a few more; one source and up to 5 results a search, 10 free searches a day

Tools

ToolWhat it doesWithout a keyCost
searchSearches the web and the specialist sources, with the popularity, domain, page-type, topic, site and date filtersYes: one source, up to 5 results1 credit per source searched, first 10 results
get_domain_infoPopularity and risk for up to 25 sitesNo1 credit
list_sourcesThe sources, page types and topics search acceptsYes: source namesFree
The tools of the other endpointsextract, map, crawl, places and more: the MCP page lists themA few, such as placesWhat the API call behind each costs

Settings

VariableMeaning
MILLIONSHORT_API_KEYYour key. The proxy reads it through os.environ/MILLIONSHORT_API_KEY; the SDK example reads it directly. Leave it out for the no-key mode

Costs and limits

A tool call costs what the API call behind it costs: 1 credit per source searched for the first 10 results, 1 credit for a domain lookup, nothing for the list of sources, the price of the endpoint for the other tools, and nothing at all in the no-key mode. An agent that loops can make many calls: give it a step limit, and ask for fewer results when a few will do. Credits and limits has the numbers.

Every search a model makes through the proxy counts against the one key in config.yaml, whoever sent the request.

When it fails

What you seeWhyFix
The server does not connect, or no tools are listedThe address or the transport is not the one the server speaksUse exactly https://mcp.millionshort.com/mcp and the streamable HTTP transport (often called http), not SSE
401 or "unauthorized"The key is wrong, or it was sent without Bearer Send Authorization: Bearer ms-..., or leave the header out to use the no-key mode
"10 free searches a day without a key"The no-key mode's daily searches are used upAdd a key: it is free in the dashboard
INSUFFICIENT_CREDITSThe plan's credits are used upStop and add credits; retrying does not help
The agent answers from memory, or uses another searchNothing told it when to use this oneTurn off its own search where it can be (this page says how), and add the line for its instructions
The model gets no MillionShort toolsserver_url is the proxy's own address, or the alias does not matchUse litellm_proxy/mcp/millionshort, with the name from mcp_servers
The server shows no tools, or fails to connecttransport is SSE (the management API's default)Set transport: "http"
A virtual key gets no tools that the master key getsLiteLLM limits MCP servers per key and teamGive the key or its team access to millionshort in the Admin UI

This page as Markdown ยท llms.txt