Skip to main content
Glama
Search1API MCP Server

Search1API MCP Server

Search1API MCP 服务器

中文詳細

使用 Search1API 提供搜索和爬网功能的模型上下文协议 (MCP) 服务器。

先决条件

  • Node.js >= 18.0.0

  • 有效的 Search1API API 密钥(请参阅下面的设置指南,了解如何获取和配置)

Related MCP server: WebSearch-MCP

安装(独立/通用)

  1. 克隆存储库:

    git clone https://github.com/fatwang2/search1api-mcp.git
    cd search1api-mcp
  2. **配置 API 密钥:构建之前,您需要提供您的 Search1API 密钥。请参阅下方的“设置指南”**部分,了解不同的方法(例如,使用.env文件或环境变量)。

  3. 安装依赖项并构建:

    npm install
    npm run build

    注意:如果使用项目的.env文件方法作为 API 密钥,请确保它在此步骤之前存在。

用法(独立/通用)

确保您的 API 密钥已配置(请参阅设置指南)。

启动服务器:

npm start

然后服务器将准备好接受来自 MCP 客户端的连接。

设置指南

1. 获取 Search1API 密钥

  1. 在Search1API注册

  2. 从您的仪表板获取您的 API 密钥。

2. 配置API密钥

您需要向服务器提供您的 API 密钥。请选择以下方法之一:

方法A:项目.env文件(推荐用于独立或LibreChat)

如果与当前版本的 LibreChat 集成,则需要此方法(请参阅下面的具体部分)。

  1. 在search1api-mcp项目根目录中,创建一个名为.env的文件:

    # In the search1api-mcp directory
    echo "SEARCH1API_KEY=your_api_key_here" > .env
  2. 将your_api_key_here替换为您的实际密钥。

  3. 在运行npm install && npm run build之前,请确保此文件存在。

方法 B:环境变量(仅限独立版)

在启动服务器之前设置SEARCH1API_KEY环境变量。

export SEARCH1API_KEY="your_api_key_here"
npm start

方法 C:MCP 客户端配置(高级)

一些 MCP 客户端允许直接在其配置中指定环境变量。这对于 Cursor、VS Code 扩展等客户端非常有用。

{
  "mcpServers": {
    "search1api": {
      "command": "npx",
      "args": [
        "-y",
        "search1api-mcp"
      ],
      "env": {
        "SEARCH1API_KEY": "YOUR_SEARCH1API_KEY"
      }
    }
  }
}

LibreChat 用户须知:由于 LibreChat 目前的局限性,方法 A(项目.env文件)是必需的。请参阅下方专门的集成部分,了解完整说明。

与 LibreChat (Docker) 集成

本节详细介绍了通过 Docker 与 LibreChat 集成所需的步骤。

概述:

  1. 将此服务器的存储库克隆到 LibreChat docker-compose.yml可访问的位置。

  2. 使用此服务器目录中的项目.env文件方法配置所需的 API 密钥。

  3. 构建此服务器。

  4. 通过编辑librechat.yaml告诉 LibreChat 如何运行此服务器。

  5. 确保构建的服务器代码可通过 Docker 卷绑定在 LibreChat 容器内使用。

  6. 重新启动 LibreChat。

