MCP JSON Server
A Model Context Protocol (MCP) server for JSON file operations, schema inference, and data transformation.
Overview
This MCP server provides comprehensive JSON manipulation tools and resources that can be used with Claude Desktop and other MCP-compatible clients. It offers powerful capabilities for reading, writing, transforming, and analyzing JSON data from files and URLs.
Features
🔧 Tools
Core JSON Tools:
get_data
- Fetch JSON data from files or URLs with optional JSON pointer accessget_schema
- Infer JSON schema from data sourcesschema_of
- Generate JSON schema from text inputwrite_json
- Write JSON data to files with formatting optionsupdate_json
- Update specific values using JSON pointersdelete_json_key
- Remove keys or array elementsmerge_json
- Merge JSON data with multiple strategies (update/replace/deep)transform_json
- Transform data (flatten/unflatten/keys_only/values_only)
🚀 Market Data Optimization Tools (Token Efficient):
get_ohlcv_summary
- Get OHLCV statistical summaries instead of raw dataget_market_stats
- Calculate field statistics (min/max/mean) for numeric dataquery_market_data
- Filter and paginate large datasets efficientlyget_top_performers
- Get top N records by any metricget_data_sample
- Get representative samples of large datasets
📁 Resources
json://file/{path}
- Direct access to JSON filesjson://url/{encoded_url}
- Direct access to JSON from URLs
🎯 Key Capabilities
- JSON Pointer support (RFC 6901) for precise data access
- Schema inference with JSON Schema Draft 2020-12 compliance
- Multiple merge strategies for combining JSON data
- Data transformation utilities (flatten/unflatten nested objects)
- Support for both local files and HTTP/HTTPS URLs
- Comprehensive error handling and validation
Installation
Option 1: Install from PyPI (when published)
Option 2: Install from Source
Option 3: Development Installation
Quick Start
1. Start the Server
2. Configure Claude Desktop
Add to your Claude Desktop configuration:
3. Basic Usage Examples
Read JSON Data
Generate Schemas
Update Data
Transform Data
JSON Pointer Usage
This server supports JSON Pointer (RFC 6901) for precise data access:
Pointer Examples:
""
or"/"
→ entire document"/users"
→ users array"/users/0"
→ first user"/users/0/name"
→ "Alice""/users/1/profile/city"
→ "LA""/meta/total"
→ 2
Alternative Formats:
"/users/0/name"
(standard)"#/users/0/name"
(with hash prefix)"users/0/name"
(without leading slash)
Tool Reference
Data Access Tools
get_data(source, pointer="")
Fetch JSON data with optional JSON pointer filtering.
- source: File path or URL
- pointer: JSON pointer for data selection (optional)
get_schema(source, pointer="", title="Schema")
Generate JSON schema from data source.
- source: File path or URL
- pointer: JSON pointer to specific data (optional)
- title: Schema title
schema_of(json_text, title="Schema")
Generate JSON schema from JSON text input.
- json_text: JSON string to analyze
- title: Schema title
Data Modification Tools
write_json(file_path, data, indent=2)
Write JSON data to file with formatting.
- file_path: Output file path
- data: JSON data to write
- indent: Indentation spaces
update_json(file_path, json_pointer, new_value)
Update specific value using JSON pointer.
- file_path: Target JSON file
- json_pointer: Path to value
- new_value: New value to set
delete_json_key(file_path, json_pointer)
Delete key or array element.
- file_path: Target JSON file
- json_pointer: Path to delete
merge_json(target_file, source_data, strategy="update")
Merge JSON data with different strategies.
- target_file: File to merge into
- source_data: Data to merge
- strategy: "update", "replace", or "deep"
Data Transformation Tools
transform_json(source_path, output_path, transformation)
Transform JSON data structure.
- source_path: Input file
- output_path: Output file
- transformation: "flatten", "unflatten", "keys_only", "values_only"
Resources
File Resource: json://file/{path}
Direct access to local JSON files.
Example:
URL Resource: json://url/{encoded_url}
Direct access to JSON from HTTP/HTTPS URLs.
Example:
Note: URLs must be percent-encoded
Development
Running Tests
Project Structure
Dependencies
- mcp>=1.0.0 - Model Context Protocol framework
- requests>=2.28.0 - HTTP client for URL fetching
Development Dependencies:
- pytest>=7.0.0 - Testing framework
- pytest-asyncio>=0.21.0 - Async test support
- black>=22.0.0 - Code formatting
- ruff>=0.1.0 - Linting and code quality
Common Use Cases
Configuration Management
API Data Processing
Schema Generation & Validation
Error Handling
The server provides detailed error messages for common issues:
- Invalid JSON syntax
- File not found errors
- Network connectivity issues
- Invalid JSON pointer paths
- Type mismatch errors
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests:
python test_runner.py
- Submit a pull request
License
MIT License - see LICENSE file for details.
Support
- Issues: Report bugs and request features via GitHub issues
- Documentation: See
usage_example.py
for more examples - Testing: Run
python test_runner.py
to verify functionality
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
Enables comprehensive JSON file operations including reading, writing, transforming, and analyzing JSON data from local files and URLs. Supports JSON pointer access, schema inference, data merging, and specialized market data optimization tools.
Related MCP Servers
- -securityFlicense-qualityProvides powerful JSON manipulation tools through Model Context Protocol, enabling complex queries, schema generation, and validation with jq notation and native Node.js operations.Last updated -4
- AsecurityFlicenseAqualityEnables efficient extraction of specific data from JSON APIs using JSONPath patterns, reducing token usage by up to 99% compared to fetching entire responses. Supports single and batch operations for both JSON extraction and raw text retrieval from URLs.Last updated -41
- -securityFlicense-qualityEnables users to manage data in a simple JSON file database through MCP tools and REST API. Supports creating, reading, updating, and deleting items organized in collections with auto-generated UUIDs.Last updated -
- -securityFlicense-qualityEnables AI to create, edit, and batch generate JSON data with advanced rule engines. Supports CRUD operations, node-level editing, template management, and multi-format file exports (JSON, JSONL, CSV).Last updated -3179