mcp server requests
Web Content Retrieval (full webpage, filtered content, or Markdown-converted), Custom User-Agent, Multi-HTTP Method Support (GET/POST/PUT/DELETE/PATCH), LLM-Controlled Request Headers, LLM-Accessible Response Headers, and more.
Web Content Retrieval (full webpage, filtered content, or Markdown-converted), Custom User-Agent, Multi-HTTP Method Support (GET/POST/PUT/DELETE/PATCH), LLM-Controlled Request Headers, LLM-Accessible Response Headers, and more.
An MCP server that provides HTTP request capabilities, enabling LLMs to fetch and process web content.
git clone https://github.com/coucya/mcp-server-requests.git
cd mcp-server-requests
pip install .
{
"mcpServers": {
"mcp-server-requests": {
"command": "python",
"args": [
"-m",
"mcp_server_requests"
]
}
}
}
Start the MCP server directly:
python -m mcp_server_requests
--user-agent TEXT
: Specify custom User-Agent string--random-user-agent [browser=xxx;os=xxx]
: Use randomly generated User-Agent--force-user-agent
: Force using command line specified User-Agent, ignoring LLM provided UA--list-os-and-browser
: List available browsers and OS for random User-Agent generation--user-agent
and --random-user-agent
are mutually exclusive and cannot be used together--user-agent "Mozilla/5.0 (...)"
--random-user-agent
Conditional random generation:
--random-user-agent browser=chrome
--random-user-agent os=windows
--random-user-agent browser=chrome;os=windows
Use --list-os-and-browser
to view available browsers and OS for --random-user-agent
.
--force-user-agent
controls User-Agent priority:
--user-agent
or --random-user-agent
), ignoring LLM provided UAThe fetch subcommand is equivalent to the fetch tool functionality, demonstrating fetch capabilities.
python -m mcp_server_requests fetch <URL> [--return-content {raw,basic_clean,strict_clean,markdown}]
Options:
- --return-content
: Return content type (default: markdown)
- raw: Return raw unprocessed HTML content
- basic_clean: Basic cleanup, removing non-display tags like script, style
- strict_clean: Strict cleanup, removing non-display tags and most HTML attributes
- markdown: Convert HTML to clean Markdown format
Example:
python -m mcp_server_requests fetch https://example.com
The get subcommand is equivalent to the http_get tool functionality, demonstrating http_get capabilities.
python -m mcp_server_requests get <URL> [--headers HEADERS]
Options:
- --headers
: Custom request headers (format: "key1=value1;key2=value2")
The post subcommand is equivalent to the http_post tool functionality, demonstrating http_post capabilities.
python -m mcp_server_requests post <URL> [--headers HEADERS] [--data TEXT]
Options:
- --headers
: Custom request headers
- --data
: Request body data
The put subcommand is equivalent to the http_put tool functionality, demonstrating http_put capabilities.
python -m mcp_server_requests put <URL> [--headers HEADERS] [--data TEXT]
Options: Same as POST method
The delete subcommand is equivalent to the http_delete tool functionality, demonstrating http_delete capabilities.
python -m mcp_server_requests delete <URL> [--headers HEADERS] [--data TEXT]
Options: Same as POST method
Parameters:
http_get - Execute HTTP GET request
Parameters:
--force-user-agent
(same applies to other tools)http_post - Execute HTTP POST request
Parameters:
http_put - Execute HTTP PUT request
Parameters: Same as http_post
http_patch - Execute HTTP PATCH request
Parameters: Same as http_post
http_delete - Execute HTTP DELETE request
MIT