<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Chab</title>
    <description>The latest articles on DEV Community by Chab (chabai).</description>
    <link>https://dev.to/chabai</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Forganization%2Fprofile_image%2F16465%2Fcf8bc198-2930-411f-b62f-3cd039bacf47.png</url>
      <title>DEV Community: Chab</title>
      <link>https://dev.to/chabai</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/chabai"/>
    <language>en</language>
    <item>
      <title>Giving Claude Google results from any city with an MCP server</title>
      <dc:creator>Vincent Schmalbach</dc:creator>
      <pubDate>Thu, 26 Nov 2026 11:02:37 +0000</pubDate>
      <link>https://dev.to/chabai/giving-claude-google-results-from-any-city-with-an-mcp-server-5b7i</link>
      <guid>https://dev.to/chabai/giving-claude-google-results-from-any-city-with-an-mcp-server-5b7i</guid>
      <description>&lt;p&gt;Google doesn't show everyone the same results. If you search for "emergency plumber" in Leeds, you get Leeds plumbers and a map with Leeds businesses. If you search the same words in Manchester, you see other plumbers and another map. Even a search without a local intent, like "accounting software for freelancers", can look different from one country to the next.&lt;/p&gt;

&lt;p&gt;That matters as soon as you work on a site for someone who isn't sitting where you are. A client asks why they can't find themselves on Google. You search from your own laptop and see the results for your own city, which tells you nothing about theirs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why your own search doesn't help
&lt;/h2&gt;

&lt;p&gt;Google uses your location and your search history to decide what to show you. A VPN changes your IP address, but Google also looks at your browser language and the settings of your Google account. You end up with a mix that doesn't match what a person in that city sees.&lt;/p&gt;

&lt;p&gt;There are cleaner ways to do it by hand:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Google's URL parameters. &lt;code&gt;gl&lt;/code&gt; sets the country and &lt;code&gt;hl&lt;/code&gt; the language. For a city there is the &lt;code&gt;uule&lt;/code&gt; parameter, which takes an encoded location name. It works, but it's fiddly, and you should be logged out while you use it.&lt;/li&gt;
&lt;li&gt;The Ad Preview and Diagnosis tool in Google Ads. You pick a location and see the results page for it. You need a Google Ads account, and you check one search at a time.&lt;/li&gt;
&lt;li&gt;A rank tracker like BrightLocal or the position tracking in Semrush. Both track keywords for a city over time. That is the right tool when you want the same report every week.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What a SERP API gives you
&lt;/h2&gt;

&lt;p&gt;A SERP API runs the search for you from a location you choose and returns the results as JSON. SerpApi and DataForSEO are two well-known ones, and both take a location parameter. If you write code, this is the cleanest route. You send the query and the city, and you get the organic results with their positions.&lt;/p&gt;

&lt;p&gt;With SerpApi, the Leeds search is one request, with the location as a place name:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="s2"&gt;"https://serpapi.com/search.json?engine=google&amp;amp;q=emergency+plumber&amp;amp;location=Leeds,England,United+Kingdom&amp;amp;gl=uk&amp;amp;hl=en&amp;amp;api_key=$SERPAPI_KEY"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you'd rather ask "which plumbers rank in Leeds but not in Manchester?" and get an answer, an MCP server is easier.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the MCP server does
&lt;/h2&gt;

&lt;p&gt;MCP (Model Context Protocol) is the standard AI apps use to connect to outside services. Claude supports it, and so do ChatGPT and most coding agents. A server offers a list of tools. When you ask for something, Claude picks the right tool and reads what comes back.&lt;/p&gt;

&lt;p&gt;For local search, the tool is a Google search with a location. Claude runs it once for Leeds and once for Manchester, and then compares the two lists. You never see the JSON unless you ask for it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setting it up with Chab
&lt;/h2&gt;

&lt;p&gt;I built Chab, which gives AI agents like ChatGPT and Claude 151 tools they don't have on their own. One of them returns Google results the way people in a given country or city see them, with up to 100 results per search. The examples below use Chab, but the idea is the same with any MCP server that wraps a SERP API.&lt;/p&gt;

&lt;p&gt;In Claude Code, add the hosted server:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;claude mcp add --transport http --scope user chab https://www.chab.ai/mcp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then type &lt;code&gt;/mcp&lt;/code&gt; in Claude Code, pick &lt;code&gt;chab&lt;/code&gt; and choose &lt;strong&gt;Authenticate&lt;/strong&gt;. Your browser opens a Chab page where you approve the connection. You can start without an account. The trial has about 50 credits for seven days, and you get 100 more when you sign up.&lt;/p&gt;

