by ciresnave
A high-performance Rust-based Model Context Protocol (MCP) server that provides comprehensive JSON file operations optimized for LLM interactions. This server enables LLMs to efficiently read, write, query, and manipulate JSON files with support for extremely large datasets and advanced querying capabilities.
cargo install json-mcp-server
# Linux/macOS curl -fsSL https://raw.githubusercontent.com/ciresnave/json-mcp-server/main/scripts/install.sh | bash # Windows PowerShell iwr https://raw.githubusercontent.com/ciresnave/json-mcp-server/main/scripts/install.ps1 | iex
Download platform-specific binaries from GitHub Releases:
json-mcp-server-v{version}-x86_64-pc-windows-msvc.zip
json-mcp-server-v{version}-x86_64-apple-darwin.tar.gz
json-mcp-server-v{version}-x86_64-unknown-linux-gnu.tar.gz
# Download and install .deb package wget https://github.com/ciresnave/json-mcp-server/releases/latest/download/json-mcp-server_*_amd64.deb sudo dpkg -i json-mcp-server_*_amd64.deb
# Download and install .rpm package wget https://github.com/ciresnave/json-mcp-server/releases/latest/download/json-mcp-server-*.x86_64.rpm sudo rpm -i json-mcp-server-*.x86_64.rpm
# Manual install using PKGBUILD wget https://github.com/ciresnave/json-mcp-server/releases/latest/download/PKGBUILD makepkg -si
# Clone the repository git clone https://github.com/ciresnave/json-mcp-server.git cd json-mcp-server # Build the project cargo build --release # Run the server cargo run
After installation, verify it works:
json-mcp-server --version json-mcp-server --help
The JSON MCP Server communicates via JSON-RPC over stdin/stdout following the Model Context Protocol specification.
Start the server:
cargo run
Get help: Use the json-help
tool to learn about available functionality:
*Configuration content*json
{
"name": "json-read",
"arguments": {
"file_path": "./data.json",
"json_path": "$.users[*].name",
"format": "pretty"
}
}
#### Writing JSON Data
*Configuration content*
#### Querying with JSONPath
*Configuration content*
#### Processing Large Files
*Configuration content*
## Tool Reference
### json-read
Read and parse JSON files with optional JSONPath filtering and pagination.
**Parameters:**
- `file_path` (string, required): Path to JSON file
- `json_path` (string, optional): JSONPath expression for filtering
- `start_index` (integer, optional): Starting index for pagination (default: 0)
- `limit` (integer, optional): Maximum items to return (default: 1000)
- `output_format` (string, optional): Output format - "json", "pretty", "compact" (default: "json")
### json-write
Write or update JSON files with flexible merge strategies.
**Parameters:**
- `file_path` (string, required): Path to JSON file
- `content` (string, required): JSON content to write
- `mode` (string, optional): Write mode - "replace", "merge\_shallow", "merge\_deep", "append" (default: "replace")
### json-query
Execute JSONPath queries on JSON files with various output formats.
**Parameters:**
- `file_path` (string, required): Path to JSON file
- `json_path` (string, required): JSONPath query expression
- `output_format` (string, optional): Output format - "json", "pretty", "compact", "csv", "markdown" (default: "json")
### json-validate
Validate JSON file structure and syntax.
**Parameters:**
- `file_path` (string, required): Path to JSON file to validate
### json-help
Get comprehensive help about available tools and JSONPath syntax.
**Parameters:**
- `topic` (string, optional): Help topic - "overview", "tools", "jsonpath", "examples", "troubleshooting" (default: "overview")
## JSONPath Support
The server supports full JSONPath syntax for querying JSON data:
- `$` - Root element
- `.field` - Child field access
- `[index]` - Array index access
- `[*]` - All array elements
- `..field` - Recursive descent
- `[?(@.field > value)]` - Filter expressions
- `{field1, field2}` - Projection
### JSONPath Examples
```bash
# Get all user names
$.users[*].name
# Filter users over 25
$.users[?(@.age > 25)]
# Get nested data
$.data.items[*].details.price
# All prices anywhere in document
$..price
# Complex filtering
$.products[?(@.category == 'electronics' && @.price < 500)].name
json-read
tool automatically uses streaming for memory efficiencyThe server provides detailed error messages to help diagnose issues:
The JSON MCP Server works with any MCP-compatible client. Detailed configuration guides are available in the examples/mcp_clients/
directory:
VS Code + GitHub Copilot:
*Configuration content*
Claude Desktop:
*Configuration content*
For detailed setup instructions, troubleshooting, and advanced configurations, see the respective client guides in the examples/mcp_clients/
directory.
json-mcp-server/
āāā src/ # Source code
ā āāā main.rs # Application entry point and MCP server
ā āāā lib.rs # Library exports for testing
ā āāā mcp/ # MCP protocol implementation
ā ā āāā mod.rs
ā ā āāā protocol.rs # Protocol definitions and types
ā ā āāā server.rs # MCP server implementation
ā āāā json_tools/ # JSON tool implementations
ā āāā mod.rs
ā āāā handler.rs # Tool coordination and help system
ā āāā operations.rs # Read/write/validate operations
ā āāā query.rs # JSONPath querying with multiple formats
ā āāā streaming.rs # Large file streaming and pagination
āāā tests/ # Integration tests
ā āāā integration_tests.rs
āāā examples/ # Example configurations and data
ā āāā mcp_clients/ # Client configuration guides
ā ā āāā vscode.md # VS Code setup
ā ā āāā claude-desktop.md
ā ā āāā github-copilot.md
ā ā āāā generic.md # Generic MCP client setup
ā ā āāā client_implementation.md
ā ā āāā python_client.py
ā āāā sample-data.json # Sample test data
ā āāā test-commands.jsonl
ā āāā test-output.json
āāā dev_tools/ # Development and testing utilities
ā āāā README.md # Development tools documentation
ā āāā testing/ # Test scripts and utilities
ā āāā test_all_tools.py
ā āāā test_multiple_instances.py
ā āāā test_json_help.py
ā āāā [other test files]
āāā Cargo.toml # Rust project configuration
āāā README.md # This file
# Development build cargo build # Release build cargo build --release # Run tests cargo test # Check for issues cargo check
tokio
: Async runtimeserde
/serde_json
: JSON serializationjsonpath-rust
: JSONPath query supportanyhow
: Error handlingclap
: Command line parsingThis project is licensed under the MIT OR Apache-2.0 license.
Contributions are welcome! Please ensure:
For issues, questions, or contributions, please refer to the project repository.