Web search MCP server and URL to Markdown API
Use glim_web_search to find sources on the open web by topic. Use glim_web_fetch to turn a URL into Markdown your agent can read and quote. Both tools are available through REST and MCP.
Web search and fetch pricing
- A web search costs $0.01 and returns up to 10 results.
- Fetching one URL costs $0.002. If you already have the URL, you can skip the search.
Pay per call from a wallet without an API key or subscription. To use the curl examples below, replace YOUR_KEY with your glim.sh API key. See Payments & auth for wallet setup.
Search the web with REST or MCP
This query looks for the MCP documentation on connecting local servers. Use include_domains to search specific sites or exclude_domains to leave sites out. REST returns a results array with titles, URLs and a snippet when available.
curl -X POST https://glim.sh/api/v1/web/search \
-H "x-api-key: YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"query":"connect a local MCP server","include_domains":["modelcontextprotocol.io"]}'{
"name": "glim_web_search",
"arguments": {
"query": "connect a local MCP server",
"include_domains": ["modelcontextprotocol.io"]
}
}MCP search returns a compact text list by default. Add "format": "json" to the tool arguments if your agent needs structured results.
Convert a URL to Markdown with REST or MCP
Pass a page URL to fetch its main text as Markdown, the default format. Fetch can extract an HTML article, render a page that loads its text with JavaScript, or read text from a PDF. On HTML pages, add a CSS selector to extract just the part you need.
curl -X POST https://glim.sh/api/v1/web/fetch \
-H "x-api-key: YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"url":"https://modelcontextprotocol.io/docs/getting-started/intro"}'{
"status": 200,
"content": [
"Get started\n\n# What is the Model Context Protocol (MCP)?\n\nMCP (Model Context Protocol) is an open-source standard for connecting AI applications to external systems. ..."
],
"url": "https://modelcontextprotocol.io/docs/getting-started/intro",
"outcome": "success",
"title": "What is the Model Context Protocol (MCP)? - Model Context Protocol",
"total_chars": 2493
}{
"name": "glim_web_fetch",
"arguments": {
"url": "https://modelcontextprotocol.io/docs/getting-started/intro"
}
}In the REST JSON response, read the Markdown from the content array. The MCP tool returns the Markdown as text with the source URL and fetch outcome in its frontmatter.
Web search MCP server
The hosted MCP endpoint for Claude Code and other clients is https://glim.sh/mcp. Choose the command for your client below.
$ claude mcp add -s user -t http glim https://glim.sh/mcp$ codex mcp add glim --url https://glim.sh/mcp$ opencode mcp add$ npx x402-proxy mcp add glim https://glim.sh/mcpTo expose only web search and fetch, use https://glim.sh/mcp?tools=glim_web_search,glim_web_fetch as the server URL. See the MCP quickstart for sign-in and wallet options.
Comparing web search and reader APIs
If you are comparing alternatives to Firecrawl, Tavily, Exa or Jina Reader, count how often your agent searches and how often it reads a page. glim.sh bills each operation per call, with no subscription or API key required when paying from a wallet. The same MCP endpoint also serves Reddit and GitHub.
Good to know
- For a date range, set
published_within_daysto a whole number from 1 to 3650. Leave it out if you also want pages without a known publication date. - Check the fetch
outcomebefore quoting a page. Ateasermay contain only a preview, andlogin_wallmeans the site requires sign-in. - When a Markdown extraction is truncated, REST includes a
download_urlfor the full text. In MCP Markdown, the frontmatter calls this linkdownload_full_url.
Prompts to try
"Search the MCP documentation for local server setup, fetch the most relevant guide, and quote the setup instructions with the source URL."
FAQ
Which API converts a URL to clean Markdown for an LLM?
Send the URL to POST /api/v1/web/fetch on glim.sh. The response includes the extracted Markdown in content, ready to pass to an LLM.
Which MCP server can I use for web search in Claude Code?
Add https://glim.sh/mcp to Claude Code and ask it to use glim_web_search. To read a source behind a search result, ask it to pass that URL to glim_web_fetch.
How much does web search cost for an AI agent?
glim.sh charges $0.01 per search with no subscription. To estimate your agent's cost, count its searches and add $0.002 for each result it opens with the fetch tool.