Skip to main content
Glama

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

Related MCP server: MCP JSON Maker

Installation

bun add json-editor-mcp

Usage

MCP Server Configuration

Add to your MCP client configuration:

{
  "mcpServers": {
    "json-editor": {
      "command": "bunx",
      "args": ["json-editor-mcp"]
    }
  }
}

Cursor Rules Integration

Copy the rule file to your project to ensure AI assistants use MCP tools:

cp .cursor/rules/json-editor-mcp.mdc /path/to/your/project/.cursor/rules/

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:

{
  "common": {
    "welcome": "Welcome"
  }
}

messages/es.json:

{
  "common": {
    "welcome": "Bienvenido"
  }
}

Tool call:

read_multiple_json_values(["messages/en.json", "messages/es.json"], "common.welcome")

Output:

{
  "messages/en.json": "Welcome",
  "messages/es.json": "Bienvenido"
}

Single file example:

read_multiple_json_values(["messages/en.json"], "common.welcome")

Output:

{
  "messages/en.json": "Welcome"
}

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):

{
  "common": {
    "welcome": "Welcome"
  }
}

Tool call:

write_json_values("/absolute/path/to/messages/en.json", "pages.about.title", "About Us")

Output JSON (messages/en.json):

{
  "common": {
    "welcome": "Welcome"
  },
  "pages": {
    "about": {
      "title": "About Us"
    }
  }
}

Output:

Successfully wrote to /absolute/path/to/messages/en.json

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:

{
  "common": {
    "welcome": "Welcome",
    "goodbye": "Goodbye"
  }
}

messages/es.json:

{
  "common": {
    "welcome": "Bienvenido",
    "goodbye": "Adiรณs"
  }
}

Tool call:

delete_multiple_json_values(["messages/en.json", "messages/es.json"], "common.goodbye")

Output:

{
  "messages/en.json": "Successfully deleted",
  "messages/es.json": "Successfully deleted"
}

Output JSON files:

messages/en.json:

{
  "common": {
    "welcome": "Welcome"
  }
}

messages/es.json:

{
  "common": {
    "welcome": "Bienvenido"
  }
}

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):

{
  "common": {
    "welcome": "Welcome"
  },
  "common": {
    "goodbye": "Goodbye"
  }
}

Tool call:

merge_duplicate_keys("messages/en.json")

Output JSON (messages/en.json):

{
  "common": {
    "welcome": "Welcome",
    "goodbye": "Goodbye"
  }
}

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 reads

  • Invalid 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

git clone https://github.com/peternagy1332/json-editor-mcp.git
cd json-editor-mcp
bun install
bun run build

License

MIT License - see LICENSE file for details.

Support

File issues on GitHub.

Available Tools

4 tools
delete_multiple_json_valuesC

Delete a value at a specified path from multiple JSON files using dot notation. Returns a map of file paths to deletion results.

ParametersJSON Schema
NameRequiredDescriptionDefault
filePathsYesArray of paths to JSON files
pathYesDot notation path to the value to delete (e.g., "common.welcome")

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action is a deletion and returns results, but lacks details on permissions, error handling, side effects (e.g., file modification), or rate limits. For a mutation tool with zero annotation coverage, this is a significant gap in transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads key information (action, resource, method, return). It avoids redundancy and wastes no words, though it could be slightly more structured for clarity. Every element earns its place, making it concise and well-organized.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (mutation operation on multiple files) and lack of annotations and output schema, the description is incomplete. It doesn't explain what 'deletion results' entail, error scenarios, or behavioral nuances, leaving gaps for the agent. More detail is needed to compensate for the missing structured data.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents both parameters ('filePaths' and 'path') with descriptions and examples. The description adds minimal value beyond the schema, mentioning 'dot notation' and 'multiple JSON files', but doesn't provide additional syntax or format details. Baseline 3 is appropriate as the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Delete a value') and resource ('from multiple JSON files'), specifying the method ('using dot notation') and return type ('map of file paths to deletion results'). It distinguishes from siblings like 'read_multiple_json_values' and 'write_json_values' by focusing on deletion, though it doesn't explicitly contrast with 'merge_duplicate_keys'. The purpose is specific but could be more distinct regarding sibling differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. It doesn't mention prerequisites, constraints, or comparisons to sibling tools like 'merge_duplicate_keys' or 'write_json_values', leaving the agent to infer usage based on the action alone. This lack of explicit context reduces effectiveness in tool selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

merge_duplicate_keysB

Deep merge duplicate keys in a JSON file. Last value wins for primitives, objects merge recursively.

ParametersJSON Schema
NameRequiredDescriptionDefault
filePathYesPath to the JSON file

TDQS

