Fetch JSONPath MCP
A fetch/JSONPath MCP server that pulls JSON and web content from URLs and extracts only what you need to cut token usage.
fetch-json: Fetch JSON from a URL and extract data with an extended JSONPath pattern; returns the whole document if no pattern is given.fetch-text: Fetch web/text content with intelligent extraction, defaulting to clean Markdown (alsoclean_textorraw_html).batch-fetch-json: Run many URL + JSONPath requests concurrently, de-duplicating identical fetches.batch-fetch-text: Fetch multiple URLs concurrently, accepting either plain URL strings or full request objects (mixing both).HTTP methods: GET (default), POST, PUT, DELETE, PATCH, HEAD, OPTIONS via the
methodparameter.Request bodies & headers: Send
datafor POST/PUT/PATCH and customheadersper request.Extended JSONPath: Basic paths (
foo[*].baz), extensions (len,keys,str()), filters ([?(@.price > 10)]), arithmetic ($.a + $.b), and text ops (sub(),split()).Smart defaults & config: Browser-like headers to avoid blocking, plus env vars for timeout, SSL verification, redirects, custom headers, and proxies.
Click on "Deploy 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 MCP fetch 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: SchemaFetch MCP Server
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
# Installs the project plus dev tools (pytest, ruff) and demo server deps
uv sync2. Start Demo Server (Optional)
# Start demo server on port 8080
uv run demo/demo_server.py3. 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
uv run pytest
# Check code quality
uv run ruff check --fix
# Build and test locally
uv buildReleasing
Releases are published to PyPI via Trusted Publishing â no API tokens. Bump version in pyproject.toml, then push a matching tag:
git tag v1.2.0 && git push origin v1.2.0.github/workflows/release.yml verifies the tag matches the project version, runs lint and tests, builds the distributions, publishes to PyPI, and creates a GitHub release with the artifacts attached.
What'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
Available Tools
4 toolsbatch-fetch-jsonA
Batch extract JSON content from multiple URLs with different extended JSONPath patterns. Supports all JSONPath extensions and optimizes by fetching each unique request only once. Executes requests concurrently for better performance. Supports different HTTP methods.
Inputs: requests (required).
batch-fetch-textA
Batch fetch raw text content from multiple URLs using various HTTP methods. Executes requests concurrently for better performance.
Inputs: requests (required).
fetch-jsonA
Extract JSON content from a URL using JSONPath with extended features. Supports extensions like len, keys, filtering, arithmetic operations, and more. If 'pattern' is omitted or empty, the entire JSON document is returned. Supports different HTTP methods (default: GET).
Inputs: url (required), data, method, headers, +1 more.
fetch-textC
Fetch text content from a URL using various HTTP methods. Defaults to converting HTML to Markdown format.
Inputs: url (required), data, method, headers, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogâĻ
TDQS
Scored across 4 tools
Each tool has a clearly distinct purpose: fetch-json and fetch-text handle single URL operations with JSONPath and raw text extraction respectively, while batch-fetch-json and batch-fetch-text handle multiple URLs with the same capabilities. There is no overlap or ambiguity between tools.
All tool names follow a consistent verb-object pattern with hyphens (fetch-json, fetch-text, batch-fetch-json, batch-fetch-text). The naming convention is perfectly uniform across all four tools.
Four tools is an ideal number for this server's purpose of fetching and extracting content from URLs. It provides both single and batch operations for JSON and text, covering the domain efficiently without being too sparse or bloated.
The tool set covers the core fetching operations for JSON and text content with both single and batch capabilities, including support for various HTTP methods and JSONPath extensions. A minor gap is the lack of explicit tools for error handling or retry mechanisms, but agents can work around this.
Maintenance
Related MCP Connectors
Fetch any RSS/Atom feed as clean JSON or extract article text from any URL. Built for AI agents.
Turn any public webpage into JSON with AI, save it as a live JSON API, and call it from your agent.
Public web data as clean JSON for AI agents: Google, Amazon, TikTok, Instagram, YouTube, LinkedIn, Google Maps, Reddit, Zillow and hundreds more websites. One API key, pay per call, failed calls are free.
Unblocking and fresh web data for agents: URL to Markdown, YouTube, Maps, Amazon, jobs. Pay per call
Related MCP Servers
- FlicenseAqualityDmaintenanceReduces token consumption by 73-87% by cleaning web and API data before it reaches the LLM context window. Supports fetching URLs, searching the web, optimizing JSON, and more.61-
- FlicenseNot gradedqualityBmaintenanceEnables AI agents to extract structured JSON data from web pages using presets or custom JSON schemas, with confidence scores and source snippets, paid per call via USDC on Base.-
- AlicenseAqualityNot gradedmaintenanceEnables AI agents to extract clean, structured web content (articles, tables, links, visual layouts) optimized for LLM token efficiency, with fast response times and optional JavaScript support.583 npmMIT
- AlicenseNot gradedqualityBmaintenanceLets agents and CLI users inspect the shape of large JSON and JSONL files and extract exactly the values they need using jq-like expressions, returning compact bounded results instead of flooding context.1MIT