&lt;p&gt;In claude.ai, press &lt;strong&gt;Plugins&lt;/strong&gt; in the sidebar, then &lt;strong&gt;Add&lt;/strong&gt; and &lt;strong&gt;Add custom connector&lt;/strong&gt;. Name it &lt;code&gt;Chab&lt;/code&gt; and use &lt;code&gt;https://www.chab.ai/mcp&lt;/code&gt; as the server URL. This works on the free Claude plan too, which allows one custom connector.&lt;/p&gt;

&lt;p&gt;If you'd rather not type any of this, paste this line into your agent. A coding agent sets Chab up by itself, and ChatGPT or Claude tell you where to click:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Set up Chab for me: fetch https://www.chab.ai/agent-setup.md and follow it.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Asking for local results
&lt;/h2&gt;

&lt;p&gt;Name the tool in your first request, so Claude doesn't fall back to its own web search:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Use Chab to show me the top 20 Google results for "emergency plumber"
as people in Leeds, UK see them. Then do the same for Manchester.
Make a table of the domains that rank in both cities, with their
position in each city.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The first time, Claude asks before it uses the tool. After that you can ask follow-up questions in the same chat, like "which of the Leeds results are directories and which are plumbers?", and Claude works from the results it already has.&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting better answers
&lt;/h2&gt;

&lt;p&gt;Give the language when it isn't obvious. A search for "fietsenmaker" in Amsterdam should run in Dutch, and Claude sends that to the tool when you say so.&lt;/p&gt;

&lt;p&gt;Watch out for cities that share a name. Portland in Oregon and Portland in Maine are different places. Chab takes a region next to the city for that. When a name is ambiguous, it searches the biggest place and says which one it picked.&lt;/p&gt;

&lt;p&gt;Ask for mobile results when the business gets its customers from phone searches. The device is a separate setting in the search, and the mobile page can look different.&lt;/p&gt;

&lt;p&gt;Ask for a screenshot when you want to show a client. The results page tool can save a picture of the page as people in that city see it. A screenshot of their competitor in position one is easier to discuss than a table.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it costs
&lt;/h2&gt;

&lt;p&gt;A Google search with up to 20 results costs 2 credits, and the results page with a screenshot costs 7. Paid plans start at $29 a month for 1,000 credits.&lt;/p&gt;

&lt;h2&gt;
  
  
  The same search from a script
&lt;/h2&gt;

&lt;p&gt;When you want the search in a cron job instead of a chat, the REST API takes the same fields:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl -X POST https://www.chab.ai/v1/search/web \
  -H &lt;span class="s2"&gt;"Authorization: Bearer $CHAB_API_KEY"&lt;/span&gt; \
  -H &lt;span class="s2"&gt;"Content-Type: application/json"&lt;/span&gt; \
  -H &lt;span class="s2"&gt;"Idempotency-Key: leeds-plumber-001"&lt;/span&gt; \
  -d &lt;span class="s1"&gt;'{
    "query": "emergency plumber",
    "engine": "google",
    "location": { "country": "GB", "city": "Leeds" },
    "language": "en-GB",
    "device": "mobile",
    "limit": 20
  }'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The response is an operation with a status URL. You poll it, and when the status is &lt;code&gt;succeeded&lt;/code&gt; you fetch the results from the result URL. If you add &lt;code&gt;?wait=20&lt;/code&gt; to the request URL, you get the result in the same reply when the search finishes within 20 seconds. A free guest key returns at most 10 results. Local and English city names both work, so &lt;code&gt;Lisboa&lt;/code&gt; and &lt;code&gt;Lisbon&lt;/code&gt; give the same search.&lt;/p&gt;

&lt;h2&gt;
  
  
  One search is a snapshot
&lt;/h2&gt;

&lt;p&gt;Results move during the day, and Google tests different layouts all the time. A site in position 6 this morning can be in position 8 this afternoon without anything changing on the site. One search from each city tells you who competes there. It doesn't tell you whether a site is going up or down. For that, run the same searches on a schedule and compare them over a few weeks, with a rank tracker or with a small script against the API.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>seo</category>
      <category>mcp</category>
      <category>claude</category>
    </item>
  </channel>
</rss>
