home / mcp / fetch jsonpath mcp
A Model Context Protocol (MCP) server that provides tools for fetching and extracting JSON data from URLs using JSONPath patterns.
Configuration
View docs{
"mcpServers": {
"ackness-fetch-jsonpath-mcp": {
"command": "uvx",
"args": [
"fetch-jsonpath-mcp"
],
"env": {
"JSONRPC_MCP_PROXY": "http://proxy.example.com:8080",
"JSONRPC_MCP_VERIFY": "false",
"JSONRPC_MCP_HEADERS": "{\"Authorization\": \"Bearer token\"}",
"JSONRPC_MCP_TIMEOUT": "30",
"JSONRPC_MCP_FOLLOW_REDIRECTS": "true"
}
}
}
}You set up and run a Model Context Protocol (MCP) server that helps you fetch JSON data and web content efficiently. It lets you extract just the data you need with JSONPath patterns, reducing token usage, improving accuracy, and making web scraping more reliable through browser-like headers.
Install and run the MCP server, then use its tools to fetch and process data from URLs. You can extract specific JSON data with JSONPath patterns, fetch text content from web pages with intelligent extraction, and run batch requests to handle multiple URLs at once. The server automatically uses realistic browser headers to avoid blocks and to improve access to targets.
Prerequisites: ensure you have the MCP runtime tooling available in your environment. The server is designed to be driven by an MCP client and supports local execution via a command-line tool.
# 1) Synchronize dependencies
uv sync
# 2) (Optional) Start a demo server to test against
# Install demo server dependencies
uv add fastapi uvicorn
# Start demo server on port 8080
uv run demo-server
# 3) Run the MCP server locally
uv run fetch-jsonpath-mcpIf you prefer to connect this MCP server via a config, you can place the following snippet in your MCP client configuration to run the server locally with the UVX runtime.
{
"mcpServers": {
"fetch-jsonpath-mcp": {
"command": "uvx",
"args": ["fetch-jsonpath-mcp"]
}
}
}You can customize how the MCP server fetches content by tweaking environment variables. The following variables are supported:
export JSONRPC_MCP_TIMEOUT=30
export JSONRPC_MCP_VERIFY=false
export JSONRPC_MCP_FOLLOW_REDIRECTS=true
export JSONRPC_MCP_HEADERS='{"Authorization": "Bearer token"}'
export JSONRPC_MCP_PROXY="http://proxy.example.com:8080"Defaults are applied when a variable is not provided. The server uses realistic browser headers by default to avoid access blocks and to improve content extraction. Custom headers replace defaults when there are conflicts.
You can perform data extraction and content retrieval with these tools. Each tool is designed to work with JSON data or web pages and supports common HTTP methods.
If you encounter access blocks, verify that the browser-like headers are being sent and that redirects are followed if needed. Ensure your environment variables are set correctly and that the server process is running with the expected runtime (UVX) and command arguments.
# Example: fetch JSON with a pattern
# This will extract data matching the JSONPath pattern data[*].name
# from a target URL
{
"name": "fetch-json",
"arguments": {
"url": "http://localhost:8080",
"pattern": "data[*].name",
"method": "GET"
}
}A local demo server can provide sample JSON data to test extraction and processing.
If you perform installation, build, and run steps, ensure you reach the final start command to keep the server running. The example start command shown above runs the MCP server locally via UVX.
Extract JSON data using JSONPath patterns with support for all HTTP methods.
Fetch web content with intelligent text extraction and default Markdown formatting.
Process multiple URLs with different JSONPath patterns concurrently.
Fetch content from multiple URLs with intelligent text extraction.