Skip to main content
Glama

mcp-web-search

用于互联网查询的 MCP(模型上下文协议)服务器,以无状态 HTTP API 的形式部署在 Vercel 上。它允许诸如 Antigravity 之类的 AI 代理搜索网页、阅读页面、调用 REST API 并提取链接——不会遇到反机器人封锁的问题。


可用工具

工具

描述

web_search

通过 Tavily API 进行互联网搜索,并返回每个结果的标题、URL 和摘要

read_webpage

使用 Tavily Extract 下载页面以绕过反机器人封锁,并以 Markdown、纯文本或 HTML 形式返回内容

fetch_json

通过 Axios 对任何 URL 执行 GET 请求并返回响应的 JSON(非常适合公共 REST API)

extract_links

使用 Tavily Extract 读取页面并提取所有链接,支持按域名过滤


Related MCP server: Spider MCP Server

技术栈

  • Next.js 16(App Router)——服务器框架

  • mcp-handler——MCP 协议的 HTTP 适配器

  • @modelcontextprotocol/server——MCP v2 SDK

  • Tavily API——官方页面搜索和提取机制(不受反机器人封锁影响)

  • axios + cheerio + turndown——用于调用 REST API 和解析 HTML 内容

  • Zod v4——工具 schema 验证

  • Vercel Hobby——免费托管(每个请求 60 秒超时)


配置 Tavily API

由于 Vercel 和其他数据中心在尝试抓取网页内容(scraping)时经常被防火墙屏蔽,本项目使用 Tavily,这是一个专注于 AI 的 API,能够 100% 可靠地读取页面并在互联网上搜索。

要使其完美运行:

  1. tavily.com 创建一个免费账户(每月可免费使用 1,000 次请求)。

  2. 前往你的托管服务控制面板(例如 Vercel)并添加以下环境变量:

    • TAVILY_API_KEYsua_chave_aqui


部署到 Vercel

前提条件

  • Node.js 20+

  • pnpm

1. 克隆仓库

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

2. 本地测试

pnpm dev

MCP 端点将位于 http://localhost:3000/api/mcp

要以可视方式检查这些工具:

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

3. 发布到 Vercel

npx vercel

部署完成后,你将收到一个格式为 https://mcp-web-search-xxx.vercel.app 的 URL。别忘了配置 TAVILY_API_KEY


在 Antigravity 中配置

编辑文件 ~/.gemini/config/mcp_config.json(如果不存在则创建):

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

重启 Antigravity 并检查 ... > MCP Servers ——这 4 个工具应该会列出来。


在其他 MCP 客户端中配置

Claude Desktop / Cursor / Windsurf

添加到你的客户端配置文件:

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

仅支持 stdio 的客户端

使用 mcp-remote 包作为代理:

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

工具参考

使用 Tavily API 进行互联网搜索。

参数:

名称

类型

必填

描述

query

string

搜索关键词

num_results

number

结果数量(默认:5)

返回示例:

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

read_webpage

使用 Tavily Extract 读取并提取 URL 的内容,绕过付费墙和反机器人机制。

参数:

名称

类型

必填

描述

url

string

页面 URL

mode

"markdown" | "text" | "raw_html"

输出格式(默认:markdown

在返回内容之前会自动删除脚本、样式、广告、导航和页脚。


fetch_json

通过 Axios 发出 GET 请求并返回原始 JSON。

参数:

名称

类型

必填

描述

url

string

API URL

headers

Record<string, string>

可选的 HTTP 请求头


使用 Tavily Extract 读取页面的真实 HTML(包括动态网站)并提取所有链接。

参数:

名称

类型

必填

描述

url

string

页面 URL

filter

string

过滤包含该子字符串的链接(例如:"github.com"

返回示例:

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

项目结构

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

支持的 MCP 协议

此服务器通过 Streamable HTTP stateless 传输实现了 MCP 2026-07-28 规范,兼容现代客户端。它还支持为使用 2025 时代 Streamable HTTP 规范的客户端提供自动回退。


许可证

MIT

A
license - permissive license
Not graded
quality - not tested
B
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

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
    6,103
    6
    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
    Not graded
    quality
    C
    maintenance
    Enables AI agents to fetch and extract clean, readable content from web pages, and search within pages for specific queries, without needing a full browser.
    1
    MIT

View all related MCP servers

Related MCP Connectors

  • Reliable web access for AI agents: smart HTTP, rotating proxies, and full-browser rendering.

  • AI-powered browser automation — navigate, click, fill forms, and extract data from any website.

  • Give your agent live data from Twitter, Reddit, the web and GitHub. No API keys, no scraping stack.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/DaviDaminelli/mcp-web-search'

If you have feedback or need assistance with the MCP directory API, please join our Discord server