JsonMcpTool

JokerQyou/JsonMcpTool

3.1

If you are the rightful owner of JsonMcpTool and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

JsonMcpTool is a specialized MCP server designed for efficient processing of JSON files, particularly I18Next translation files.

JsonMcpTool (Go Version)

A complete MCP (Model Context Protocol) tool for efficient JSON file processing, specifically designed for I18Next translation files and other large JSON documents. This is the Go rewrite of the original Python implementation for better performance and easier deployment.

šŸš€ Performance & Benefits

The Go version provides:

  • Faster execution - Native Go performance vs Python interpreted code
  • Lower memory usage - More efficient memory management
  • Single binary - No Python dependencies, easy deployment
  • Better concurrency - Go's built-in concurrency support
  • 100% API compatibility - Drop-in replacement for Python version

What This Tool Does

JsonMcpTool allows you to interact with JSON translation files through Claude Code using natural language. Instead of manually editing large translation files, you can ask Claude to:

  • "Get the dashboard title from my translations.json"
  • "Add a new success message to the alerts section"
  • "Update the login form validation text"
  • "Rename the old_section to new_section"
  • "Remove the deprecated translations"
  • "List all the keys in the dashboard section"

Key Features

  • šŸŽÆ I18Next Optimized: Perfect for translation files with interpolation ({{name}})
  • šŸš€ Memory Efficient: Handles large JSON files without loading everything into memory
  • šŸ” Smart Path Resolution: Works with both "key.with.dots" and section.subsection.key
  • šŸ’¾ Safe Operations: Atomic file writes prevent corruption
  • ⚔ Fast: Native Go performance, optimized for files up to 100MB+
  • šŸ›”ļø Error Handling: Clear error messages for debugging
  • āœ… 100% Compatible: All Python functionality maintained

Installation & Setup

1. Prerequisites

You need Go installed (1.23 or later):

# Check if Go is installed
go version

# If not installed, download from https://golang.org/dl/

2. Build JsonMcpTool

# Clone or download this repository
git clone <repository-url> /path/to/JsonMcpTool
cd /path/to/JsonMcpTool

# Build the binary
go build -o jsonmcptool ./cmd/server

# Or install directly
go install ./cmd/server

3. Configure Claude Code

Add JsonMcpTool to your Claude Code MCP configuration:

# Using the built binary
claude mcp add jsonmcptool -- /PATH/TO/JsonMcpTool/jsonmcptool

# Or if installed globally
claude mcp add jsonmcptool -- jsonmcptool

Alternative manual configuration:

{
  "mcpServers": {
    "jsonmcptool": {
      "type": "stdio",
      "command": "/PATH/TO/JsonMcpTool/jsonmcptool"
    }
  }
}

4. Restart Claude Code

Restart Claude Code to load the new MCP tool.

5. Test It Works

Create a simple JSON file and ask Claude:

"I have a translations.json file at /path/to/translations.json with this content:
{
  "dashboard": {
    "title": "Dashboard"  
  }
}

Can you get the dashboard title for me?"

Claude should respond with the value "Dashboard".

Development & Testing

Building from Source

# Clone the repository
git clone <repository-url>
cd JsonMcpTool

# Build
go build ./cmd/server

# Run tests
go test ./... -v

# Run benchmarks
go test ./... -bench=. -benchmem

Project Structure

JsonMcpTool/
ā”œā”€ā”€ cmd/server/main.go           # MCP server entry point
ā”œā”€ā”€ internal/
│   ā”œā”€ā”€ jsonhandler/             # File I/O, parsing, caching
│   ā”œā”€ā”€ pathresolver/            # Dot-notation path handling
│   ā”œā”€ā”€ operations/              # Core JSON operations
│   └── mcpserver/               # MCP server setup
ā”œā”€ā”€ testdata/                    # Test fixtures
ā”œā”€ā”€ original/                    # Original Python implementation
ā”œā”€ā”€ go.mod                       # Go module definition
└── README.md                    # This file

Available Operations

All 8 operations from the Python version are fully implemented:

OperationDescriptionExample Usage
get_keyRetrieve value by path"Get dashboard.title"
add_keyAdd new key-value pair"Add alerts.info with message"
update_keyUpdate existing key"Change dashboard.title to 'New Title'"
rename_keyRename/move key"Rename old_key to new_key"
remove_keyDelete key"Remove the deprecated section"
list_keysList keys at path"List all dashboard keys"
key_existsCheck if key exists"Does alerts.success exist?"
validate_jsonValidate file syntax"Check if my JSON file is valid"

Migration from Python Version

The Go version is a 100% compatible drop-in replacement. No changes needed to your Claude Code workflows or existing JSON files.

Performance Comparison

Initial benchmarks show significant improvements:

  • Startup time: ~50ms vs ~200ms (75% faster)
  • Memory usage: ~5MB vs ~15MB (67% less)
  • JSON parsing: ~2-3x faster for large files
  • File operations: ~40% faster due to efficient I/O

What's New in Go Version

  • Native Go performance and memory efficiency
  • Single binary deployment (no Python dependencies)
  • Enhanced error messages with precise location information
  • Better concurrent file access handling
  • Improved caching with automatic cache invalidation

Troubleshooting

Common Issues

"Tool not found":

  • Restart Claude Code after adding the MCP configuration
  • Check that the path to the binary is absolute and correct
  • Ensure the binary was built successfully

"Permission denied":

  • Make sure the binary is executable: chmod +x jsonmcptool
  • On macOS/Linux, you might need to allow the binary in Security settings

Build errors:

  • Ensure you have Go 1.23 or later: go version
  • Run go mod tidy to ensure dependencies are correct

What Makes This Special

Unlike generic text-editing tools, JsonMcpTool:

āœ… Understands JSON structure - No risk of breaking syntax
āœ… Handles large files efficiently - Works with 100MB+ translation files
āœ… Native Go performance - 2-3x faster than Python version
āœ… Single binary deployment - No runtime dependencies
āœ… Supports I18Next patterns - Built for translation workflows
āœ… Safe operations - Atomic writes prevent file corruption
āœ… Natural language interface - Just ask Claude what you want to do

Perfect for managing translation files, configuration files, or any JSON data through Claude Code!

License

MIT License - Use freely in your projects!