4get MCP Server

4get MCP Server

4get•byyshalsager

An MCP server that provides access to the 4get Meta Search engine API for LLM clients via FastMCP.

License: GPLv3•Runtime: Awaiting documentation review•Category: search web

WHAT IT DOES

  • •Exposes web, image, and news search tools backed by the 4get API with formatted results.
  • •Supports pagination across search tools via the npt next page token.
  • •Lets tools select a specific 4get scraper engine via an optional engine parameter.
  • •Includes TTL-based response caching packed with retry logic and connection pooling.

BEST FOR

  • •LLM clients in IDEs such as Cursor or OpenAI Codex needing web search capability.
  • •Applications needing direct asynchronous access to 4get search without the MCP protocol.

ABOUT 4GET

4get MCP Server is cataloged as an MCP server attributed to yshalsager. An MCP server that provides access to the 4get Meta Search engine API for LLM clients via FastMCP. It is categorized under search web. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: GPLv3. Check the source repository's current license and terms before using, modifying or distributing this software.

能力检查器

能力定义尚未审核。未核验的采集内容不会作为可信接口展示。

Tools (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Resources (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Prompts (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for 4get MCP Server are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

FREQUENTLY ASKED QUESTIONS

Which search tools does the server expose?

It exposes three tools: fourget_web_search, fourget_image_search, and fourget_news_search.

Can the server be pointed at a custom 4get instance?

Yes, the base URL is configurable via the FOURGET_BASE_URL environment variable, defaulting to the public 4get.ca instance.

上游原版 README

在 GitHub 查看同一版本原文

README.md · c48140bb5e63 · 采集于 2026-11-13 08:24:42 UTC

保留上游原文,不做 AI 改写。为安全起见过滤脚本、表单和不安全链接。

当前显示最后一次成功采集的文档快照,请以来源页面为准。

4get MCP Server

A MCP server that provides seamless access to the 4get Meta Search engine API for LLM clients via FastMCP.

Codacy Badge Codacy Badge PyPI version PyPI Downloads

GitHub release GitHub Downloads

made-with-python Open Source Love

PayPal LiberaPay

✨ 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

# Install dependencies
uv sync

# Run the server
uv run -m mcp_4get

# Or use mise
mise run

⚙️ Configuration

The server is highly configurable via environment variables. All settings have sensible defaults for the public https://4get.ca instance.

Core Settings

VariableDescriptionDefault
FOURGET_BASE_URLBase URL for the 4get instancehttps://4get.ca
FOURGET_PASSOptional pass token for rate-limited instancesunset
FOURGET_USER_AGENTOverride User-Agent headermcp-4get/<version>
FOURGET_TIMEOUTRequest timeout in seconds20.0

Caching & Performance

VariableDescriptionDefault
FOURGET_CACHE_TTLCache lifetime in seconds600.0
FOURGET_CACHE_MAXSIZEMaximum cached responses128
FOURGET_CONNECTION_POOL_MAXSIZEMax concurrent connections10
FOURGET_CONNECTION_POOL_MAX_KEEPALIVEMax persistent connections5

Retry & Resilience

VariableDescriptionDefault
FOURGET_MAX_RETRIESMaximum retry attempts3
FOURGET_RETRY_BASE_DELAYBase retry delay in seconds1.0
FOURGET_RETRY_MAX_DELAYMaximum retry delay in seconds60.0

🚀 Running the Server

Local Development

uv run -m mcp_4get

Production Deployment

# With custom configuration
export FOURGET_BASE_URL="https://my-4get-instance.com"
export FOURGET_PASS="my-secret-token"
export FOURGET_CACHE_TTL="300"
export FOURGET_MAX_RETRIES="5"

uv run -m mcp_4get

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):

{
  "mcpServers": {
    "4get": {
      "command": "uvx",
      "args": [
        "mcp_4get@latest"
      ],
      "env": {
        "FOURGET_BASE_URL": "https://4get.ca"
      }
    }
  }
}

OpenAI Codex

Add this to your Codex MCP configuration (~/.codex/config.toml):

[mcp_servers.4get]
command = "uvx"
args = ["mcp_4get@latest"]
env = { FOURGET_BASE_URL = "https://4get.ca" }

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(
    query: str,
    page_token: str = None,        # Use 'npt' from previous response
    extended_search: bool = False, # Enable extended search mode
    engine: str = None,             # Pick a scraper from the supported engine list
    extra_params: dict = None      # Language, region, etc.
)

Response includes: web[], answer[], spelling, related[], npt

fourget_image_search(
    query: str,
    page_token: str = None,   # Use 'npt' from previous response
    engine: str = None,       # Pick a scraper from the supported engine list
    extra_params: dict = None # Size, color, type filters
)

Response includes: image[], npt

fourget_news_search(
    query: str,
    page_token: str = None,   # Use 'npt' from previous response
    engine: str = None,       # Pick a scraper from the supported engine list
    extra_params: dict = None # Date range, source filters
)

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.

ValueEngine
ddgDuckDuckGo
braveBrave
mullvad_braveMullvad (Brave)
yandexYandex
googleGoogle
google_cseGoogle CSE
mullvad_googleMullvad (Google)
startpageStartpage
qwantQwant
ghosteryGhostery
yepYep
grepprGreppr
crowdviewCrowdview
mwmblMwmbl
mojeekMojeek
baiduBaidu
coccocCoc Coc
solofieldSolofield
marginaliaMarginalia
wibywiby
curlieCurlie

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):

# Get first page
result = await client.web_search("python programming")

# Get next page if available
if result.get('npt'):
    next_page = await client.web_search("ignored", page_token=result['npt'])

🐍 Using the Async Client Directly

You can reuse the bundled async client outside MCP for direct API access:

import asyncio
from mcp_4get.client import FourGetClient
from mcp_4get.config import Config

async def main() -> None:
    client = FourGetClient(Config.from_env())
    data = await client.web_search(
        "model context protocol",
        options={"scraper": "mullvad_brave"},
    )
    for result in data.get("web", []):
        print(result["title"], "->", result["url"])

asyncio.run(main())

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 authentication
  • FourGetAPIError: API returned non-success status
  • FourGetTransportError: Network or HTTP protocol errors
  • FourGetError: 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:

{
  "status": "ok",
  "web": [
    {
      "title": "Example Result",
      "description": "Result description...",
      "url": "https://example.com",
      "date": 1640995200,
      "type": "web"
    }
  ],
  "answer": [
    {
      "title": "Featured Answer",
      "description": [{"type": "text", "value": "Answer content..."}],
      "url": "https://source.com",
      "table": {"Key": "Value"}
    }
  ],
  "spelling": {
    "type": "no_correction",
    "correction": null
  },
  "related": ["related search", "terms"],
  "npt": "pagination_token_here"
}

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:

  1. Install mise by following the instructions on the official website.
  2. 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:

[env]
FOURGET_BASE_URL = "https://your-custom-4get-instance.com"
FOURGET_CACHE_TTL = "300"
# Add any other environment variables you want to override

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:

  1. Install UV using mise, or by following the instructions on the official website.
  2. 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):

