MCP HubMCP Hub
fatwang2

search1api-mcp

by: fatwang2

search1api mcp

115created 26/11/2024
Visit
search
api

📌Overview

Purpose: The Search1API MCP Server aims to provide robust search and crawl functionalities for enhanced information retrieval and problem-solving.

Overview: The Search1API MCP Server is a Model Context Protocol server that facilitates diverse search capabilities, including web and news searches, content extraction, and deep reasoning tasks, efficiently connecting various MCP clients and services.

Key Features:

  • Web Search Functionality: Enables users to perform comprehensive searches across multiple search engines, allowing for a wide array of results tailored to user queries.

  • Deep Reasoning Tool: Utilizes the DeepSeek R1 model for complex problem solving, combining deep thinking capabilities with web search to provide insightful answers and solutions.


Search1API MCP Server

A Model Context Protocol (MCP) server that provides search and crawl functionality using Search1API.

Prerequisites

  • Node.js >= 18.0.0
  • A valid Search1API API key (see Setup Guide)

Installation (Standalone / General)

  1. Clone the repository:
    git clone https://github.com/fatwang2/search1api-mcp.git
    cd search1api-mcp
    
  2. Configure API Key: Provide your Search1API key (see Setup Guide).
  3. Install dependencies and build:
    npm install
    npm run build
    
    Note: If using the .env file method for the API key, ensure it exists before this step.

Usage (Standalone / General)

Ensure your API key is configured (see Setup Guide).

Start the server:

npm start

The server will be ready to accept connections from MCP clients.

Setup Guide

1. Get Search1API Key

  1. Register at https://www.search1api.com/?utm_source=mcp
  2. Retrieve your API key from the dashboard.

2. Configure API Key

Make your API key available to the server. Choose one of the following methods:

Method A: Project .env File (Recommended for Standalone or LibreChat)

  1. In the project root directory, create .env file with:
    echo "SEARCH1API_KEY=your_api_key_here" > .env
    
  2. Replace your_api_key_here with your actual key.
  3. Ensure this file exists before running npm install && npm run build.

Method B: Environment Variable (Standalone Only)
Set the environment variable before starting:

export SEARCH1API_KEY="your_api_key_here"
npm start

Method C: MCP Client Configuration (Advanced)
Some MCP clients allow setting environment variables in their config:

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

Note for LibreChat Users: Method A (.env file) is required due to current limitations.

Integration with LibreChat (Docker)

Overview

  1. Clone this server's repository in a location accessible by docker-compose.yml.
  2. Use the .env file method to set API key inside the server directory.
  3. Build the server.
  4. Configure LibreChat (librechat.yaml) to run this server.
  5. Bind the server directory as a Docker volume in LibreChat container.
  6. Restart LibreChat.

Steps

  1. Clone the repository:
    cd /path/to/librechat/setup/mcp-server
    git clone https://github.com/fatwang2/search1api-mcp.git
    
  2. Enter the directory:
    cd search1api-mcp
    
  3. Create .env file:
    echo "SEARCH1API_KEY=your_api_key_here" > .env
    
  4. Install dependencies and build:
    npm install
    npm run build
    
  5. Configure librechat.yaml to include:
    mcp_servers:
      search1api:
        command: node
        args:
          - /app/mcp-server/search1api-mcp/build/index.js
    
  6. Edit docker-compose.yml (or override) to bind volume:
    services:
      api:
        volumes:
          - ./mcp-server/search1api-mcp:/app/mcp-server/search1api-mcp
    
  7. Restart LibreChat stack:
    docker compose down && docker compose up -d --build
    # or if only config changed:
    docker compose restart api
    

The Search1API server will then be available as a tool provider within LibreChat.

Features

  • Web search
  • News search
  • Web page content extraction
  • Website sitemap extraction
  • Deep thinking and complex problem solving with DeepSeek R1
  • Integration with Claude Desktop, Cursor, Windsurf, Cline, and other MCP clients

Tools

1. Search Tool

  • Name: search
  • Description: Search the web using Search1API
  • Parameters:
    • query (required): Search query in natural language
    • max_results (optional, default: 10)
    • search_service (optional, default: "google"): Options include google, bing, duckduckgo, yahoo, x, reddit, github, youtube, arxiv, wechat, bilibili, imdb, wikipedia
    • crawl_results (optional, default: 0): Number of results to crawl for full content
    • include_sites (optional)
    • exclude_sites (optional)
    • time_range (optional): "day", "month", "year"

2. News Tool

  • Name: news
  • Description: Search for news articles
  • Parameters similar to Search Tool with default search_service as "bing"

3. Crawl Tool

  • Name: crawl
  • Description: Extract content from a URL
  • Parameters:
    • url (required)

4. Sitemap Tool

  • Name: sitemap
  • Description: Get all related links from a URL
  • Parameters:
    • url (required)

5. Reasoning Tool

  • Name: reasoning
  • Description: Deep thinking and complex problem solving using DeepSeek R1 model and web search
  • Parameters:
    • content (required): The question or problem for reasoning

6. Trending Tool

  • Name: trending
  • Description: Get trending topics from popular platforms
  • Parameters:
    • search_service (required): Platform (github, hackernews)
    • max_results (optional, default: 10)

Version History

  • v0.2.0: Added fallback .env support for LibreChat, updated dependencies
  • v0.1.8: Added X(Twitter) and Reddit search services
  • v0.1.7: Trending tool for GitHub and Hacker News
  • v0.1.6: Added Wikipedia search
  • v0.1.5: New search parameters and services (arxiv, wechat, bilibili, imdb)
  • v0.1.4: Reasoning tool with DeepSeek R1
  • v0.1.3: News search functionality
  • v0.1.2: Sitemap functionality
  • v0.1.1: Web crawling functionality
  • v0.1.0: Initial release with search

License

This project is licensed under the MIT License.