Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

MCP Server Overview

jpx can run as an MCP (Model Context Protocol) server, allowing AI assistants like Claude to use JMESPath for JSON querying and transformation.

What is MCP?

MCP is an open protocol that enables AI assistants to interact with external tools and data sources. By running jpx as an MCP server, you give Claude (and other MCP-compatible assistants) the ability to:

  • Query JSON data using JMESPath expressions
  • Transform and manipulate JSON structures
  • Use all 400+ extension functions
  • Explore available functions and their documentation

Why Use jpx with Claude?

When working with JSON data in Claude, jpx provides:

  • Precise queries: Extract exactly the data you need
  • Complex transformations: Reshape data structures on the fly
  • Powerful functions: String manipulation, math, dates, hashing, and more
  • Consistent results: Deterministic query execution

Available Tools

The MCP server exposes 25 tools organized by purpose:

Function Discovery Tools

Tools for finding and exploring available JMESPath functions:

ToolDescription
searchFuzzy search for functions by name, description, category, or signature
similarFind functions related to a specified function
functionsList available functions (optionally filter by category)
describeGet detailed info for a specific function
categoriesList all function categories

Multi-Server Tool Discovery

Tools for semantic search across multiple MCP servers (see Discovery):

ToolDescription
register_discoveryRegister an MCP server’s tools for indexing
query_toolsBM25 semantic search across registered tools
similar_toolsFind tools related to a specific tool
list_discovery_serversList registered servers
list_discovery_categoriesList tool categories across servers
inspect_discovery_indexDebug index statistics
unregister_discoveryRemove a server from the registry
get_discovery_schemaGet the registration schema

Data Analysis Tools

Tools for understanding JSON structure before querying:

ToolDescription
statsAnalyze JSON structure (type, size, depth, field analysis)
pathsExtract all paths in dot notation (e.g., users[0].name)
keysExtract object keys (optionally recursive with dot notation)

Query Tools

Tools for evaluating JMESPath expressions:

ToolDescription
evaluateRun a JMESPath expression against JSON input
evaluate_fileQuery JSON files directly from disk
batch_evaluateRun multiple expressions against the same input
validateCheck expression syntax without executing

JSON Utility Tools

Tools for JSON manipulation (RFC 6902/7396):

ToolDescription
formatPretty-print JSON with configurable indentation
diffGenerate RFC 6902 JSON Patch between documents
patchApply RFC 6902 JSON Patch operations
mergeApply RFC 7396 JSON Merge Patch

Typical Workflow for AI Agents

  1. Analyze data: Use stats and paths to understand the JSON structure
  2. Discover functions: Use search to find relevant functions, similar to explore alternatives
  3. Build query: Use validate to check syntax before executing
  4. Execute: Use evaluate or batch_evaluate to run queries
  5. Transform: Use diff, patch, or merge for modifications

Getting Started

See Setup to configure jpx as an MCP server for Claude Desktop.