Fetch JSONPath MCP
The Fetch JSONPath MCP server is a Model Context Protocol server that provides efficient web scraping and data extraction tools designed to reduce LLM token usage and hallucination by extracting only necessary information.
Extract Specific JSON Data: Fetch JSON content from URLs and precisely extract data using basic and extended JSONPath patterns, supporting filtering, arithmetic operations, length checks, and text transformations
Fetch Web Content: Retrieve web content in multiple formats including intelligent Markdown (default), clean plain text, or raw HTML
Batch Processing: Concurrently process multiple URLs for both JSON extraction and text fetching, optimizing performance by fetching unique URLs only once
Multi-Method HTTP Support: Execute requests using GET, POST, PUT, DELETE, PATCH, HEAD, and OPTIONS methods with custom request bodies and headers
Smart Browser Headers: Automatically include browser-like headers merged with custom headers to prevent blocking and ensure reliable web access
Configurable Behavior: Customize server operations through environment variables for timeout, SSL verification, redirect following, and HTTP proxy settings
Efficient Token Usage: Extract only required data to minimize token consumption, reduce costs, and improve model accuracy
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Fetch JSONPath MCPfetch the top 5 trending repositories from GitHub API using pattern 'items[*].full_name'"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Fetch JSONPath MCP
A Model Context Protocol (MCP) server that provides tools for fetching JSON data and web content from URLs. Features intelligent content extraction, multiple HTTP methods, and browser-like headers for reliable web scraping.
๐ฏ Why Use This?
Reduce LLM Token Usage & Hallucination - Instead of fetching entire JSON responses and wasting tokens, extract only the data you need.
Traditional Fetch vs JSONPath Extract
โ Traditional fetch (wasteful):
// API returns 2000+ tokens
{
"data": [
{
"id": 1,
"name": "Alice",
"email": "alice@example.com",
"avatar": "https://...",
"profile": {
"bio": "Long bio text...",
"settings": {...},
"preferences": {...},
"metadata": {...}
},
"posts": [...],
"followers": [...],
"created_at": "2023-01-01",
"updated_at": "2024-01-01"
},
// ... 50 more users
],
"pagination": {...},
"meta": {...}
}โ JSONPath extract (efficient):
// Only 10 tokens - exactly what you need!
["Alice", "Bob", "Charlie"]Using pattern: data[*].name saves 99% tokens and eliminates model hallucination from irrelevant data.
Related MCP server: Ashra Structured Data Extractor MCP
Installation
For most IDEs, use the uvx tool to run the server.
{
"mcpServers": {
"fetch-jsonpath-mcp": {
"command": "uvx",
"args": [
"fetch-jsonpath-mcp"
]
}
}
}claude mcp add fetch-jsonpath-mcp -- uvx fetch-jsonpath-mcp{
"mcpServers": {
"fetch-jsonpath-mcp": {
"command": "uvx",
"args": ["fetch-jsonpath-mcp"]
}
}
}Add this to your Windsurf MCP config file. See Windsurf MCP docs for more info.
Windsurf Local Server Connection
{
"mcpServers": {
"fetch-jsonpath-mcp": {
"command": "uvx",
"args": ["fetch-jsonpath-mcp"]
}
}
}"mcp": {
"servers": {
"fetch-jsonpath-mcp": {
"type": "stdio",
"command": "uvx",
"args": ["fetch-jsonpath-mcp"]
}
}
}Development Setup
1. Install Dependencies
uv sync2. Start Demo Server (Optional)
# Install demo server dependencies
uv add fastapi uvicorn
# Start demo server on port 8080
uv run demo-server3. Run MCP Server
uv run fetch-jsonpath-mcpDemo Server Data
The demo server at http://localhost:8080 returns:
{
"foo": [{"baz": 1, "qux": "a"}, {"baz": 2, "qux": "b"}],
"bar": {
"items": [10, 20, 30],
"config": {"enabled": true, "name": "example"}
},
"metadata": {"version": "1.0.0"}
}Available Tools
fetch-json
Extract JSON data using JSONPath patterns with support for all HTTP methods.
{
"name": "fetch-json",
"arguments": {
"url": "http://localhost:8080",
"pattern": "foo[*].baz",
"method": "GET"
}
}Returns: [1, 2]
Parameters:
url(required): Target URLpattern(optional): JSONPath pattern for data extractionmethod(optional): HTTP method (GET, POST, PUT, DELETE, etc.) - Default: "GET"data(optional): Request body for POST/PUT requestsheaders(optional): Additional HTTP headers
fetch-text
Fetch web content with intelligent text extraction. Defaults to Markdown format for better readability.
{
"name": "fetch-text",
"arguments": {
"url": "http://localhost:8080",
"output_format": "clean_text"
}
}Returns: Clean text representation of the JSON data
Output Formats:
"markdown"(default): Converts HTML to clean Markdown format"clean_text": Pure text with HTML tags removed"raw_html": Original HTML content
Parameters:
url(required): Target URLmethod(optional): HTTP method - Default: "GET"data(optional): Request body for POST/PUT requestsheaders(optional): Additional HTTP headersoutput_format(optional): Output format - Default: "markdown"
batch-fetch-json
Process multiple URLs with different JSONPath patterns concurrently.
{
"name": "batch-fetch-json",
"arguments": {
"requests": [
{"url": "http://localhost:8080", "pattern": "foo[*].baz"},
{"url": "http://localhost:8080", "pattern": "bar.items[*]"}
]
}
}Returns: [{"url": "http://localhost:8080", "pattern": "foo[*].baz", "success": true, "content": [1, 2]}, {"url": "http://localhost:8080", "pattern": "bar.items[*]", "success": true, "content": [10, 20, 30]}]
Request Object Parameters:
url(required): Target URLpattern(optional): JSONPath patternmethod(optional): HTTP method - Default: "GET"data(optional): Request bodyheaders(optional): Additional HTTP headers
batch-fetch-text
Fetch content from multiple URLs with intelligent text extraction.
{
"name": "batch-fetch-text",
"arguments": {
"requests": [
"http://localhost:8080",
{"url": "http://localhost:8080", "output_format": "raw_html"}
],
"output_format": "markdown"
}
}Returns: [{"url": "http://localhost:8080", "success": true, "content": "# Demo Server Data\n\n..."}, {"url": "http://localhost:8080", "success": true, "content": "{\"foo\": [{\"baz\": 1, \"qux\": \"a\"}, {\"baz\": 2, \"qux\": \"b\"}]..."}]
Supports:
Simple URL strings
Full request objects with custom methods and headers
Mixed input types in the same batch
JSONPath Examples
This project uses jsonpath-ng for JSONPath implementation.
Pattern | Result | Description |
|
| Get all baz values |
|
| Get all items |
|
| Get version |
For complete JSONPath syntax reference, see the jsonpath-ng documentation.
๐ Performance Benefits
Token Efficiency: Extract only needed data, not entire JSON responses
Faster Processing: Smaller payloads = faster LLM responses
Reduced Hallucination: Less irrelevant data = more accurate outputs
Cost Savings: Fewer tokens = lower API costs
Better Focus: Clean data helps models stay on task
Smart Headers: Default browser headers prevent blocking and improve access
Markdown Conversion: Clean, readable format that preserves structure
Configuration
Set environment variables to customize behavior:
# Request timeout in seconds (default: 10.0)
export JSONRPC_MCP_TIMEOUT=30
# SSL verification (default: true)
export JSONRPC_MCP_VERIFY=false
# Follow redirects (default: true)
export JSONRPC_MCP_FOLLOW_REDIRECTS=true
# Custom headers (will be merged with default browser headers)
export JSONRPC_MCP_HEADERS='{"Authorization": "Bearer token"}'
# HTTP proxy configuration
export JSONRPC_MCP_PROXY="http://proxy.example.com:8080"Default Browser Headers: The server automatically includes realistic browser headers to prevent blocking:
User-Agent: Chrome browser simulation
Accept: Standard browser content types
Accept-Language, Accept-Encoding: Browser defaults
Security headers: Sec-Fetch-* headers for modern browsers
Custom headers in JSONRPC_MCP_HEADERS will override defaults when there are conflicts.
Development
# Run tests
pytest
# Check code quality
ruff check --fix
# Build and test locally
uv buildWhat's New in v1.1.0
โจ Multi-Method HTTP Support: GET, POST, PUT, DELETE, PATCH, HEAD, OPTIONS
๐ Tool Renaming:
get-jsonโfetch-json,get-textโfetch-text๐ Markdown Conversion: Default HTML to Markdown conversion with
markdownify๐ Smart Browser Headers: Automatic browser simulation headers
๐๏ธ Format Control: Three output formats for text content (markdown, clean_text, raw_html)
๐ Enhanced Batch Processing: Support for different methods in batch operations
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Appeared in Searches
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/ackness/fetch-jsonpath-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server