Shrijeeth-Suresh commited on
Commit
3dd1b2d
·
1 Parent(s): 9cc4f9f

docs: add comprehensive README with installation and usage instructions

Browse files
Files changed (1) hide show
  1. README.md +75 -1
README.md CHANGED
@@ -10,4 +10,78 @@ pinned: false
10
  license: apache-2.0
11
  ---
12
 
13
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  license: apache-2.0
11
  ---
12
 
13
+ # Web Search MCP
14
+
15
+ A unified Gradio-based web application for searching across multiple search engines using the Model Context Protocol (MCP).
16
+
17
+ ## Features
18
+
19
+ - **Tabbed Interface**: Search multiple engines from a single UI (Brave, DuckDuckGo, SearxNG, SerpAPI, Serper, Tavily).
20
+ - **Async & Unified Results**: Fast, standardized results in a consistent table format.
21
+ - **Easy Extension**: Add new search engines with minimal code.
22
+ - **API Key Support**: Bring your own API keys avoiding vendor lock-in.
23
+
24
+ ## About Gradio MCP
25
+
26
+ **Gradio MCP (Model Control Protocol)** is a standardized protocol that allows you to expose your Gradio app’s tools and interfaces so they can be called directly by Large Language Models (LLMs) and agentic AI systems. By launching your app with `mcp_server=True`, it becomes accessible as an MCP server, letting LLMs and compatible clients programmatically use your functions.
27
+
28
+ - Gradio MCP uses your function’s docstrings and type hints to automatically generate tool documentation and parameter descriptions.
29
+ - The MCP server runs alongside the regular Gradio UI and exposes a standardized endpoint (e.g., `/gradio_api/mcp/sse`).
30
+ - Compatible clients (such as Claude Desktop, Cursor, or Cline) can connect to your MCP endpoint for seamless integration.
31
+ - This makes it easy to build advanced AI workflows by connecting your Gradio tools to the broader LLM ecosystem.
32
+
33
+ ## Project Structure
34
+
35
+ - `app.py` — Entry point; builds and launches the Gradio app.
36
+ - `app_wrapper.py` — Manages Gradio TabbedInterface and interface registration.
37
+ - `register_interfaces.py` — Registers all search engine wrappers as Gradio tabs.
38
+ - `search_engines/` — Contains wrappers and async search functions for each engine:
39
+ - `brave.py`, `duckduckgo.py`, `searxng.py`, `serpapi.py`, `serper.py`, `tavily.py`, `base.py`
40
+ - `utils/helpers.py` — Utility to map and standardize search results.
41
+ - `requirements.txt` — Python dependencies.
42
+ - `.env` — Store API keys and config (not included in repo).
43
+
44
+ ## Installation
45
+
46
+ 1. **Clone the repository:**
47
+
48
+ ```bash
49
+ git clone <repo-url>
50
+ cd web-search-mcp
51
+ ```
52
+
53
+ 2. **Install dependencies:**
54
+
55
+ ```bash
56
+ pip install -r requirements.txt
57
+ ```
58
+
59
+ 3. **Configure environment:**
60
+
61
+ - Copy `.env.example` to `.env` (if available) and fill in required API keys for the engines you wish to use.
62
+
63
+ ## Usage
64
+
65
+ Run the application:
66
+
67
+ ```bash
68
+ python app.py
69
+ ```
70
+
71
+ The Gradio UI will launch, with a tab for each supported search engine. Enter your query and (where required) API key to search.
72
+
73
+ ## Adding a New Search Engine
74
+
75
+ 1. Create a new wrapper in `search_engines/`, subclassing `BaseInterfaceWrapper`.
76
+ 2. Implement the async search function and result mapping.
77
+ 3. Register your new wrapper in `register_interfaces.py`.
78
+
79
+ ## Contributing
80
+
81
+ - Follow the structure and code style of existing wrappers.
82
+ - Ensure new engines use async functions and standardized result mapping.
83
+ - Submit a pull request with a clear description of changes.
84
+
85
+ ---
86
+
87
+ _This project uses Gradio MCP and LangChain for search engine integration. For more info, see their official docs._