Web URL Reader MCP Server
Enables fetching and reading content from web URLs through a configurable proxy prefix. Uses curl to retrieve webpage content and return it as text for analysis or processing.
README
MCP Web URL Reader
An MCP server that exposes a single tool, read_web_url, which fetches absolute URLs with curl -sL after prepending a configurable CUSTOM_PREFIX on the server side. This server uses the MCP TypeScript/JavaScript SDK and serves a Streamable HTTP endpoint at /mcp for compatibility across many AI applications. Perfect for routing AI web requests through proxies, caching layers, or custom gateways.
Features
- 🌐 Simple web URL reading via curl
- 🔧 Configurable URL prefix for proxying/routing
- 🐳 Tiny Docker image based on Node.js
- 🚀 Easy deployment with Docker Compose
- 🛠️ Compatible with any MCP-enabled AI application
How It Works
The AI thinks it's reading a normal URL:
curl -sL https://www.example.com
But the server actually executes:
curl -sL CUSTOM_PREFIX/https://www.example.com
This allows you to:
- Route requests through a caching proxy
- Add authentication layers
- Use custom gateways
- Bypass rate limits with your own infrastructure
- Monitor/log AI web access
Quick Start
Using Docker Compose
See docker-compose.yml for a working example service mapping 8080:8080 and injecting both environment variables.
The MCP server will be available at http://localhost:8080
Environment Variables
| Variable | Description | Default |
|---|---|---|
CUSTOM_PREFIX |
URL prefix to prepend to all requests | "" (empty) |
INTERNAL_PORT |
Internal server port | 80800 |
Configuration Examples
Direct Mode (No Prefix)
environment:
- CUSTOM_PREFIX=
- PORT=3000
Proxy Mode
environment:
- CUSTOM_PREFIX=https://proxy.myserver.com
- INTERNAL_PORT=8080
Cache Gateway
environment:
- CUSTOM_PREFIX=http://cache-server:8000/fetch
- INTERNAL_PORT=8080
Using with AI Applications, MCP Client Integration
The server exposes tools over Streamable HTTP: initialize a session with a POST to /mcp, reuse Mcp-Session-Id from the response, then call tools/call with { name: "read_web_url", arguments: { url: "https://example.com" } }. The server will run curl -sL CUSTOM_PREFIX/https://example.com and return text content. Ensure the Mcp-Session-Id header is included in subsequent requests and allowed via CORS.
Claude Desktop (MCP)
Add to your claude_desktop_config.json:
{
"mcpServers": {
"web-url-reader": {
"url": "http://localhost:8080/mcp"
}
}
}
n8n
Use the MCP Server node and point it to http://localhost:8080/mcp
Custom Applications
Connect to the MCP endpoint at http://localhost:8080/mcp
Tool Schema
The server exposes one tool:
read_web_url
- Description: Read and return the contents of a web page
- Parameter:
url(string, required) - The complete URL to fetch - Returns: Text content of the web page
Example tool call:
{
"name": "read_web_url",
"arguments": {
"url": "https://www.example.com"
}
}
Use Cases
Caching Layer
Route all AI web requests through your caching server to reduce external calls:
CUSTOM_PREFIX=http://cache-server/proxy
Authentication Gateway
Add authentication to web requests:
CUSTOM_PREFIX=http://auth-gateway/fetch
Rate Limit Management
Route through your own infrastructure to manage rate limits:
CUSTOM_PREFIX=https://ratelimit-proxy.myserver.com
Privacy/Monitoring
Log and monitor all AI web access:
CUSTOM_PREFIX=http://monitoring-gateway/fetch
Run
- Open
http://localhost:8080/for a basic health probe and connect your MCP client tohttp://localhost:8080/mcp. - The MCP endpoint is on
http://localhost:8080/mcpwith Streamable HTTP semantics for POST/GET/DELETE and CORS exposure forMcp-Session-Id.
Troubleshooting
Server won't start
- Check that port 8080 is not in use
- Verify environment variables are set correctly
- Check Docker logs:
docker-compose logs -f
Requests failing
- Verify CUSTOM_PREFIX is accessible from container
- Test curl manually:
docker exec -it mcp-web-reader curl -sL YOUR_URL - Check timeout settings (default 30s)
GitHub Actions not building
- Ensure workflow permissions are enabled
- Check that GITHUB_TOKEN has package write access
- Verify Dockerfile syntax
License
MIT License - Feel free to use and modify as needed.
Contributing
Pull requests welcome! Please ensure:
- Docker image builds successfully
- README is updated for new features
- GitHub Actions workflow passes
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。