步骤:

  1. **克隆存储库:**导航到主机上管理 LibreChat 外部服务的目录(通常与docker-compose.yml放在一起)。常见的位置是专用的mcp-server目录。

    # Example: Navigate to where docker-compose.yml lives, then into mcp-server
    cd /path/to/your/librechat/setup/mcp-server
    git clone https://github.com/fatwang2/search1api-mcp.git
  2. 导航到服务器目录:

    cd search1api-mcp
  3. 配置 API 密钥(项目.env文件方法 - LibreChat 必需):

    # Create the .env file
    echo "SEARCH1API_KEY=your_api_key_here" > .env
    # IMPORTANT: Replace 'your_api_key_here' with your actual Search1API key
  4. **安装依赖项并构建:**此步骤将服务器代码编译到build目录中。

    npm install
    npm run build
  5. **配置librechat.yaml :**编辑主librechat.yaml文件,指定 LibreChat 如何执行此 MCP 服务器。在mcp_servers下添加以下条目:

    # In your main librechat.yaml
    mcp_servers:
      # You can add other MCP servers here too
      search1api:
        # Optional: Display name for the server in LibreChat UI
        # name: Search1API Tools
    
        # Command tells LibreChat to use 'node'
        command: node
    
        # Args specify the script for 'node' to run *inside the container*
        args:
          - /app/mcp-server/search1api-mcp/build/index.js
    • args路径( /app/... )是 LibreChat API 容器内构建的服务器将被访问的位置(感谢下一步中的卷绑定)。

  6. **配置 Docker 卷绑定:**编辑docker-compose.yml文件(或者更可能是docker-compose.override.yml文件),将search1api-mcp目录从主机映射到 LibreChat API 容器中。找到api:服务的volumes:部分:

    # In your docker-compose.yml or docker-compose.override.yml
    services:
      api:
        # ... other service config ...
        volumes:
          # ... other volumes likely exist here ...
    
          # Add this volume bind:
          - ./mcp-server/search1api-mcp:/app/mcp-server/search1api-mcp
    • **主机路径 ( ./mcp-server/search1api-mcp ):**这是主机上相对于docker-compose.yml文件所在位置的路径。如果您将仓库克隆到其他地方,请调整此路径。

    • 容器路径( :/app/mcp-server/search1api-mcp ):这是容器内部的路径。它必须与librechat.yaml``args路径中使用的目录结构匹配。

  7. **重新启动 LibreChat:**通过重建(如果您修改了docker-compose.yml )并重新启动 LibreChat 堆栈来应用更改。

    docker compose down && docker compose up -d --build
    # Or: docker compose restart api (if only librechat.yaml changed)

现在,Search1API 服务器应该可以作为 LibreChat 中的工具提供商使用。

特征

  • 网络搜索功能

  • 新闻搜索功能

  • 网页内容提取

  • 网站站点地图提取

  • 使用 DeepSeek R1 进行深度思考和解决复杂问题

  • 与 Claude Desktop、Cursor、Windsurf、Cline 和其他 MCP 客户端无缝集成

工具

1. 搜索工具

  • 名称: search

  • 描述:使用 Search1API 搜索网页

  • 参数:

    • query (必填):使用自然语言进行搜索查询。为了获得更好的结果,请具体、简洁地填写。

    • max_results (可选,默认值:10):返回的结果数

    • search_service (可选,默认值:“google”):要使用的搜索服务(google、bing、duckduckgo、yahoo、x、reddit、github、youtube、arxiv、wechat、bilibili、imdb、wikipedia)

    • crawl_results (可选,默认值:0):抓取完整网页内容的结果数

    • include_sites (可选):要包含在搜索中的网站列表

    • exclude_sites (可选):从搜索中排除的网站列表

    • time_range (可选):搜索结果的时间范围(“日”、“月”、“年”)

2.新闻工具

  • 名称: news

  • 描述:使用 Search1API 搜索新闻文章

  • 参数:

    • query (必填):使用自然语言进行搜索查询。为了获得更好的结果,请具体、简洁地填写。

    • max_results (可选,默认值:10):返回的结果数

    • search_service (可选,默认值:“bing”):要使用的搜索服务(google、bing、duckduckgo、yahoo、hackernews)

    • crawl_results (可选,默认值:0):抓取完整网页内容的结果数

    • include_sites (可选):要包含在搜索中的网站列表

    • exclude_sites (可选):从搜索中排除的网站列表

    • time_range (可选):搜索结果的时间范围(“日”、“月”、“年”)

3. 爬网工具

  • 名称: crawl

  • 描述:使用 Search1API 从 URL 中提取内容

  • 参数:

    • url (必填):需要抓取的URL