B3.2/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It explains the merging logic ('last value wins for primitives, objects merge recursively'), which is useful. However, it omits critical details like whether the operation modifies the file in-place, requires specific permissions, or handles errors, making it incomplete for a mutation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise and front-loaded, consisting of two sentences that directly convey the tool's purpose and behavior without any wasted words. Every sentence earns its place by providing essential information efficiently.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity as a mutation operation (merging JSON data), the lack of annotations, and no output schema, the description is insufficient. It fails to address key aspects like return values, error handling, or side effects, leaving significant gaps for agent understanding.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, with the 'filePath' parameter well-documented in the schema. The description adds no additional parameter semantics beyond what the schema provides, such as file format expectations or path validation, so it meets the baseline for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('deep merge') and resource ('duplicate keys in a JSON file'), specifying the operation's behavior. However, it does not explicitly differentiate from sibling tools like 'write_json_values' or 'delete_multiple_json_values', which prevents a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives, such as the sibling tools listed. It lacks context about prerequisites, exclusions, or specific scenarios where merging duplicate keys is appropriate, leaving the agent without usage direction.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

read_multiple_json_valuesB

Read values from multiple JSON files at a specified path using dot notation. Returns a map of file paths to values.

ParametersJSON Schema
NameRequiredDescriptionDefault
filePathsYesArray of paths to JSON files
pathYesDot notation path to the value (e.g., "common.welcome")

TDQS

B3.3/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the return format ('map of file paths to values') but fails to describe error handling (e.g., for missing files or invalid paths), performance implications, or any side effects like file locking. This leaves gaps in understanding the tool's behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, well-structured sentence that efficiently conveys the core functionality and return value without any redundant information. It is front-loaded and appropriately sized for the tool's complexity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (2 parameters, no output schema, no annotations), the description covers the basic purpose and return format but lacks details on error handling, performance, or usage context. It is minimally adequate but has clear gaps in behavioral transparency and guidelines.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents both parameters (filePaths and path) adequately. The description adds minimal value by implying dot notation usage but does not provide additional syntax examples or constraints beyond what the schema specifies, meeting the baseline for high coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Read values'), target resources ('multiple JSON files'), and method ('using dot notation'), distinguishing it from siblings like delete_multiple_json_values (deletion) and write_json_values (writing). It precisely defines the tool's function without ambiguity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like merge_duplicate_keys or other read operations. It lacks context about prerequisites, such as file accessibility or JSON validity, and does not mention any exclusions or typical use cases.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

write_json_valuesA

Write a value to a JSON file at a specified path using dot notation. Creates missing paths automatically.

ParametersJSON Schema
NameRequiredDescriptionDefault
filePathYesAbsolute path to the JSON file
pathYesDot notation path to the value (e.g., "common.welcome")
valueYesValue to write (any JSON-serializable type)

TDQS

A3.9/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It adds useful context about automatic path creation, which is a key behavioral trait not implied by the name alone. However, it doesn't cover other important aspects like file overwriting behavior, error handling, or permissions required, leaving gaps for a mutation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the core purpose in the first sentence and adds a critical behavioral detail in the second. Both sentences earn their place by providing essential information without redundancy, making it highly efficient and well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity as a file mutation operation with no annotations and no output schema, the description is adequate but incomplete. It covers the basic action and path creation, but lacks details on return values, error cases, or side effects, which are important for safe usage in a broader context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, so the input schema already documents all parameters thoroughly. The description adds minimal value beyond the schema by implying the 'path' parameter uses dot notation and the 'value' is JSON-serializable, but it doesn't provide additional syntax or format details, meeting the baseline for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Write a value'), target resource ('JSON file'), and mechanism ('using dot notation'), distinguishing it from sibling tools like 'read_multiple_json_values' and 'delete_multiple_json_values' by focusing on writing rather than reading or deleting.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context for usage ('Creates missing paths automatically'), which helps understand when to use this tool for path creation. However, it lacks explicit guidance on when to use alternatives like 'merge_duplicate_keys' or when not to use this tool, such as for bulk operations or deletions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 4 tool updatesv1.0.0
    • First observeddelete_multiple_json_values
    • First observedmerge_duplicate_keys
    • First observedread_multiple_json_values
    • First observedwrite_json_values

TDQS

A3.6/5.0

Scored across 4 tools

Disambiguation5/5

Each tool has a clearly distinct purpose with no ambiguity: delete_multiple_json_values removes values, merge_duplicate_keys consolidates keys, read_multiple_json_values retrieves values, and write_json_values sets values. The operations target different actions on JSON files, making it easy for an agent to select the correct tool.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern with snake_case, using descriptive verbs like delete, merge, read, and write. The naming is predictable and readable, with no deviations in style or convention across the set.

Tool Count5/5

With 4 tools, the server is well-scoped for JSON editing operations, covering essential actions like reading, writing, deleting, and merging. Each tool earns its place without being overly sparse or bloated, fitting a typical utility server range.

Completeness4/5

The tool set provides strong coverage for basic JSON manipulation, including CRUD-like operations (read, write, delete) and a merge function. A minor gap exists in lacking a tool for updating existing values without overwriting, but agents can work around this using write_json_values, and the core workflows are well-supported.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers