Skip to main content
Glama
ackness

Fetch JSONPath MCP

by ackness

Fetch JSONPath MCP

PyPI Downloads įŽ€äŊ“中文

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: webclaw

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 sync

2. Start Demo Server (Optional)

# Install demo server dependencies
uv add fastapi uvicorn

# Start demo server on port 8080
uv run demo-server

3. Run MCP Server

uv run fetch-jsonpath-mcp

Demo 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 URL

  • pattern (optional): JSONPath pattern for data extraction

  • method (optional): HTTP method (GET, POST, PUT, DELETE, etc.) - Default: "GET"

  • data (optional): Request body for POST/PUT requests

  • headers (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 URL

  • method (optional): HTTP method - Default: "GET"

  • data (optional): Request body for POST/PUT requests

  • headers (optional): Additional HTTP headers

  • output_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 URL

  • pattern (optional): JSONPath pattern

  • method (optional): HTTP method - Default: "GET"

  • data (optional): Request body

  • headers (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

foo[*].baz

[1, 2]

Get all baz values

bar.items[*]

[10, 20, 30]

Get all items

metadata.version

["1.0.0"]

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 build

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 tools
batch-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.

ParametersJSON Schema
NameRequiredDescriptionDefault
requestsYesArray of request objects

TDQS

A3.9/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes key behaviors: concurrent execution for performance, deduplication optimization, and support for multiple HTTP methods with request bodies. However, it lacks important details like error handling, timeout behavior, authentication requirements, or rate limits that would be needed for a complete behavioral picture.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is efficiently structured with four focused sentences that each add value: states the core purpose, describes JSONPath support, explains performance optimizations, and notes HTTP method flexibility. There's zero wasted text, and the most important information (batch JSON extraction with JSONPath) appears first.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with no annotations and no output schema, the description provides good coverage of the core functionality but has significant gaps. It explains what the tool does and some behavioral aspects, but doesn't describe the return format, error responses, or important operational constraints. Given the complexity of batch HTTP operations with JSON processing, more completeness would be expected.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 100% schema description coverage, the schema already documents all parameters thoroughly. The description adds some context about JSONPath extensions and concurrent execution, but doesn't provide significant additional parameter semantics beyond what's in the schema. The baseline of 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('batch extract JSON content'), resource ('from multiple URLs'), and mechanism ('with different extended JSONPath patterns'). It distinguishes from sibling tools by specifying JSON extraction (vs. text extraction in batch-fetch-text) and batch processing (vs. single URL in fetch-json).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context for when to use this tool (batch JSON extraction with JSONPath patterns) and implicitly distinguishes from batch-fetch-text (JSON vs. text) and fetch-json (batch vs. single). However, it doesn't explicitly state when NOT to use it or name specific alternatives, missing the highest score criteria.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

batch-fetch-textA

Batch fetch raw text content from multiple URLs using various HTTP methods. Executes requests concurrently for better performance.

ParametersJSON Schema
NameRequiredDescriptionDefault
requestsYesArray of URLs (strings) or request objects

TDQS

A3.7/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden. It discloses key behavioral traits: concurrent execution for performance and support for various HTTP methods beyond GET. However, it lacks details on error handling, rate limits, authentication needs, timeout behavior, or what 'raw text content' specifically entails (e.g., encoding, size limits).

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise with two sentences that are front-loaded and waste-free. The first sentence covers purpose and scope, while the second adds performance context, with every word earning its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (batch HTTP operations with multiple methods and output formats), no annotations, and no output schema, the description is incomplete. It doesn't explain return values, error formats, or important behavioral constraints like concurrency limits or timeouts, leaving significant gaps for an AI agent to use it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, providing detailed documentation for the single parameter 'requests' and its nested properties. The description adds minimal value beyond the schema, only implying that requests are executed concurrently. No additional parameter semantics are explained in the description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('batch fetch raw text content'), target resource ('from multiple URLs'), and method ('using various HTTP methods'). It distinguishes from sibling tools by specifying 'raw text content' rather than JSON, and mentions concurrent execution for performance.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage context through 'batch fetch' and 'multiple URLs,' suggesting this is for bulk operations rather than single requests. However, it doesn't explicitly state when to use this tool versus alternatives like 'batch-fetch-json' or 'fetch-text,' nor does it mention any prerequisites or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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).

ParametersJSON Schema
NameRequiredDescriptionDefault
urlYesThe URL to get raw JSON from
patternNoExtended JSONPath pattern supporting: Basic: 'foo[*].baz', 'bar.items[*]'; Extensions: '$.data.`len`', '$.users.`keys`', '$.field.`str()`'; Filtering: '$.items[?(@.price > 10)]', '$.users[?name = "John"]'; Arithmetic: '$.a + $.b', '$.items[*].price * 1.2'; Text ops: '$.text.`sub(/old/, new)`', '$.csv.`split(",")'
methodNoHTTP method to use (GET, POST, PUT, DELETE, PATCH, etc.). Default is GET.GET
dataNoRequest body data for POST/PUT/PATCH requests. Can be a JSON object or string.
headersNoAdditional HTTP headers to include in the request

TDQS

A3.9/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It discloses behavioral traits like default HTTP method (GET), handling of omitted patterns, and support for extended JSONPath features. However, it lacks details on error handling, rate limits, authentication needs, or response formats, which are important for a tool making HTTP requests.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded: the first sentence states the core purpose, followed by key features and defaults. Every sentence adds value, such as explaining pattern behavior and HTTP method support, with no redundant or wasted information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (5 parameters, HTTP operations, JSONPath features) and no annotations or output schema, the description is partially complete. It covers basic usage and features but lacks details on error cases, authentication, rate limits, or return value structure, which are crucial for an HTTP-based tool with extended functionality.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all parameters thoroughly. The description adds some context, such as the effect of omitting 'pattern' and default HTTP method, but does not provide significant additional meaning beyond the schema. Baseline 3 is appropriate as the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Extract JSON content from a URL using JSONPath with extended features.' It specifies the verb ('extract'), resource ('JSON content'), and method ('JSONPath'), and distinguishes itself from sibling tools like fetch-text (which handles text) and batch-fetch-json (which handles multiple URLs).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context for usage: 'If 'pattern' is omitted or empty, the entire JSON document is returned' and 'Supports different HTTP methods (default: GET).' It implies when to use this tool (for JSON extraction with JSONPath) versus fetch-text (for text extraction), but does not explicitly name alternatives or state exclusions, such as when to prefer batch-fetch-json for multiple URLs.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

fetch-textC

Fetch text content from a URL using various HTTP methods. Defaults to converting HTML to Markdown format.

ParametersJSON Schema
NameRequiredDescriptionDefault
urlYesThe URL to get text content from
methodNoHTTP method to use (GET, POST, PUT, DELETE, PATCH, etc.). Default is GET.GET
dataNoRequest body data for POST/PUT/PATCH requests. Can be a JSON object or string.
headersNoAdditional HTTP headers to include in the request
output_formatNoOutput format: 'markdown' (default), 'clean_text', or 'raw_html'.markdown

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions 'various HTTP methods' and 'defaults to converting HTML to Markdown format,' which adds some context about functionality. However, it doesn't cover critical aspects like error handling, rate limits, authentication needs, or what happens with non-HTML content, leaving significant gaps for a tool that interacts with external URLs.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core purpose. It avoids unnecessary details, though it could be slightly more structured by explicitly separating key points. Overall, it's concise with minimal waste.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (5 parameters, no annotations, no output schema), the description is incomplete. It lacks details on behavioral traits, error handling, and output specifics, which are crucial for a tool fetching content from URLs. The schema covers parameters well, but the description doesn't compensate for missing annotations or output schema, leaving the agent with insufficient context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all parameters thoroughly. The description adds minimal value beyond the schema, mentioning 'various HTTP methods' and 'defaults to converting HTML to Markdown format,' which loosely relates to 'method' and 'output_format' parameters but doesn't provide additional semantics. Baseline 3 is appropriate as the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Fetch text content from a URL using various HTTP methods.' It specifies the resource (URL) and action (fetch text content), but doesn't explicitly differentiate from sibling tools like 'fetch-json' or 'batch-fetch-text' beyond mentioning 'text content' and 'Markdown format.' This makes it clear but not fully sibling-distinctive.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'fetch-json' or 'batch-fetch-text.' It mentions 'various HTTP methods' and 'defaults to converting HTML to Markdown format,' which implies some context, but lacks explicit when-to-use or when-not-to-use statements, leaving the agent to infer usage scenarios.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 8 tool updatesv1.0.0
    • Addedbatch-fetch-json
    • Addedbatch-fetch-text
    • Removedbatch-get-json
    • Removedbatch-get-text
    • Addedfetch-json
    • Addedfetch-text
    • Removedget-json
    • Removedget-text
  2. 4 tool updates
    • First observedbatch-get-json
    • First observedbatch-get-text
    • First observedget-json
    • First observedget-text

TDQS

A3.7/5.0
Disambiguation5/5

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.

Naming Consistency5/5

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.

Tool Count5/5

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.

Completeness4/5

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

ActivityInactive
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    B
    maintenance
    The web data platform for AI agents. Fetch, search, crawl, extract, monitor, and screenshot any URL. 55+ domain extractors, 65-98% token savings. 7 MCP tools included.
    332
    12
    AGPL 3.0
  • A
    license
    A
    quality
    A
    maintenance
    Web content extraction for AI agents. 10 tools: scrape, crawl, map, batch, extract, summarize, diff, brand, search, research. Uses TLS fingerprinting to bypass anti-bot without a headless browser. Outputs LLM-optimized markdown with 67% fewer tokens than raw HTML.
    10
    2,316
    AGPL 3.0
  • F
    license
    A
    quality
    C
    maintenance
    Reduces 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.
    6
    1
    -

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