Setting Up SearXNG with Jan-V1

jan-v1mcpsearchSearXNG
Setting Up SearXNG with Jan-V1

Jan-V1 when used with research prompt and SearXNG

Introduction

SearXNG is a privacy-respecting metasearch engine that can be integrated with Jan-V1 as a Model Context Protocol (MCP) tool. This guide will walk you through setting up SearXNG as your search and web scraping solution, offering a powerful alternative to Serper API while maintaining complete control over your search infrastructure.

Prerequisites

Before getting started, ensure you have:

  • Docker and Docker Compose installed on your system
  • Completed setting up Jan-V1

Part 1: Setting Up SearXNG

Step 1: Clone the Repository

We’ll use a specially configured fork of SearXNG-docker configured for MCP integration:

git clone https://github.com/menloresearch/searxng-docker-for-mcp.git
cd searxng-docker-for-mcp

Step 2: Generate Security Key

Generate a secure secret key for your SearXNG instance:

For Linux/WSL:

sed -i "s|ultrasecretkey|$(openssl rand -hex 32)|g" searxng/settings.yml

For macOS:

sed -i '' "s|ultrasecretkey|$(openssl rand -hex 32)|g" searxng/settings.yml

Step 3: Start SearXNG

Launch the SearXNG service using Docker Compose:

docker compose up -d

Your SearXNG instance will be available at http://localhost:8080 once the containers are running.

Note: For detailed configuration options and troubleshooting, refer to the repository documentation.

Part 2: Configuring Jan-V1 MCP Integration

Step 1: Add SearXNG MCP Server

Configure the SearXNG MCP server in Jan-V1:

  1. Go to Settings ⚙️MCP Servers
  2. Click the button to add a new MCP server
  3. Enter the following configuration:

SearXNG MCP Configuration

Step 2: Activate Search Tools

Enable the SearXNG tools in your chat interface:

  1. Navigate to any Chat Page
  2. Click the Toggle Tool 🔧 button
  3. Enable the following tools:
    • searxng_web_search - for web search functionality
    • web_url_read - for web page content extraction

Enable Tool Use

Conclusion

You now have a fully functional SearXNG integration with Jan-V1, providing powerful search and web scraping capabilities while maintaining privacy and control over your search infrastructure. This setup offers a robust alternative to commercial search APIs and can be customized to meet your specific needs.