The 4get MCP Server provides seamless access to the 4get meta search engine API, enabling comprehensive search across multiple content types with production-ready features.
Core Search Functions:
Web Search: Full web search with extended mode, featured answers, and spelling corrections
Image Search: Image discovery with filters, thumbnails, and metadata
News Search: Recent news articles with publication dates and thumbnails
Pagination Support: Navigate results using next page tokens across all search types
Advanced Features:
Engine Selection: Choose from 20+ search engines including DuckDuckGo, Google, Brave, Yandex, and Baidu
Smart Caching: TTL-based response caching with configurable size limits for improved performance
Retry Logic: Automatic retry with exponential backoff for rate limiting and network errors
Rich Results: Comprehensive formatting with related searches, spelling corrections, and featured answers
Customizable Parameters: Fine-tune searches with language, region, filters, and date ranges via
extra_params
Production Ready:
High Configurability: 11+ environment variables for performance tuning
Robust Architecture: Connection pooling, comprehensive error handling, and validation
LLM Integration: Seamless integration with AI assistants and IDEs like Cursor and OpenAI Codex
Direct API Access: Bundled asynchronous Python client for programmatic use beyond MCP protocol
Provides access to the 4get Meta Search engine API, enabling web search, image search, and news search capabilities with features like pagination, featured answers, related searches, and comprehensive result formatting
4get MCP Server
A MCP server that provides seamless access to the 4get Meta Search engine API for LLM clients via FastMCP.
โจ Features
๐ Multi Search Functions: Web, image, and news search with comprehensive result formatting
โก Smart Caching: TTL-based response caching with configurable size limits
๐ Retry Logic: Exponential backoff for rate-limited and network errors
๐๏ธ Production Ready: Connection pooling, comprehensive error handling, and validation
๐ Rich Responses: Featured answers, related searches, pagination support, and more
๐งช Well Tested: Extensive test suite including integration tests with real API, unit tests, and more
โ๏ธ Highly Configurable: 11+ environment variables for fine-tuning
๐ฏ Engine Shorthands: Pick a 4get scraper via the
engine
parameter without memorizing query strings
๐ Requirements
Python 3.13+
uv for dependency management
Quick Start
โ๏ธ Configuration
The server is highly configurable via environment variables. All settings have sensible defaults for the public https://4get.ca
instance.
Core Settings
Variable | Description | Default |
| Base URL for the 4get instance |
|
| Optional pass token for rate-limited instances | unset |
| Override User-Agent header |
|
| Request timeout in seconds |
|
Caching & Performance
Variable | Description | Default |
| Cache lifetime in seconds |
|
| Maximum cached responses |
|
| Max concurrent connections |
|
| Max persistent connections |
|
Retry & Resilience
Variable | Description | Default |
| Maximum retry attempts |
|
| Base retry delay in seconds |
|
| Maximum retry delay in seconds |
|
๐ Running the Server
Local Development
Production Deployment
MCP Server Integration
You can integrate the 4get MCP server with popular IDEs and AI assistants. Here are configuration examples:
Cursor IDE
Add this to your Cursor MCP configuration (~/.cursor/mcp.json
):
OpenAI Codex
Add this to your Codex MCP configuration (~/.codex/config.toml
):
Note: Replace /path/to/your/mcp-4get
with the actual path to your project directory.
๐ง MCP Tools
The server exposes three powerful search tools with comprehensive response formatting:
fourget_web_search
Response includes: web[]
, answer[]
, spelling
, related[]
, npt
fourget_image_search
Response includes: image[]
, npt
fourget_news_search
Response includes: news[]
, npt
Engine shorthands
All MCP tools accept an optional engine
argument that maps directly to the 4get scraper
query parameter. This shorthand overrides any scraper
value you may include in extra_params
.
Value | Engine |
| DuckDuckGo |
| Brave |
| Mullvad (Brave) |
| Yandex |
| |
| Google CSE |
| Mullvad (Google) |
| Startpage |
| Qwant |
| Ghostery |
| Yep |
| Greppr |
| Crowdview |
| Mwmbl |
| Mojeek |
| Baidu |
| Coc Coc |
| Solofield |
| Marginalia |
| wiby |
| Curlie |
If you need to pass additional 4get query parameters (such as country
or language
), continue to supply them through extra_params
.
๐ Pagination
All tools support pagination via the npt
(next page token):
๐ Using the Async Client Directly
You can reuse the bundled async client outside MCP for direct API access:
This allows you to integrate 4get search capabilities directly into your Python applications without going through the MCP protocol.
๐ก๏ธ Error Handling & Resilience
Automatic Retry Logic
Rate Limiting (429): Exponential backoff with jitter
Network Errors: Connection failures and timeouts
Non-retryable: HTTP 404/500 errors fail immediately
Error Types
FourGetAuthError
: Rate limited or invalid authenticationFourGetAPIError
: API returned non-success statusFourGetTransportError
: Network or HTTP protocol errorsFourGetError
: Generic client errors
Configuration Validation
All settings are validated on startup with clear error messages for misconfigurations.
๐ Response Format
Based on the real 4get API, responses include rich metadata:
Development
This project uses several tools to streamline the development process:
mise
mise is used for managing project-level dependencies and environment variables. mise helps ensure consistent development environments across different machines.
To get started with mise:
Install mise by following the instructions on the official website.
Run
mise install
in the project root to set up the development environment.
Environment Variable Overrides: You can override any environment variable by creating a .mise.local.toml
file in the project root:
This file is automatically loaded by mise and allows you to customize your local development environment without modifying the shared configuration files.
UV
UV is used for dependency management and packaging. It provides a clean, version-controlled way to manage project dependencies.
To set up the project with UV:
Install UV using mise, or by following the instructions on the official website.
Run
uv sync
to install project dependencies.
MCP Server Integration for local development
Cursor IDE
Add this to your Cursor MCP configuration (~/.cursor/mcp.json
):
OpenAI Codex
Add this to your Codex MCP configuration (~/.codex/config.toml
):
Note: Replace /path/to/your/mcp-4get
with the actual path to your project directory.
๐งช Testing
Comprehensive test suite with unit, integration, and performance tests:
Test Categories
Unit Tests: Fast, deterministic tests using mock transports
Integration Tests: Real API tests with rate limiting and resilience validation
Cache Tests: TTL expiration, eviction policies, concurrent access
Retry Tests: Exponential backoff, error handling, timeout scenarios
Configuration Tests: Validation logic and environment variable parsing
The tests follow FastMCP testing guidelines with comprehensive fixtures and proper isolation.
๐ค Contributing
Setup: See Development and Quick Start sections
Tests: See Testing section
Linting:
uv run ruff check
Format:
uv run ruff format
๐ License
GPLv3 License - see LICENSE file for details.
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Enables web, image, and news search through the 4get Meta Search engine API. Features smart caching, retry logic, and comprehensive result formatting including featured answers and related searches.