{
  "mcpServers": {
    "4get": {
      "command": "uv",
      "args": [
        "run",
        "--project",
        "/path/to/your/mcp-4get",
        "-m",
        "src"
      ],
      "env": {
        "FOURGET_BASE_URL": "https://4get.ca"
      }
    }
  }
}

OpenAI Codex

Add this to your Codex MCP configuration (~/.codex/config.toml):

[mcp_servers.4get]
command = "uv"
args = ["run", "--project", "/path/to/your/mcp-4get", "-m", "src"]
env = { FOURGET_BASE_URL = "https://4get.ca" }

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:

# Run all tests
uv run pytest

# Run only fast unit tests (exclude integration)
uv run pytest -m "not integration"

# Run integration tests with real 4get API
uv run pytest -m integration

# Run with coverage
uv run pytest --cov=src

# Run specific test categories
uv run pytest tests/test_cache.py      # Cache behavior tests
uv run pytest tests/test_client.py     # Client and retry logic tests
uv run pytest tests/test_integration.py # Real API integration 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

  1. Setup: See Development and Quick Start sections
  2. Tests: See Testing section
  3. Linting: uv run ruff check
  4. Format: uv run ruff format

📄 License

GPLv3 License - see LICENSE file for details.

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for 4get MCP Server from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/4get)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable

Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.

下载与拉取统计

来源、范围和时段分别列出;不相加,不代表安装人数、活跃用户或安全审核。

尚无已审核的包 / 镜像标识,暂不展示下载统计。

Related search web MCP Servers

Alternative and complementary servers in the same category

View all in search web →

An MCP server that merges Google Search Console history with a live first-party crawl of your site to produce a prioritised, evidence-backed technical SEO audit inside Claude, complete with paste-ready fixes.

Repository stats unavailable
Search & Web Research

An MCP server that offers intelligent web search using OpenAI reasoning models, with support for fast iterations and deep research.

94
Search & Web Research