4.网站地图工具

  • 名称: sitemap

  • 描述:从 URL 获取所有相关链接

  • 参数:

    • url (必填):获取站点地图的 URL

5.推理工具

  • 名称: reasoning

  • 描述:用于深度思考和解决复杂问题的工具,具有快速的 deepseek r1 模型和网络搜索能力(您可以在 search1api 网站中更改为任何其他模型,但速度无法保证)

  • 参数:

    • content (必填):需要深入思考的问题

6. 趋势工具

  • 名称: trending

  • 描述:从热门平台获取热门话题

  • 参数:

    • search_service (必需):指定从中获取热门话题的平台(github、hackernews)

    • max_results (可选,默认值:10):返回的趋势项目的最大数量

版本历史记录

  • v0.2.0:添加了对 LibreChat 集成的 fallback .env支持并更新了依赖项。

  • v0.1.8:添加X(Twitter)和Reddit搜索服务

  • v0.1.7:添加了 GitHub 和 Hacker News 的趋势工具

  • v0.1.6:添加维基百科搜索服务

  • v0.1.5:添加了新的搜索参数(include_sites、exclude_sites、time_range)和新的搜索服务(arxiv、wechat、bilibili、imdb)

  • v0.1.4:添加了 deepseek r1 推理工具,并更新了 Cursor 和 Windsurf 配置指南

  • v0.1.3:增加新闻搜索功能

  • v0.1.2:添加了站点地图功能

  • v0.1.1:增加了网页爬取功能

  • v0.1.0:具有搜索功能的初始版本

执照

该项目根据 MIT 许可证获得许可 - 有关详细信息,请参阅 LICENSE 文件。

Available Tools

11 tools
askAsk across sourcesA
Read-only
Inspect

Search several sources at once from a natural-language request when the right engine is unclear. Search1API picks up to five engines (web, Hacker News, Reddit, GitHub, X, arXiv, Wikipedia, and more) and a time window from the wording, then returns up to 10 citable results ranked by relevance, plus the intent it used and any engines that failed. Costs 5 credits per call; use search when you already know the engine.

Inputs: query (required). Returns: errors, intent, results

crawlRead a web pageA
Read-only
Inspect

Read a public web page supplied by the user or returned by search. Returns its title, URL, and main content as text, so you can answer from the full page instead of a snippet.

Inputs: url (required). Returns: result

deepcrawlCrawl a websiteA
Read-only
Inspect

Read many pages of one website in a single task, such as a documentation section, when the user needs content from across a site rather than one page. Finds the site's URLs through its sitemap, keeps those whose path matches the path rules, and returns up to max_pages pages as citable results with title, URL, and Markdown text, plus page counts and the URLs that failed. Costs 20 credits per started task, however many pages it reads. Waits about 45 seconds; if the crawl is still running, the result holds a task_id, and calling deepcrawl again with that task_id collects the pages at no cost. Use crawl for a single page and sitemap for a list of URLs without their content.

Inputs: url, type, task_id, max_pages, +2 more. Returns: note, stats, failed, status, +5 more

mapsFind places on Google MapsA
Read-only
Inspect

Find local businesses and places on Google Maps when the user asks where something is, wants nearby options, or needs a list of businesses with contact details. Returns one page of up to 20 places, each with its name and Google Maps link plus address, phone, website, category, rating, review count, coordinates, and opening hours when available. Costs 3 credits per page, however many places it holds; use search for webpages and crawl to read a business website.

Inputs: query (required), page, country, language, +2 more. Returns: results

newsNews searchA
Read-only
Inspect

Search current news when the user asks about recent events, announcements, or coverage. Returns citable article results with title, URL, snippet, and optional extracted text.

Inputs: query (required), time_range, max_results, crawl_results, +3 more. Returns: results

query_datasetAnswer from a verified fact datasetA
Read-only
Inspect

