Web Search MCP Server
Enables web search functionality using Google Custom Search API to find and retrieve relevant web pages and summaries from internet searches
Utilizes Google Cloud Console services to access and configure Google Custom Search API for web search capabilities
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Web Search MCP Serversearch for the latest advancements in quantum computing and summarize the top 3 results"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Web Search MCP Server
一个为 AgentX 平台设计的网页搜索 MCP(Model Context Protocol)服务器,提供强大的网页搜索和内容抓取功能。
🚀 功能特性
网页搜索: 使用 Google Custom Search API 进行互联网搜索
内容抓取: 抓取指定网页的文本内容和元数据
智能组合: 搜索并自动抓取前几个结果的内容
多语言支持: 支持中文、英文等多种语言搜索
模拟模式: 无需API密钥即可测试基本功能
Related MCP server: DuckDuckGo MCP Server
🛠️ 工具列表
1. web_search
在互联网上搜索信息,返回相关的网页链接和摘要。
参数:
query(必需): 搜索查询关键词maxResults(可选): 最大返回结果数量,默认10language(可选): 搜索语言,默认zh-CN
2. web_scrape
抓取指定网页的内容,提取文本和元数据。
参数:
url(必需): 要抓取的网页URLextractText(可选): 是否提取纯文本内容,默认trueextractMetadata(可选): 是否提取元数据,默认true
3. web_search_and_scrape
搜索网页并抓取前几个结果的内容。
参数:
query(必需): 搜索查询关键词maxResults(可选): 最大抓取结果数量,默认3language(可选): 搜索语言,默认zh-CN
📦 安装和配置
1. 安装依赖
npm install2. 配置环境变量
复制 env.example 为 .env 并配置:
cp env.example .env编辑 .env 文件:
# Google Custom Search API 配置
SEARCH_API_KEY=your_google_api_key
SEARCH_ENGINE_ID=your_search_engine_id
# 可选配置
SEARCH_PROVIDER=google
REQUEST_TIMEOUT=10000
MAX_RESULTS=10
LOG_LEVEL=info3. 获取 Google Custom Search API 密钥
创建新项目或选择现有项目
启用 Custom Search API
创建 API 密钥
创建自定义搜索引擎:
创建新的搜索引擎
获取搜索引擎ID
🚀 运行
开发模式
npm run dev生产模式
npm run build
npm start🔧 在 AgentX 中集成
1. 部署到 MCP Gateway
在 AgentX 中,通过以下方式部署此 MCP 服务器:
# 使用 npm 安装命令
npm install -g web-search-mcp
# 或者使用 git 克隆
git clone https://github.com/Mantraa-Zzz/mcp.git
cd mcp
npm install
npm run build2. 配置 AgentX
在 AgentX 的 .env 文件中确保 MCP Gateway 配置正确:
# MCP Gateway 配置
MCP_GATEWAY_BASE_URL=http://localhost:8081
MCP_GATEWAY_API_KEY=1234563. 重启 AgentX 容器
docker restart agentx📝 使用示例
在 AgentX 中创建 Agent 时使用
登录 AgentX 管理界面
创建新的 Agent
在工具配置中选择 "web_search" 相关工具
Agent 将能够使用网页搜索功能
示例对话
用户: "帮我搜索最新的 AI 技术趋势"
Agent: 我将为您搜索最新的 AI 技术趋势信息。
调用 web_search 工具
查询: "最新 AI 技术趋势 2024"
返回相关网页链接和摘要
用户: "抓取第一个搜索结果的内容"
Agent: 我将抓取第一个搜索结果的详细内容。
调用 web_scrape 工具
URL: [第一个搜索结果的URL]
返回完整的网页内容
🔍 测试
模拟模式测试
即使没有配置 Google API 密钥,服务器也会返回模拟数据,方便测试基本功能。
真实 API 测试
配置正确的 API 密钥后,可以获取真实的搜索结果。
📋 技术栈
TypeScript: 主要开发语言
@modelcontextprotocol/sdk: MCP 协议实现
Axios: HTTP 客户端
Cheerio: HTML 解析和内容提取
dotenv: 环境变量管理
🤝 贡献
欢迎提交 Issue 和 Pull Request 来改进这个项目!
📄 许可证
MIT License
🔗 相关链接
Available Tools
3 toolsweb_scrapeC
抓取指定网页的内容,提取文本和元数据
| Name | Required | Description | Default |
|---|---|---|---|
| extractMetadata | No | 是否提取元数据(默认true) | |
| extractText | No | 是否提取纯文本内容(默认true) | |
| url | Yes | 要抓取的网页URL |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions extraction of text and metadata but fails to describe critical traits such as rate limits, authentication needs, error handling (e.g., for invalid URLs), or output format. This is inadequate for a web scraping tool that likely involves network operations and potential restrictions.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence in Chinese that directly states the tool's function without unnecessary words. It is front-loaded with the core purpose and appropriately sized for a simple tool, making it easy for an agent to parse quickly.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the complexity of web scraping (involving network calls, potential errors, and content parsing) and the absence of both annotations and an output schema, the description is insufficient. It does not explain what 'extract text and metadata' entails in practice (e.g., structured data, limitations), leaving gaps in understanding the tool's behavior and results.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 100% description coverage, clearly documenting all three parameters (url, extractText, extractMetadata) with their types, defaults, and purposes. The description adds no additional parameter semantics beyond what the schema provides, so it meets the baseline score of 3 for high schema coverage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose as '抓取指定网页的内容,提取文本和元数据' (scrape content from specified web pages, extract text and metadata), which includes a specific verb ('抓取' - scrape) and resource ('网页' - web pages). It distinguishes from sibling tools like 'web_search' by focusing on extraction rather than searching, though it doesn't explicitly mention how it differs from 'web_search_and_scrape'.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives like 'web_search' or 'web_search_and_scrape'. It lacks context on prerequisites (e.g., URL validity), exclusions (e.g., dynamic content), or comparisons with siblings, leaving the agent to infer usage based on tool names alone.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
web_searchB
在互联网上搜索信息,返回相关的网页链接和摘要
| Name | Required | Description | Default |
|---|---|---|---|
| language | No | 搜索语言(如:zh-CN, en-US) | zh-CN |
| maxResults | No | 最大返回结果数量(默认10) | |
| query | Yes | 搜索查询关键词 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries full burden. It mentions returning '网页链接和摘要' (webpage links and summaries), which is useful behavioral context. However, it doesn't disclose important traits like rate limits, authentication needs, result freshness, or whether this is a read-only operation (though implied by '搜索'). For a search tool with zero annotation coverage, this leaves significant gaps.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is perfectly concise - a single sentence that states the core function and what it returns. Every word earns its place with no redundancy or unnecessary elaboration. It's front-loaded with the main purpose.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given this is a search tool with 3 parameters, 100% schema coverage, but no annotations and no output schema, the description provides basic completeness. It covers the core function and return format, but doesn't address behavioral aspects like rate limits or result structure details that would be helpful for an agent. The absence of output schema means the description should ideally say more about return values.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already fully documents all three parameters (query, language, maxResults). The description doesn't add any parameter-specific information beyond what's in the schema. With complete schema coverage, the baseline score of 3 is appropriate as the description doesn't compensate but also doesn't need to.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: '在互联网上搜索信息' (search for information on the internet) with the verb '搜索' (search) and resource '信息' (information). It distinguishes from sibling 'web_scrape' by focusing on search rather than scraping, but doesn't explicitly differentiate from 'web_search_and_scrape' which combines both functions.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage for general internet searching, but provides no explicit guidance on when to use this tool versus the sibling tools 'web_scrape' or 'web_search_and_scrape'. There's no mention of alternatives, prerequisites, or specific contexts where this tool is preferred over others.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
web_search_and_scrapeC
搜索网页并抓取前几个结果的内容
| Name | Required | Description | Default |
|---|---|---|---|
| language | No | 搜索语言(如:zh-CN, en-US) | zh-CN |
| maxResults | No | 最大抓取结果数量(默认3) | |
| query | Yes | 搜索查询关键词 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions scraping '前几个结果的内容' (content of top results), implying a limit based on search ranking, but lacks details on permissions, rate limits, error handling, or output format. This is inadequate for a tool that performs web operations with potential complexities.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence in Chinese that directly states the tool's function without unnecessary words. It is appropriately sized and front-loaded, making it easy to understand quickly.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (web search and scrape), lack of annotations, and no output schema, the description is incomplete. It doesn't explain what '抓取内容' (scrape content) entails (e.g., full text, metadata), potential limitations, or how results are returned, leaving significant gaps for agent understanding.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema fully documents parameters like 'query', 'maxResults', and 'language'. The description adds no additional semantic context beyond implying '前几个结果' relates to 'maxResults', which is already covered. Baseline 3 is appropriate as the schema handles parameter documentation.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose as '搜索网页并抓取前几个结果的内容' (search web and scrape content of top results), which specifies the verb (search and scrape) and resource (web pages). It distinguishes from 'web_scrape' (scraping only) and 'web_search' (searching only) by combining both functions, though it doesn't explicitly mention this differentiation.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus its siblings 'web_scrape' or 'web_search'. There are no explicit instructions on alternatives, prerequisites, or context for choosing this combined tool over separate ones, leaving usage decisions ambiguous.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
3 tool updates
v1.0.0- First observed
web_scrape - First observed
web_search - First observed
web_search_and_scrape
TDQS
The tools have significant overlap, particularly between web_search and web_search_and_scrape, which both perform search operations. While web_scrape is distinct for direct content extraction, the boundary between the two search tools is unclear, as web_search_and_scrape essentially combines the functionality of the other two, creating redundancy and potential confusion for agent selection.
All tool names follow a consistent snake_case pattern with a clear 'web_' prefix, indicating the domain. The naming is predictable and uniform across all three tools, making it easy to understand their purpose and relationship at a glance.
With only 3 tools, the count feels thin for a web search server, potentially limiting functionality. While it covers basic search and scrape operations, the scope might be too narrow, lacking tools for advanced features like filtering, pagination, or handling different content types, which could hinder comprehensive agent workflows.
The tool set has notable gaps for a web search domain, such as missing operations for filtering search results, handling pagination, or accessing cached content. The redundancy in search tools (web_search and web_search_and_scrape) suggests inefficiency rather than coverage, and there are no tools for managing search sessions or advanced metadata extraction, which could lead to agent failures in complex tasks.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Web research for agents: quality-scored Google search, webpage extraction, and deep research.
Web search, news, page retrieval, sitemaps, and trending topics through Search1API.
Search Google straight from your AI agent. Web results, images, videos, news, products, scholarly ar
Direct access to 40+ scraping and search tools. Extract structured data from Google (Search, Maps, Trends), Amazon, Airbnb, Social Media, and any web page directly into your AI agent.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables search capabilities using a Google Custom Search Engine, allowing users to input a search term and retrieve search result titles, links, and snippets, while facilitating integration with other tools for content extraction and advanced search strategies.145-
- FlicenseNot gradedqualityCmaintenanceEnables web searching through DuckDuckGo and fetching content from webpages. Provides search capabilities with configurable result limits and webpage content extraction for AI assistants.-
- AlicenseNot gradedqualityDmaintenanceEnables web searching through Google, DuckDuckGo, and Bing using a headless Chrome browser, returning structured results with titles, URLs, and snippets. Also supports fetching and extracting text content from any webpage.13MIT
- AlicenseBqualityDmaintenanceEnables Large Language Models to perform real-time web searches using Google Custom Search API. Integrates with Claude Desktop to retrieve current information from the internet.1MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/Mantraa-Zzz/Web_Search'
If you have feedback or need assistance with the MCP directory API, please join our Discord server