Skip to main content
Glama
WebSearch MCP Server

WebSearch MCP Server

by Nafi-Jza

WebSearch MCP Server

A powerful Model Context Protocol (MCP) server that provides full-featured web searching, scraping, and YouTube transcript extraction capabilities using Playwright.

This server allows AI assistants (like Claude via Claude Code) to autonomously search the web, read articles, and fetch video transcripts without being blocked by CAPTCHAs or regional firewalls.

Features

  • πŸ” DuckDuckGo Search: Headed search using Playwright to bypass aggressive bot-protection and regional blocks (e.g., Internet Positif).

  • πŸ•ΈοΈ Headless Scraping: Extracts clean Markdown from websites using Mozilla's Readability and Turndown.

  • πŸŽ₯ YouTube Transcripts: Fetches auto-generated or manual transcripts with a fallback to Playwright extraction if the API fails.

  • πŸ”“ Manual Browser Interaction: Allows the AI to open a headed browser window, pausing execution so you can manually solve CAPTCHAs or log into accounts.

  • πŸͺ Persistent Profiles: Maintains a browser-profile to save your cookies, logins, and session state across runs.

Related MCP server: Web Research MCP Server

Prerequisites

Installation

  1. Clone the repository:

    git clone https://github.com/nafi-jza/websearch-mcp.git
    cd websearch-mcp
  2. Install dependencies:

    npm install
  3. Install Playwright browsers:

    npx playwright install chromium
  4. Build the project:

    npm run build

Configuration in Claude Code

To add this MCP server to your Claude Code setup, edit your ~/.claude.json or project-level .claude.json file:

{
  "mcpServers": {
    "websearch-mcp": {
      "type": "stdio",
      "command": "node",
      "args": [
        "C:/absolute/path/to/websearch-mcp/dist/index.js"
      ],
      "env": {}
    }
  }
}

(Make sure to replace the path with your actual absolute path to the dist/index.js file)

Available Tools

Once configured, the following tools will be available to the AI:

  • search: Search the web using DuckDuckGo.

    • Input: { query: string }

  • scrape: Load a webpage headlessly and extract its main content as Markdown. If blocked by Cloudflare or bot verification, returns [BOT_CHALLENGE_DETECTED] with remediation instructions to call scrape_headed.

    • Input: { url: string }

  • scrape_headed: Visible headed browser fallback. Opens a Chromium window with the user's real profile so the user can pass bot verification (Cloudflare, Turnstile, CAPTCHA). Once solved, clicking βœ… Finish & Scrape (or closing the window) immediately extracts clean Markdown.

    • Input: { url: string }

  • open_browser: Open a headed browser window to manually solve CAPTCHAs or log into sites. Pauses the MCP server until you close the browser.

    • Input: { url?: string }

  • youtube_transcript: Extract the transcript from a YouTube video.

    • Input: { target: string, lang?: string }

When an agent needs to read a URL:

  1. Call scrape first (fast, headless).

  2. If scrape succeeds, use the markdown output immediately.

  3. If scrape fails with [BOT_CHALLENGE_DETECTED], immediately call scrape_headed with the exact same URL. Do not abandon the URL or run extra searches.

  4. The user completes verification on screen and clicks Finish & Scrape to return the content.

Architecture & How It Works

  • Bot Bypass: Playwright is used to execute searches visibly (headed) which tricks most basic bot-protection systems and DNS blocks.

  • Graceful Cleanup: The server automatically manages Chromium contexts. It safely removes the default about:blank pages and closes browser instances strictly after automated executions to prevent memory leaks and zombie processes.

  • Logging & Output: All activity is logged to activity.log in the root directory. Markdown outputs of scrapes are saved locally to the outputs/ directory for historical reference.

Available Tools

4 tools
open_browserA

Open a headed browser window to manually solve CAPTCHAs or log into sites. Pauses the MCP server until the user closes the browser.

Inputs: url.

scrapeA

Load a webpage and extract its main content as Markdown.

Inputs: url (required).

youtube_transcriptC

Extract the transcript from a YouTube video.

Inputs: target (required), lang.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 4 tools

    Disambiguation5/5

    Each tool serves a clearly distinct purpose: open_browser for manual interaction, scrape for content extraction, search for web search, and youtube_transcript for YouTube transcripts. No overlap.

    Naming Consistency3/5

    Naming is inconsistent: scrape and search are single verbs, open_browser follows verb_noun, while youtube_transcript uses noun_noun. This lack of a uniform pattern could confuse an agent.

    Tool Count5/5

    With 4 tools, the server is well-scoped. Each tool provides essential functionality for web research without unnecessary bloat.

    Completeness4/5

    The tool set covers core web search, scraping, and transcript extraction, but lacks features like image search or search history. Still, it handles common workflows effectively.

    Maintenance

    ActivityMaintained
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      F
      maintenance
      Enables web search across Bing, DuckDuckGo, and Google using Playwright automation, with tools for retrieving search results and extracting page text content.
      11 npm
      MIT
    • A
      license
      C
      quality
      C
      maintenance
      Enables AI agents to perform web searches via DuckDuckGo without API keys and automate browser tasks with headless Chromium. Supports multi-step research workflows that automatically search and extract content from multiple pages.
      7
      81 PyPI
      MIT