jmespath-extensions
Extended JMESPath with 400+ functions. Available as a CLI, MCP server, Rust library, and Python bindings.
Documentation | Function Reference
Quick Start
# Install
# or: cargo install jpx
# Use it
|
# "WORLD"
|
# {"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:
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
|
# [{"name": "ALICE", "birth_year": 1994}]
# Fuzzy matching
# 3
# Date arithmetic
# "2024-01-24"
# Network validation
|
# ["10.0.0.1", "192.168.1.1"]
Library Usage
Rust
use search;
use json;
let data = json!;
let result = search?;
assert_eq!;
Python
=
=
assert == 15
Acknowledgments
- JMESPath - The query language specification
- jmespath.rs - Rust implementation by @mtdowling
- jp - The official JMESPath CLI
License
MIT or Apache-2.0