Skip to main content
Glama

mcp-web-search

MCP (Model Context Protocol) server for internet searches, deployed on Vercel as a stateless HTTP API. It allows AI agents like Antigravity to search the web, read pages, consume REST APIs, and extract links — without anti-bot blocking issues.


Available tools

Tool

Description

web_search

Searches the web via Tavily API and returns the title, URL, and snippet of each result

read_webpage

Uses Tavily Extract to download pages bypassing anti-bot blocks and returns content in Markdown, plain text, or HTML

fetch_json

Makes a GET request to any URL via Axios and returns the response JSON (ideal for public REST APIs)

extract_links

Uses Tavily Extract to read the page and extracts all links with domain filter support


Related MCP server: Spider MCP Server

Stack

  • Next.js 16 (App Router) — server framework

  • mcp-handler — HTTP adapter for the MCP protocol

  • @modelcontextprotocol/server — MCP SDK v2

  • Tavily API — official search and page extraction engine (immune to anti-bot blocks)

  • axios + cheerio + turndown — REST API consumption and HTML content parsing

  • Zod v4 — tool schema validation

  • Vercel Hobby — free hosting (60s timeout per request)


Setting up the Tavily API

Because Vercel and other datacenters are often blocked by firewalls when trying to scrape web content, this project uses Tavily, an AI-focused API that can read pages and search the internet with 100% reliability.

To work properly:

  1. Create a free account at tavily.com (you get 1,000 free requests/month).

  2. Go to your hosting dashboard (e.g., Vercel) and add the following Environment Variable:

    • TAVILY_API_KEY: sua_chave_aqui


Deploy to Vercel

Prerequisites

  • Node.js 20+

  • pnpm

1. Clone the repository

git clone https://github.com/suportebono/mcp-web-search.git
cd mcp-web-search
pnpm install

2. Test locally

pnpm dev

The MCP endpoint will be available at http://localhost:3000/api/mcp.

To visually inspect the tools:

npx @modelcontextprotocol/inspector http://localhost:3000/api/mcp

3. Deploy to Vercel

npx vercel

After deployment, you'll receive a URL in the format https://mcp-web-search-xxx.vercel.app. Don't forget to configure the TAVILY_API_KEY!


Setting up in Antigravity

Edit the ~/.gemini/config/mcp_config.json file (create it if it doesn't exist):

{
  "mcpServers": {
    "web-search": {
      "serverUrl": "https://seu-projeto.vercel.app/api/mcp"
    }
  }
}

Restart Antigravity and check under ... > MCP Servers — the 4 tools should appear listed.


Setting up in other MCP clients

Claude Desktop / Cursor / Windsurf

Add to your client's configuration file:

{
  "mcpServers": {
    "web-search": {
      "url": "https://seu-projeto.vercel.app/api/mcp"
    }
  }
}

Clients that only support stdio

Use the mcp-remote package as a proxy:

{
  "mcpServers": {
    "web-search": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://seu-projeto.vercel.app/api/mcp"]
    }
  }
}

Tool reference

Searches the web using the Tavily API.

Parameters:

Name

Type

Required

Description

query

string

Search terms

num_results

number

Number of results (default: 5)

Example response:

[
  {
    "title": "Next.js 15 — Blog",
    "url": "https://nextjs.org/blog/next-15",
    "snippet": "Next.js 15 introduces...",
    "source": "nextjs.org"
  }
]

read_webpage

Reads and extracts the content of a URL bypassing paywalls and anti-bots using Tavily Extract.

Parameters:

Name

Type

Required

Description

url

string

Page URL

mode

"markdown" | "text" | "raw_html"

Output format (default: markdown)

Automatically removes scripts, styles, ads, navigation, and footer before returning the content.


fetch_json

Makes a GET request via Axios and returns the raw JSON.

Parameters:

Name

Type

Required

Description

url

string

API URL

headers

Record<string, string>

Optional HTTP headers


Uses Tavily Extract to read the page's actual HTML (including dynamic sites) and extracts all links.

Parameters:

Name

Type

Required

Description

url

string

Page URL

filter

string

Filters links containing this substring (e.g., "github.com")

Example response:

[
  {
    "text": "Documentação",
    "href": "/docs",
    "absolute_url": "https://exemplo.com/docs"
  }
]

Project structure

mcp-web-search/
├── app/
│   └── api/
│       └── mcp/
│           └── route.ts        ← Endpoint MCP (GET + POST)
├── lib/
│   ├── mcp-server.ts           ← Registro de todas as ferramentas
│   └── tools/
│       ├── web-search.ts       ← Busca via Tavily API
│       ├── read-webpage.ts     ← Leitura e parsing de páginas (Tavily Extract)
│       ├── fetch-json.ts       ← Fetch de APIs REST genéricas
│       └── extract-links.ts    ← Extração de links via Tavily Extract HTML
├── next.config.ts
└── package.json

Supported MCP protocol

This server implements the MCP 2026-07-28 specification via the stateless Streamable HTTP transport, compatible with modern clients. It also provides automatic fallback for clients using the 2025-era Streamable HTTP specification.


License

MIT

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    D
    maintenance
    Enables AI assistants to access real-time web data through search, markdown scraping, and browser automation while bypassing anti-bot protections. It provides tools for web research, e-commerce monitoring, and data extraction from across the globe.
    4
    7,023 npm
    5
    MIT
  • F
    license
    Not graded
    quality
    C
    maintenance
    Enables AI agents to perform web searches, extract webpage content, and conduct end-to-end search-and-extract operations using multiple search providers and content extraction methods.
    -
  • A
    license
    A
    quality
    A
    maintenance
    Enables AI agents to perform web searches, fetch and extract page content, and crawl sites with caching, rate limiting, and robots.txt compliance, all without needing API keys.
    11
    1
    MIT