jpx
JMESPath query tool with 320+ extended functions for JSON transformation and analysis
jmespath-extensions
Extended JMESPath with 400+ functions. Available as a CLI, MCP server, Rust library, and Python bindings.
Documentation | Function Reference
Quick Start
# Install
brew install joshrotenberg/brew/jpx
# or: cargo install jpx
# Use it
echo '{"name": "world"}' | jpx 'upper(name)'
# "WORLD"
curl -s https://api.github.com/users/octocat | jpx '{
login: login,
created: format_date(parse_date(created_at), `%B %Y`)
}'
# {"login": "octocat", "created": "January 2011"}
What's Included
| Package | Description |
|---|---|
| jpx | CLI tool with REPL, multiple output formats |
| jpx-server | MCP server for AI assistants |
| jmespath-extensions | Rust library |
| jmespath-extensions-py | Python bindings |
MCP Server
Give Claude (or any MCP client) the ability to query and transform JSON:
{
"mcpServers": {
"jpx": {
"command": "jpx-server"
}
}
}
Tools: evaluate, batch_evaluate, validate, functions, describe, search, similar, format, diff, patch, merge, stats, paths, keys
Function Categories
| Category | Examples |
|---|---|
| String | upper, lower, split, replace, camel_case, pad_left |
| Array | first, last, unique, chunk, zip, flatten, group_by |
| Math | round, sqrt, median, stddev, percentile |
| Date/Time | now, parse_date, format_date, date_add, date_diff |
| Hash | md5, sha256, hmac_sha256, crc32 |
| Encoding | base64_encode, base64_decode, hex_encode, url_encode |
| Regex | regex_match, regex_extract, regex_replace |
| Geo | haversine, geo_distance_km, geo_bearing |
| Network | cidr_contains, is_private_ip, ip_to_int |
| JSON Patch | json_patch, json_merge_patch, json_diff |
| Fuzzy | levenshtein, jaro_winkler, soundex, metaphone |
| Expression | map_expr, filter_expr, sort_by_expr, group_by_expr |
A Taste
# Filter and transform
echo '[{"name":"alice","age":30},{"name":"bob","age":25}]' \
| jpx '[?age > `26`].{name: upper(name), birth_year: `2024` - age}'
# [{"name": "ALICE", "birth_year": 1994}]
# Fuzzy matching
jpx 'levenshtein(`kitten`, `sitting`)'
# 3
# Date arithmetic
jpx 'format_date(date_add(now(), `7`, `days`), `%Y-%m-%d`)'
# "2024-01-24"
# Network validation
echo '["10.0.0.1", "8.8.8.8", "192.168.1.1"]' \
| jpx '[?is_private_ip(@)]'
# ["10.0.0.1", "192.168.1.1"]
Library Usage
Rust
use jmespath_extensions::search;
use serde_json::json;
let data = json!({"items": [1, 2, 3, 4, 5]});
let result = search("sum(items)", &data)?;
assert_eq!(result, json!(15));
Python
import jmespath_extensions as jpx
data = {"items": [1, 2, 3, 4, 5]}
result = jpx.search("sum(items)", data)
assert result == 15
Acknowledgments
- JMESPath - The query language specification
- jmespath.rs - Rust implementation by @mtdowling
- jp - The official JMESPath CLI
License
MIT or Apache-2.0
Related Servers
Scout Monitoring MCP
sponsorPut performance and error data directly in the hands of your AI assistant.
Alpha Vantage MCP Server
sponsorAccess financial market data: realtime & historical stock, ETF, options, forex, crypto, commodities, fundamentals, technical indicators, & more
MCP Server Automation CLI
A CLI tool to automate packaging MCP servers as Docker images and deploying them to AWS ECS.
Sensei MCP
Expert guidance for Dojo and Cairo development on Starknet, specializing in the Dojo ECS framework for building onchain worlds.
MCP Server + Github OAuth
An MCP server with built-in GitHub OAuth support, designed for deployment on Cloudflare Workers.
Binalyze AIR MCP Server
Interact with Binalyze AIR's digital forensics and incident response capabilities using natural language.
Add Tool
Fetches and sets up an MCP server from a specified GitHub repository.
MCP Memory Visualizer
Graph visualization tools for exploring and analyzing Claude's memory data.
React MCP
An MCP server for integrating AI with React applications.
Replicate Ideogram V3 Balanced
Generate images using the Ideogram V3 Balanced model on Replicate.
Remote MCP Server (Authless)
A remote MCP server for Cloudflare Workers, authless by default with optional token-based authentication.
Hashnode MCP Server
An MCP server for interacting with the Hashnode API.