Search1API MCP server

Execute web searches, news queries, and content extraction.
Back to servers
Setup instructions
Provider
fatwang2
Release date
Nov 26, 2024
Language
TypeScript
Package
Stats
7.9K downloads
148 stars

Search1API MCP Server is a tool that provides search and web crawling functionality through the Model Context Protocol. It allows AI assistants to access real-time web information, news, perform content extraction, and more using Search1API services.

Prerequisites

  • Node.js >= 18.0.0
  • A valid Search1API API key

Installation

  1. Clone the repository:

    git clone https://github.com/fatwang2/search1api-mcp.git
    cd search1api-mcp
    
  2. Configure API Key: You'll need to set up your Search1API key before building the server (see Setup Guide below).

  3. Install dependencies and build:

    npm install
    npm run build
    

Setup Guide

Getting a Search1API Key

  1. Register at Search1API
  2. Obtain your API key from your dashboard

Configuring Your API Key

Choose one of these methods to provide your API key:

Method A: Using a .env File (Recommended)

  1. Create a .env file in the project root:
    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 the build commands

Method B: Using Environment Variables

Set the environment variable before starting the server:

export SEARCH1API_KEY="your_api_key_here"
npm start

Method C: MCP Client Configuration

Some MCP clients allow specifying environment variables in their configuration:

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

Starting the Server

Once configured, start the server:

npm start

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

Integration with LibreChat (Docker)

Step-by-Step Instructions

  1. Clone the repository next to your LibreChat setup:

    cd /path/to/your/librechat/setup/mcp-server
    git clone https://github.com/fatwang2/search1api-mcp.git
    
  2. Configure your API key (required for LibreChat):

    cd search1api-mcp
    echo "SEARCH1API_KEY=your_api_key_here" > .env
    
  3. Build the server:

    npm install
    npm run build
    
  4. Configure librechat.yaml by adding:

    mcp_servers:
      search1api:
        command: node
        args:
          - /app/mcp-server/search1api-mcp/build/index.js
    
  5. Update Docker volume bindings in your docker-compose.yml or docker-compose.override.yml:

    services:
      api:
        volumes:
          - ./mcp-server/search1api-mcp:/app/mcp-server/search1api-mcp
    
  6. Restart LibreChat:

    docker compose down && docker compose up -d --build
    

Available Tools

Search Tool

Performs web searches using multiple search engines.

{
  "name": "search",
  "parameters": {
    "query": "latest AI research papers 2023",
    "max_results": 5,
    "search_service": "google",
    "crawl_results": 2,
    "include_sites": "arxiv.org,nature.com",
    "exclude_sites": "wikipedia.org",
    "time_range": "month"
  }
}

News Tool

Searches for news articles from various sources.

{
  "name": "news",
  "parameters": {
    "query": "renewable energy breakthroughs",
    "max_results": 5,
    "search_service": "bing",
    "time_range": "month"
  }
}

Crawl Tool

Extracts content from a specific URL.

{
  "name": "crawl",
  "parameters": {
    "url": "https://example.com/article"
  }
}

Sitemap Tool

Retrieves all related links from a URL.

{
  "name": "sitemap",
  "parameters": {
    "url": "https://example.com"
  }
}

Reasoning Tool

Uses DeepSeek R1 model for deep thinking and complex problem solving.

{
  "name": "reasoning",
  "parameters": {
    "content": "What are the ethical implications of large language models?"
  }
}

Trending Tool

Gets trending topics from popular platforms.

{
  "name": "trending",
  "parameters": {
    "search_service": "github",
    "max_results": 5
  }
}

Supported Search Services

The Search1API MCP server supports multiple search services including:

  • Google, Bing, DuckDuckGo, Yahoo
  • X (Twitter), Reddit, GitHub
  • YouTube, ArXiv, WeChat
  • Bilibili, IMDB, Wikipedia
  • HackerNews

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "search1api" '{"command":"npx","args":["-y","search1api-mcp"],"env":{"SEARCH1API_KEY":"YOUR_SEARCH1API_KEY"}}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

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

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

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

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later