Provides web search functionality using Brave Search API, allowing AI agents to search the web and automatically fetch content from top search results
URL Text Fetcher MCP Server
A Model Context Protocol (MCP) server that provides URL text fetching, web scraping, and web search capabilities for use with LM Studio and other MCP-compatible clients.
Features
This MCP server enables AI models to:
- Fetch text content from any URL by extracting all visible text
- Extract links from web pages to discover related resources
- Search the web using Brave Search and automatically fetch content from top results
- Handle errors gracefully with proper timeout and exception handling
Tools
The server provides three main tools:
fetch_url_text
- Description: Downloads all visible text from a URL
- Parameters:
url
(string, required): The URL to fetch text from
- Returns: Clean text content from the webpage
fetch_page_links
- Description: Extracts all links from a web page
- Parameters:
url
(string, required): The URL to fetch links from
- Returns: List of all href links found on the page
brave_search_and_fetch
- Description: Search the web using Brave Search and automatically fetch content from the top results
- Parameters:
query
(string, required): The search querymax_results
(integer, optional): Maximum number of results to fetch content for (default: 3, max: 10)
- Returns: Search results with full text content from each result URL
Prerequisites
Brave Search API Key
To use the search functionality, you'll need a free Brave Search API key:
- Visit Brave Search API
- Sign up for a free account (2,000 queries/month, max 1 per second)
- Get your API key
- Copy
.env.example
to.env
and add your API key:
Installation
- Clone this repository
- Install dependencies:
- Configure your environment:
Usage
With LM Studio
- Open LM Studio and navigate to the Integrations section
- Click "Install" then "Edit mcp.json"
- Option A: Use the configuration helper scriptThis will generate the correct configuration with the right paths for your system.
- Option B: Manual configuration - Add the server configuration:
Note: The API key will be automatically loaded from your .env
file in the project directory.
- Save the configuration and restart LM Studio
- The server will appear in the Integrations section
Standalone Usage
You can also run the server directly:
Examples
Once configured with LM Studio, you can ask the AI to:
- "Fetch the text content from https://example.com"
- "Get all the links from https://news.example.com"
- "Search for 'Python web scraping' and show me the content from the top 3 results"
- "What's the latest news about AI? Search and get the full articles"
- "Find information about MCP servers and fetch the detailed content"
Dependencies
mcp>=1.12.3
- Model Context Protocol frameworkrequests>=2.31.0
- HTTP library for web requests and Brave Search APIbeautifulsoup4>=4.12.0
- HTML parsing and text extraction
Configuration
The server can be configured via the .env
file:
Brave Search Subscription Tiers
The server automatically adjusts its rate limiting based on your Brave Search subscription:
- Free Tier: 1 request per second (
BRAVE_RATE_LIMIT_RPS=1
) - Paid Tier: 20 requests per second (
BRAVE_RATE_LIMIT_RPS=20
) - Higher Tier: 50 requests per second (
BRAVE_RATE_LIMIT_RPS=50
)
The server will enforce the configured rate limit across all concurrent requests to ensure you stay within your API quota.
See .env.example
for a template.
Development
This project uses:
- Python 3.13+
- uv for dependency management
- MCP SDK for protocol implementation
To set up for development:
- Clone the repository
- Run
uv sync --dev --all-extras
- Make your changes
- Test with MCP-compatible clients
Troubleshooting
LM Studio Configuration Issues
If you see errors like "Failed to spawn: url-text-fetcher
" in LM Studio logs:
- Run the configuration helper:
- Make sure you're using full paths:
- Use the full path to
uv
(e.g.,/Users/username/.local/bin/uv
) - Include the
cwd
(current working directory) in your configuration - Set the
BRAVE_API_KEY
environment variable
- Use the full path to
- Test the server manually:The server should start and wait for input (press Ctrl+C to exit).
- Check your API key:Or test manually:
Common Issues
- "BRAVE_API_KEY environment variable is required": Make sure your
.env
file containsBRAVE_API_KEY=your_actual_api_key
- "Network error": Check your internet connection and API key validity
- "Content truncated": Normal behavior for very long web pages (content is limited to 5000 characters by default)
Error Handling
The server includes robust error handling for:
- Network timeouts (10-second default)
- Invalid URLs
- HTTP errors (4xx, 5xx responses)
- Parsing failures
- Missing API keys
- General exceptions
All errors are returned as descriptive text messages to help users understand what went wrong.
Development
This project uses:
- Python 3.13+
- uv for dependency management
- MCP SDK for protocol implementation
To set up for development:
- Clone the repository
- Run
uv sync --dev --all-extras
- Make your changes
- Test with MCP-compatible clients
Debugging
Since MCP servers run over stdio, debugging can be challenging. For the best debugging experience, we strongly recommend using the MCP Inspector.
You can launch the MCP Inspector via npm
with this command:
Upon launching, the Inspector will display a URL that you can access in your browser to begin debugging.
License
MIT License - see LICENSE file for details
This server cannot be installed
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 AI models to fetch text content from URLs, extract links from web pages, and search the web using Brave Search with automatic content retrieval from top results. Provides comprehensive web scraping and search capabilities with robust error handling.
Related MCP Servers
- -securityFlicense-qualityEnables intelligent web scraping through a browser automation tool that can search Google, navigate to webpages, and extract content from various websites including GitHub, Stack Overflow, and documentation sites.Last updated -1Python
- TypeScriptGPL 3.0
- -securityAlicense-qualityEnables AI models to search the web for current information before generating responses, with features for conditional searching, geographic customization, and automatic citations.Last updated -JavaScriptMIT License
- AsecurityAlicenseAqualityA powerful tool for fetching and extracting text content from web pages and APIs, supporting web scraping, REST API requests, and Google Custom Search integration.Last updated -42JavaScriptMIT License