Facilitates management of multilingual Next.js projects by enabling efficient editing of translation JSON files and other JSON-based configurations.
JSON Editor MCP
A Model Context Protocol (MCP) server for editing JSON files with read, write, and deep merge capabilities. Perfect for managing multilingual Next.js projects and other JSON-based configurations.
Note: This is an actively developed tool. Feature requests and bug reports are welcome! File issues on GitHub.
Problems This Solves
๐ฐ Significant token savings: Edit specific JSON paths instead of reading/writing entire files
โก Efficient operations: ~100 tokens per edit vs 4,000+ tokens for full file operations
๐ฆ Handles large files: Large translation files may not fit into context windows; targeted operations work regardless of file size
๐ Faster edits: Avoids slow network round-trips from reading/writing entire files
๐ Prevents duplicate keys: AI can't see full translation JSON and creates duplicates; targeted operations avoid this issue
๐ Targeted reads: Read only the values you need using dot notation paths
โ๏ธ Targeted writes: Update only specific paths, automatically creates missing nested structures
๐๏ธ Targeted deletes: Remove specific paths from JSON files
๐ Deep merge support: Merge duplicate keys with recursive object merging
๐ Multi-file operations: Read, write, or delete the same path from multiple JSON files efficiently
๐ TypeScript support: Full type definitions included
๐ค MCP compliant: Works with AI assistants (Cursor, Claude, ChatGPT) and development tools
Installation
Usage
MCP Server Configuration
Add to your MCP client configuration:
Cursor Rules Integration
Copy the rule file to your project to ensure AI assistants use MCP tools:
Tools
read_multiple_json_values
Reads the same dot notation path from one or more JSON files in a single operation. Returns a map with file paths as keys and the extracted values as values. Useful for comparing translations across language files or reading from a single file.
Note: For single file operations, pass an array with one file path: ["messages/en.json"]
Input JSON files:
messages/en.json:
messages/es.json:
Tool call:
Output:
Single file example:
Output:
write_json_values
Writes a value to a JSON file at a specified dot notation path. Automatically creates missing nested paths and preserves existing structure.
Input JSON (messages/en.json):
Tool call:
Output JSON (messages/en.json):
Output:
delete_multiple_json_values
Deletes a value at a specified dot notation path from one or more JSON files. Returns a map with file paths as keys and deletion results as values.
Note: For single file operations, pass an array with one file path: ["messages/en.json"]
Input JSON files:
messages/en.json:
messages/es.json:
Tool call:
Output:
Output JSON files:
messages/en.json:
messages/es.json:
merge_duplicate_keys
Performs a deep merge of duplicate keys in a JSON file. Primitives use last-value-wins, objects merge recursively, and arrays use last-value-wins. Useful when AI assistants create duplicate keys because they can't see the full file structure.
Input JSON (messages/en.json):
Tool call:
Output JSON (messages/en.json):
API Reference
Path Notation: Dot notation for nested paths (e.g., "common.welcome", "pages.home.title")
Error Handling:
File not found: Creates empty object
{}for readsInvalid JSON: Returns error message
Path not found: Error for reads, auto-creates for writes
Deep Merge: Primitives last-value-wins, objects merge recursively, arrays last-value-wins
Development
License
MIT License - see LICENSE file for details.
Support
File issues on GitHub.