
search rag
RAG search.
Repository Info
About This Server
RAG search.
Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.
Documentation
Search RAG MCP Server
A powerful Model Context Protocol (MCP) server that leverages Apify's RAG Web Browser Actor to search the web and extract content for use with LLMs. This server enables Claude for Desktop and other MCP clients to search for information about people, topics, or specific URLs, making it ideal for retrieval-augmented generation workflows.
Features
- Person Search Tool: Search for detailed information about a person
- Social Media Discovery: Find and extract X/Twitter, Instagram, and Facebook accounts
- Raw Search Tool: Direct web search with customizable parameters
- MCP Integration: Works with Claude for Desktop and other MCP clients
- Flexible Output Formats: Get content in Markdown, plain text, or HTML
Project Structure
├── README.md # Project documentation
├── requirements.txt # Python dependencies
├── .env # Environment variables
├── .gitignore # Git ignore rules
├── search_rag.py # Main MCP server implementation
├── app.py # Flask API implementation (non-MCP version)
├── test_api.py # General API test script
├── test_x_account.py # X/Twitter account retrieval tests
├── test_x_content.py # X/Twitter content extraction tests
├── search_by_username.py # Script to find info from X/Twitter usernames
└── apify_rag/ # Apify client module
├── __init__.py # Package initialization
└── client.py # Apify client implementation
Setup
- Clone this repository:
git clone https://github.com/yourusername/search-rag.git
cd search-rag
- Create a virtual environment and install dependencies:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
- Create a
.envfile with your Apify API token:
APIFY_API_TOKEN=your_apify_api_token
- Run the MCP server:
python search_rag.py
Using with Claude for Desktop
-
Install Claude for Desktop
-
Configure Claude for Desktop to use your Search RAG MCP server by editing the configuration file at:
- MacOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
- MacOS:
-
Add your server configuration:
{
"mcpServers": {
"search-rag": {
"command": "python",
"args": [
"/ABSOLUTE/PATH/TO/search-rag.py"
]
}
}
}
- Restart Claude for Desktop. The Search RAG tools should appear in the tools menu (hammer icon).
MCP Tools
Person Search
Search for information about a person and their social media profiles.
Parameters:
name(string): Person name to search forcontext(string, optional): Additional context or questions about the personmax_results(integer, optional): Maximum number of search results (default: 3)focus_x_account(boolean, optional): Focus on finding the person's X/Twitter account (default: false)
Raw Search
Perform a direct web search with full control over parameters.
Parameters:
query(string): Search query or URLmax_results(integer, optional): Maximum number of search results (default: 3)scraping_tool(string, optional): Tool to use for scraping, either 'browser-playwright' or 'raw-http' (default: 'browser-playwright')output_format(string, optional): Format for the extracted content - 'markdown', 'text', or 'html' (default: 'markdown')
Traditional API Endpoints (Non-MCP)
If you prefer to use the traditional REST API rather than MCP, you can run the server with:
python app.py
The API will be available at http://localhost:8080.
Health Check
GET /health
Returns a simple status message to confirm the API is running.
Response:
{
"status": "ok",
"message": "API is running"
}
Person Search
POST /search
Search for information about a person.
Request Body:
{
"name": "Person Name",
"context": "Additional context or questions (optional)",
"max_results": 3,
"focus_x_account": false
}
Raw Search
POST /raw-search
Perform a raw search with full control over parameters.
Request Body:
{
"query": "Search query or URL",
"max_results": 3,
"scraping_tool": "browser-playwright",
"output_format": "markdown"
}
Utility Scripts
API Testing
python test_api.py
X/Twitter Account Discovery
python test_x_account.py "Person Name"
X/Twitter Content Extraction
python test_x_content.py "Person Name"
Search by X/Twitter Username
python search_by_username.py username
Environment Variables
| Variable | Description | Required |
|---|---|---|
| APIFY_API_TOKEN | Your Apify API token | Yes |
Troubleshooting
Claude for Desktop Integration Issues
- Ensure you've configured the
claude_desktop_config.jsonfile correctly - Make sure the path to your
search_rag.pyfile is correct and absolute - Check that Claude for Desktop is restarted after configuration
- Look for the hammer icon in Claude for Desktop to access the tools
API Issues
- Verify your Apify API token is correct
- Ensure you have an active internet connection
- Check that the request parameters are valid
Next Steps
- Try more complex search queries
- Integrate with other MCP clients
- Customize the search behavior for specific use cases
License
MIT
Quick Start
Clone the repository
git clone https://github.com/jonathan-politzki/search-ragInstall dependencies
cd search-rag
npm installFollow the documentation
Check the repository's README.md file for specific installation and usage instructions.
Repository Details
Recommended MCP Servers
Discord MCP
Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.
Knit MCP
Connect AI agents to 200+ SaaS applications and automate workflows.
Apify MCP Server
Deploy and interact with Apify actors for web scraping and data extraction.
BrowserStack MCP
BrowserStack MCP Server for automated testing across multiple browsers.
Zapier MCP
A Zapier server that provides automation capabilities for various apps.