How do I use Grounder with LiteLLM?
Add Grounder to LiteLLM as the search behind a model's built-in web search, as a /v1/search tool or as an MCP server, with a config that gives only search to the keys you choose.
Last checked
To use Grounder (grounder.net) with LiteLLM, make a Grounder search key, add one search tool that points LiteLLM's Tavily search at https://api.grounder.net/compat/tavily, and add Grounder as an MCP server that only your chosen keys can see.
Last checked: 5 November 2026. Disclosure: Grounder (grounder.net) publishes this page. LiteLLM is a separate open-source project by BerriAI, and the config below was checked against LiteLLM 1.108.0.
Three ways to use Grounder through LiteLLM
| Route | What happens | What you set up |
|---|---|---|
| A model's built-in web search, swapped for Grounder | A client such as Claude Code or Claude Desktop asks a model for its web search. LiteLLM takes the request, searches Grounder, and hands the results back to the model. | The search_tools entry and websearch_interception_params below |
LiteLLM's /v1/search | Your code calls POST /v1/search/grounder on LiteLLM, which searches Grounder and returns title, URL and snippet for each result. | The search_tools entry below |
| MCP | An MCP client connects to LiteLLM, sees Grounder's search tool and calls it. The model decides when to search. | The mcp_servers entry below, and a key in the access group |
All three use one Grounder search key. The first two share one search_tools entry. The MCP route is separate: it has its own server entry, its own access check and its own cost line.
Make the key
Make a key under Search keys on your Grounder account and store it as GROUNDER_API_KEY where LiteLLM runs; it is shown once. For a gateway that many people share, choose Search only under Access when you create it: that key can search and list providers and can do nothing else on your account. A key made with Full access, the default, also manages your account and workspaces, which is what you want in your own terminal and not in a shared gateway. Grounder does issue new keys; a write-up that says it does not predates search keys. The HTTP API docs describe the key and the OAuth alternative.
The recommended config
This is one config.yaml with all three routes. The model entry stands in for your own.
model_list:
- model_name: claude-haiku
litellm_params:
model: bedrock/anthropic.claude-haiku-4-5-v1:0
litellm_settings:
callbacks: ["websearch_interception"]
websearch_interception_params:
enabled_providers: ["bedrock", "vertex_ai"]
search_tool_name: grounder
search_tools:
- search_tool_name: grounder
litellm_params:
search_provider: tavily
api_base: https://api.grounder.net/compat/tavily
api_key: os.environ/GROUNDER_API_KEY
input_cost_per_query: 0.019
max_results: 10
search_tool_info:
description: Licensed web search from Grounder, merged and ranked across providers
mcp_servers:
grounder:
url: https://api.grounder.net/mcp
transport: http
auth_type: bearer_token
auth_value: os.environ/GROUNDER_API_KEY
description: Licensed web search from Grounder, merged and ranked across providers
allowed_tools: ["search", "list_providers"]
access_groups: ["web-search"]
mcp_info:
server_name: "Grounder – Licensed Meta Grounding Service"
logo_url: https://grounder.net/brand/grounder-icon-256.png
mcp_server_cost_info:
tool_name_to_cost_per_query:
search: 0.019
What each choice does:
- One search tool,
grounder. It uses Grounder's Tavily-shaped endpoint, which takesmax_resultsup to 100.enabled_providerslists the LiteLLM providers whose models should search through Grounder; LiteLLM's default is Bedrock only. max_results: 10. LiteLLM passes everything in a search tool'slitellm_paramsexceptsearch_provideron to the search, although its documentation lists onlyapi_key,api_base,timeout,max_retriesandinput_cost_per_query. Without it, Grounder returns its default of 5 results.allowed_tools. A full Grounder key sees seven MCP tools, among them ones that create, update and delete workspaces. LiteLLM shows and runs only the two listed, whatever key it holds; a call to any other fails withTool delete_workspace is not allowed for server grounder. LiteLLM accepts the names with or without thegrounder-prefix.access_groupsin place ofallow_all_keys. Only LiteLLM keys in theweb-searchgroup see the server. A key outside the group gets an empty tool list and a refusal on the server's address. Withallow_all_keys: trueevery key would see the two tools.- The server key stays
grounder. LiteLLM builds the tool names (grounder-search) and the server's address (/grounder/mcp) from it, and users paste this config. LiteLLM refuses a hyphen in a server key, so a longer name could not be written the usual way. mcp_info.server_name. The display name is set without changing the key. It changes the server's name in the admin UI's tool views and in the MCP columns of the logs. The card's title in the server list staysgrounder, which is the key. The tool names, the address and the server ID were identical with and without it. The name uses an en dash, because LiteLLM refuses a plain hyphen in names.- Logo and descriptions.
logo_urlreplaces the grey "GR" box on the server's card;descriptionandsearch_tool_info.descriptionfill the description columns of the server list and the Search Tools page. The logo address is the permanent one for Grounder's square icon, so it will not move. - Cost on both routes.
input_cost_per_queryprices each search on the search-tool routes, andtool_name_to_cost_per_queryprices eachsearchtool call on the MCP route;list_providersis free. Without the second, LiteLLM logs an MCP search at zero.
Give a key access
A key reaches Grounder's MCP server when it belongs to the web-search group. Make a key with the group from the admin UI, or through LiteLLM's key API:
curl -X POST $LITELLM_URL/key/generate \
-H "Authorization: Bearer $LITELLM_MASTER_KEY" \
-H "Content-Type: application/json" \
-d '{"object_permission": {"mcp_access_groups": ["web-search"]}}'
A LiteLLM team can hold the same group, and a Toolset (under MCP in the admin UI) can hold Grounder's search for a team instead.
To check the guard, list the tools as a key outside the group and as a key inside it:
curl -s $LITELLM_URL/grounder/mcp \
-H "Authorization: Bearer $LITELLM_KEY" \
-H "Accept: application/json, text/event-stream" \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "id": 1, "method": "tools/list"}'
A key outside the group is refused. A key inside it lists grounder-search and grounder-list_providers, and nothing else. Listing tools does not run a search.
A search-only key is the first guard, and it is Grounder's own: Grounder refuses it the account tool, the workspace tools and the account endpoints, and lists it search and list_providers only, over MCP and the HTTP API. allowed_tools and the access group are a second layer in LiteLLM. Your own client, signed in or with your own full key, still creates, changes and deletes your workspaces as before. Grounder's own deployment shows this: such a key's tool list holds the two tools, and a call to any account tool is refused.
Pricing and the spend log
| What | How it works |
|---|---|
| Free | 50 searches a day, with no card needed |
| Past those | Paid from credit you add, at the per-search price on the Pricing page |
| What the config enters | 0.019 US dollars per search, on both the search tool and the MCP tool |
| What LiteLLM logs | That figure for every search, including the 50 free ones a day |
The config enters that flat figure, so LiteLLM's spend log can run above Grounder's bill. Each Grounder search response carries what the search actually cost, usage.cost_usd: 0 for one of the 50 free searches, otherwise the price on the Pricing page. It is in the response of POST /v1/search, in the structured content of an MCP search call, and as grounder.cost_usd in the Tavily- and Brave-shaped responses. This config does not read it; a gateway that does can log the real charge. The search log under your account shows the real count. A search is one search however many providers Grounder reaches for it.
Claude Desktop through LiteLLM
Claude Desktop can use LiteLLM as its model gateway, and its web searches then run on Grounder through the first route above. Grounder's own test on 4 November 2026 saw this on LiteLLM 1.108.0.
- In Claude Desktop, open Help → Troubleshooting → Enable Developer Mode, then Developer → Configure Third-Party Inference…. Do not sign in with an Anthropic account first.
- In Connection, set Inference provider to Gateway, Credential kind to Static API key, and Gateway auth scheme to Bearer.
- Set Gateway base URL to your LiteLLM address with no
/v1on the end, such ashttp://localhost:4000, LiteLLM's default address, and Gateway API key to a LiteLLM key. - Click Apply Changes, then Save & Restart. The sign-in screen now offers to start in Claude Desktop on 3P with this configuration.
Two things decide how it behaves:
- The first model becomes the default. Desktop reads the models from LiteLLM's
GET /v1/modelsand starts on the first one. List a less expensive model first inmodel_list: with Opus as the default, one question cost 60 cents. Desktop's model picker shows only IDs that look like Claude models; to show an alias, list it in Desktop'sinferenceModelssetting, which its gateway documentation describes. - Its searches run on Grounder only for providers in
enabled_providers. The model Desktop uses must be on one of them.
To confirm a search ran on Grounder, open LiteLLM's spend logs: each search is an asearch row sent to api.grounder.net, and the same search shows in your Grounder account's search log.
To switch back to standard Claude Desktop, choose the Anthropic sign-in on its sign-in screen.
What each MCP admin tab means for Grounder
LiteLLM's admin UI has a tab for each part of its MCP gateway. For Grounder, one takes a decision and the rest need nothing.
| Tab | What it is | For Grounder |
|---|---|---|
| Toolsets | Named sets of tools, assigned to keys or teams | Optional. A "Web search" toolset holding Grounder's search limits it per team |
| Connect | Shows how clients connect to the gateway | Nothing to set |
| Semantic Filter | Sends a model only the tools closest to its request, ranked by an embedding model | Leave it off. It needs an embedding model, only helps with many tools, and can drop Grounder's search tool from a request. The setting is litellm_settings.mcp_semantic_tool_filter |
| Tool Search | Gives models one mcp_tool_search tool to find the others | Leave it off. When it is on, the wording of Grounder's search description decides whether the model finds it. The setting is litellm_settings.mcp_tool_search |
| Network Settings | Which networks may reach each MCP server | Nothing to set. "All Networks" is right for a public service; the per-server setting is available_on_public_internet and the internal ranges are general_settings.mcp_internal_ip_ranges |
| Submitted MCPs | Servers people submitted for approval | Nothing to set |
| Live Connections | The MCP client sessions open now | Nothing to set |
What to know before you rely on it
Four bugs in LiteLLM, all open when this page was checked, concern a model's built-in web search, the first route. /v1/search and the MCP route do not go through that code.
| LiteLLM issue | What happens | State on 4 November 2026 |
|---|---|---|
| #44834 | After a swapped-in search, LiteLLM's follow-up call to the model is capped at 1024 max_tokens whatever the client asked for, so long answers stop mid-sentence. Setting max_tokens on the model does not help | Open. Two fix pull requests are open (#44838, #49413) |
| #44188 | The allowed_domains and blocked_domains a client puts on its web search are dropped, so they never reach Grounder | Open. Two fix pull requests are open (#44284, #44474) |
| #35334 | Claude Code's forced tool_choice carries into the follow-up call after a search | Open. The one fix pull request (#35335) was closed without merging, and no other is open |
| #48384 | On /v1/chat/completions, a Claude search comes back as tool_calls, which can make agent clients loop | Open. A fix pull request is open (#48385); a maintainer replied on 4 November |
Beyond those:
- The model sees title, URL and snippet. LiteLLM reduces each result to those three fields before the model reads it, so the licence and provider information Grounder returns per result does not reach the model on the swapped-in route. The MCP route returns Grounder's full result to the client.
- No recency setting. LiteLLM's search call has no days or date setting, so a swapped-in search cannot be limited to recent pages. Over MCP, the model can set
dayson Grounder'ssearchtool itself. - Result count. On the search-tool routes
max_resultsis set in the config; the model does not choose it. - Interception is for the providers you list. Models on other providers keep their own built-in search.
Where Grounder fits
Grounder is a web search API and MCP server for AI agents. It returns only licensed sources, puts every provider's features behind one call, and marks each result with its provider and why it is licensed. It returns sources, not an answer. The Tavily-shaped endpoint that LiteLLM uses is described in the Tavily migration guide.
FAQ
Which key does LiteLLM need for Grounder?
A Grounder search key, made under Search keys on your account and shown once. Put it in the environment variable GROUNDER_API_KEY; the config reads it from there. LiteLLM sends it to Grounder as a Bearer header on both the search tool and the MCP server.
Can a LiteLLM key that only searches change my Grounder account?
Not when the Grounder key LiteLLM holds is a search-only key. Choose Search only under Access when you make it: it can search and list providers, and Grounder refuses it the account and every workspace tool, so the limit holds even if a LiteLLM key sees more than it should. The MCP server in this guide adds LiteLLM's own limit on top: allowed_tools lists only search and list_providers, and an access group limits which LiteLLM keys see even those two. Your own keys and sign-ins in Claude Code, Codex, Cursor or claude.ai are full, and keep managing your workspaces.
Why does LiteLLM count free searches too?
LiteLLM adds the per-search cost written in its config to every search, including the 50 free searches a day, so its spend log can show more than Grounder charged. Every Grounder search response carries the charge it took, usage.cost_usd, which is 0 for a free search, so a gateway that reads it can log the real charge. Grounder's own search log on your account also shows what each search was charged.
Why do the recommended results come back as 10 and not 5?
Without a setting, Grounder returns 5 results per search. The config sets max_results to 10 on the search tool, and LiteLLM passes it on to Grounder. Raise or lower it between 1 and 100.
Next step
Make a search key, paste the config above into LiteLLM, and set GROUNDER_API_KEY. The MCP docs and the HTTP API describe what each route sends.
Sources
- https://pypi.org/project/litellm/1.108.0/ and the LiteLLM 1.108.0 source: the MCP server manager, the web search interception handler and the Tavily search transformation (4 November 2026)
- https://github.com/BerriAI/litellm/issues/44834 , https://github.com/BerriAI/litellm/issues/44188 , https://github.com/BerriAI/litellm/issues/35334 and https://github.com/BerriAI/litellm/issues/48384 (4 November 2026)
- https://claude.com/docs/third-party/claude-desktop/gateway.md and https://claude.com/docs/third-party/claude-desktop/in-app-configuration.md (4 November 2026)
- https://grounder.net/docs (4 November 2026)
- https://grounder.net/guides/migrate-from-tavily (4 November 2026)
- https://grounder.net/pricing (4 November 2026)