Answer a question from a curated dataset of facts that Search1API has collected from many sources and cross-checked, instead of searching the open web. Use it when the question falls in a listed dataset: gta6 covers GTA 6 (Grand Theft Auto VI) gameplay, such as missions, vehicles, weapons, money, collectibles, properties, controls, settings and performance, and bugs and fixes. Each result is one short fact with its relevance, a confidence score, how many independent sources state it, whether sources disagree (with the competing claims), and source links to cite. When found is false the dataset has no answer: say so or use search, and do not present the closest facts as the answer. Costs 1 credit only when found is true.

Inputs: query (required), dataset (required), max_results. Returns: found, dataset, results, query_en

render_resultsRender the resultsA
Read-onlyIdempotent
Inspect

Present already retrieved source results as source cards when the host supports UI, with a complete readable text list otherwise. Use when the user wants to browse sources or a visual list helps the task. Pass existing results in the desired order; never invent source URLs or factual titles. Does not search, crawl, fetch URLs, verify sources, or consume search credits. Do not call for intermediate research results or when a text answer is sufficient.

Inputs: results (required), title. Returns: title, total, results

send_feedbackSend feedback to Search1APIAInspect

Report a problem with Search1API to its developers, once you have finished the user's task or given up on it. Report when Search1API lacks a capability the task needed (the most useful report: say what would have helped), a tool failed or returned a wrong, empty or incomplete result, documentation did not match behavior, or a step worked only after retries, workarounds or guessing. Send one report per distinct problem; you do not need to ask the user first. Say how the task ended, name the tool involved, and say what you expected and what happened instead, including the calls you made. Do not report normal successful results. Never include credentials, personal data, or private user content. Reporting is optional and must not block the user's task.

Inputs: message (required), outcome (required), tool, model, +6 more.

sitemapDiscover links on a siteA
Read-only
Inspect

Discover related public links from a page or domain when the user wants to explore a site's structure or available pages. Returns a list of absolute URLs found on that site, which can then be read with crawl.

Inputs: url (required). Returns: links

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.3/5.0

    Scored across 11 tools

    Disambiguation5/5

    The retrieval tools are clearly separated by scope: search uses one chosen engine, ask selects multiple engines when the right one is unclear, and news/trending/maps/query_dataset target distinct source types. Crawl, deepcrawl, and sitemap also separate single-page reading, multi-page site reading, and URL discovery. render_results and send_feedback are clearly non-search utilities, so no two tools appear interchangeable.

    Naming Consistency4/5

    All names use lowercase with snake_case for multiword identifiers, keeping the surface readable and predictable. However, the set mixes verb-led names like search, crawl, ask, and send_feedback with noun labels like maps, news, and sitemap, so it is not a strict verb_noun convention throughout.

    Tool Count5/5

    Eleven tools is well within the appropriate range and each one covers a distinct capability in the search, crawl, and research workflow. There is no obvious filler; even send_feedback is a justified meta-tool for reporting failures.

    Completeness5/5

    The surface covers the full search-to-answer loop: single-engine and multi-source search, specialized news/trending/maps/dataset retrieval, single-page and site-wide crawling, URL discovery, and result presentation. No core workflow dead end is apparent; possible extensions like arbitrary multi-URL fetching or image search are minor rather than obvious gaps.

    Maintenance

    ActivityActive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      C
      maintenance
      Firecrawl, the context API for AI agents, as an MCP server. Search the web, scrape any URL, parse PDFs and documents, crawl and map sites, interact with pages in a real browser, run Agent research jobs, monitor pages for changes, and search scientific papers. Returns clean Markdown or structured JSON. Run locally with npx firecrawl-mcp or connect to https://mcp.firecrawl.dev/v2/mcp
      28
      103,263 npm
      7,980
      MIT
    • A
      license
      B
      quality
      D
      maintenance
      A Model Context Protocol server that enables AI assistants to perform real-time web searches, retrieving up-to-date information from the internet via a Crawler API.
      1
      56 npm
      42
      ISC