MM

marcopesani/mcp-server-serper

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

171 stars 25 forks 质量 70 趋势 17MIT

marcopesani/mcp-server-serper 是从 https://github.com/marcopesani/mcp-server-serper. 导入的 MCP 服务器候选

概览

marcopesani/mcp-server-serper 是从 https://github.com/marcopesani/mcp-server-serper. 导入的 MCP 服务器候选

概述(AI 翻译)

基于TypeScript的MCP服务器,利用Serper API提供网页搜索和网页抓取功能。该服务器与Claude Desktop集成,支持强大的网页搜索和内容提取功能。

特色

工具

  • google_search - 通过 Serper API 进行网页搜索

  • 丰富的搜索结果,包括自然结果、知识图谱、“人们也会问”及相关搜索

  • 支持区域和语言定位

  • 可选参数,如定位、分页、时间滤波器和自动更正

  • 支持高级搜索操作符:

  • site:将结果限制在特定领域

  • filetype:限制特定文件类型(例如,‘pdf’,‘doc’)

  • inurl:搜索URL中单词的页面

  • intitle:搜索标题中含单词的页面

  • related:查找类似网站

  • cache:查看谷歌缓存的特定URL版本

  • before:之前日期,格式为 YYYY-MM-DD

  • after:日期之后,格式为 YYYY-MM-DD

  • exact:精确短语匹配

  • exclude:应排除搜索结果中的词

  • or:替代术语(或运算符)

  • scrape - 从网页中提取内容

  • 获取纯文本和可选的 markdown 内容

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

Serper Search and Scrape MCP Server

A TypeScript-based MCP server that provides web search and webpage scraping capabilities using the Serper API. This server integrates with Claude Desktop to enable powerful web search and content extraction features.

Features

Tools

  • google_search - Perform web searches via Serper API

    • Rich search results including organic results, knowledge graph, “people also ask”, and related searches
    • Supports region and language targeting
    • Optional parameters for location, pagination, time filters, and autocorrection
    • Supports advanced search operators:
      • site: Limit results to specific domain
      • filetype: Limit to specific file types (e.g., ‘pdf’, ‘doc’)
      • inurl: Search for pages with word in URL
      • intitle: Search for pages with word in title
      • related: Find similar websites
      • cache: View Google’s cached version of a specific URL
      • before: Date before in YYYY-MM-DD format
      • after: Date after in YYYY-MM-DD format
      • exact: Exact phrase match
      • exclude: Terms to exclude from search results
      • or: Alternative terms (OR operator)
  • scrape - Extract content from web pages

    • Get plain text and optional markdown content
    • Includes JSON-LD and head metadata
    • Preserves document structure

Requirements

  • Node.js >= 18
  • Serper API key (set as SERPER_API_KEY environment variable)

Development

Install dependencies:

npm install

Build the server:

npm run build

For development with auto-rebuild:

npm run watch

Run tests:

npm test                  # Run all tests
npm run test:watch       # Run tests in watch mode
npm run test:coverage    # Run tests with coverage
npm run test:integration # Run integration tests

Environment Variables

Create a .env file in the root directory:

SERPER_API_KEY=your_api_key_here

Debugging

Since MCP servers communicate over stdio, debugging can be challenging. We recommend using the MCP Inspector, which is available as a package script:

npm run inspector

The Inspector will provide a URL to access debugging tools in your browser.

Installation

Installing via Smithery

To install Serper Search and Scrape for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install @marcopesani/mcp-server-serper --client claude

Claude Desktop

Add the server config at:

  • MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
在 GitHub 查看完整 README

安装

npx -y serper-search-scrape-mcp-server
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "serper-search": { "command": "npx", "args": ["-y", "serper-search-scrape-mcp-server"], "env": { "SERPER_API_KEY": "your_api_key_here" } } } }