andrewlwn77/rapidapi-mcp-server-py
If you are the rightful owner of rapidapi-mcp-server-py and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
The RapidAPI Discovery MCP Server is a Model Context Protocol server designed to provide comprehensive discovery and analysis capabilities for the RapidAPI marketplace using undetected-chromedriver for reliable web scraping.
RapidAPI Discovery MCP Server
A Model Context Protocol (MCP) server that provides comprehensive RapidAPI marketplace discovery and analysis capabilities using undetected-chromedriver for reliable web scraping that bypasses anti-bot detection.
๐ Features
- API Search: Search for APIs by keyword and category across RapidAPI marketplace
- API Assessment: Detailed analysis of specific APIs including ratings, pricing, and endpoints
- API Documentation: Extract comprehensive documentation and endpoint details
- API Comparison: Side-by-side comparison of multiple APIs with key metrics
- Pricing Analysis: Detailed pricing plans and tier limits extraction
- Enhanced Documentation: GraphQL-enhanced endpoint details and comprehensive API docs
- Anti-Detection: Uses undetected-chromedriver to reliably bypass bot detection systems
๐ Quick Start
Prerequisites
- Python 3.8+
- Chrome/Chromium browser
- Git
Installation
Option 1: Install from PyPI (Recommended)
pip install rapidapi-mcp-server
Option 2: Development Installation
# Clone the repository
git clone https://github.com/andrewlwn77/rapidapi-mcp-server.git
cd rapidapi-mcp-server
# Create virtual environment
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install in development mode
pip install -e .
Configuration
Add to your Claude Desktop .mcp.json
:
Option 1: Using PyPI Installation
{
"mcpServers": {
"rapidapi-discovery": {
"command": "rapidapi-mcp-server",
"env": {
"CHROME_EXECUTABLE_PATH": "/opt/google/chrome/google-chrome"
}
}
}
}
Option 2: Using Python Module
{
"mcpServers": {
"rapidapi-discovery": {
"command": "python",
"args": ["-m", "rapidapi_mcp_server.server"],
"env": {
"CHROME_EXECUTABLE_PATH": "/opt/google/chrome/google-chrome"
}
}
}
}
Option 3: Development Installation
{
"mcpServers": {
"rapidapi-discovery": {
"command": "/path/to/venv/bin/python",
"args": ["-m", "rapidapi_mcp_server.server"],
"cwd": "/path/to/rapidapi-mcp-server",
"env": {
"CHROME_EXECUTABLE_PATH": "/opt/google/chrome/google-chrome"
}
}
}
}
๐ ๏ธ Available Tools
1. Search APIs (search_apis
)
Search for APIs in the RapidAPI marketplace by keyword and optional category.
Parameters:
query
(required): Search query for APIs (e.g., 'weather', 'crypto', 'news')maxResults
(optional): Maximum number of results to return (1-50, default: 20)category
(optional): Category filter
Example:
mcp__rapidapi-discovery__search_apis(query="weather", maxResults=10)
2. Assess API (assess_api
)
Get comprehensive assessment of a specific API including ratings, pricing, endpoints, and documentation.
Parameters:
apiUrl
(required): The RapidAPI URL for the specific API
Example:
mcp__rapidapi-discovery__assess_api(apiUrl="https://rapidapi.com/weatherapi/api/weatherapi-com")
3. Get API Documentation (get_api_documentation
)
Extract documentation URLs and endpoint information for a specific API.
Parameters:
apiUrl
(required): The RapidAPI URL for the specific API
4. Compare APIs (compare_apis
)
Compare multiple APIs side by side with key metrics.
Parameters:
apiUrls
(required): Array of RapidAPI URLs to compare (2-5 APIs)
5. Get Pricing Plans (get_pricing_plans
)
Extract detailed pricing plans and tier limits for a specific API.
Parameters:
apiUrl
(required): The RapidAPI URL for the specific API
6. Get Enhanced API Documentation (get_enhanced_api_documentation
)
Extract comprehensive API documentation with GraphQL-enhanced endpoint details.
Parameters:
apiUrl
(required): The RapidAPI URL for the specific API
๐๏ธ Architecture
Core Components
- server.py: Main MCP server implementation with JSON-RPC over stdio
- chrome_client.py: Chrome automation using undetected-chromedriver
- pyproject.toml: Project configuration and dependencies
Key Features
- Undetected Chrome: Uses undetected-chromedriver for reliable bot detection bypass
- Session Management: Efficient Chrome session handling with automatic cleanup
- Error Handling: Comprehensive error handling with detailed error messages
- Async Support: Full async/await support for concurrent operations
- MCP Protocol: Compatible with MCP v1.0.0+ protocol
๐งช Testing
Run the server in development mode:
# Activate virtual environment
source venv/bin/activate
# Run server directly
python -m rapidapi_mcp_server.server
# Test with simple MCP client
python -c "
import asyncio
import json
from rapidapi_mcp_server.server import serve
async def test():
# Server will run on stdio
pass
asyncio.run(test())
"
๐ Sample Output
Search Results
{
"query": "weather",
"resultsCount": 5,
"apis": [
{
"name": "WeatherAPI",
"description": "Real-time weather data and forecasts",
"provider": "WeatherAPI.com",
"url": "https://rapidapi.com/weatherapi/api/weatherapi-com",
"rating": 4.8,
"popularity": "High"
}
]
}
API Assessment
{
"name": "WeatherAPI.com",
"rating": 4.8,
"reviewCount": 15420,
"popularity": "Very High",
"pricing": {
"free": {
"requests": 1000000,
"rateLimit": "1 req/sec"
}
},
"endpoints": [
{
"name": "Current Weather",
"method": "GET",
"description": "Get real-time weather data"
}
]
}
๐ง Environment Variables
CHROME_EXECUTABLE_PATH
: Path to Chrome executable (default: auto-detect)CHROME_HEADLESS
: Run Chrome in headless mode (default: true)CHROME_TIMEOUT
: Chrome operation timeout in seconds (default: 30)
๐จ Troubleshooting
Common Issues
-
Chrome not found
export CHROME_EXECUTABLE_PATH="/path/to/chrome"
-
Session errors
- Ensure Chrome is properly installed
- Check if Chrome process is already running
- Restart the MCP server
-
Import errors
# Ensure virtual environment is activated source venv/bin/activate pip install -e .
๐ Project Structure
rapidapi-mcp-server-py/
โโโ src/
โ โโโ rapidapi_mcp_server/
โ โโโ __init__.py
โ โโโ server.py # Main MCP server
โ โโโ chrome_client.py # Chrome automation
โโโ pyproject.toml # Project configuration
โโโ README.md # This file
โโโ .gitignore # Git ignore rules
๐ค Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Acknowledgments
- undetected-chromedriver: For reliable anti-detection capabilities
- MCP Protocol: For standardized AI tool integration
- Selenium WebDriver: For browser automation foundations
- RapidAPI: For providing the comprehensive API marketplace
๐ Support
- GitHub Issues: Report bugs or request features
- Documentation: This README and inline code documentation
- Examples: See the tool examples above for usage patterns
Note: This server requires a valid internet connection and Chrome browser installation. The server uses web scraping techniques that comply with RapidAPI's terms of service for automated access.