rubyhash-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@rubyhash-mcp diff these two Ruby hashes from test output"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
rubyhash-mcp
MCP server for RubyHash. Gives any MCP-capable agent (Claude Code, Claude Desktop, Cursor, and others) two deterministic Ruby tools:
ruby_hash_diff: compare two Ruby hash literals, or paste raw failing Minitest/RSpec output, and get a structured report of exactly what changed: changed values with before and after, added and removed keys, and explicit type changes (nil to String, Integer to Float, symbol keys vs string keys).
ruby_to_json: convert a Ruby hash or array literal (hashrockets, symbol keys, shorthand syntax, nesting, nil/true/false) to clean JSON with sorted keys.
Everything runs locally in the server process. Nothing is uploaded, logged, or stored, the same privacy promise as rubyhash.dev.
Tools
ruby_hash_diff: Compare two Ruby hash literals, or paste raw failing Minitest/RSpec output, and get a structured report: changed values with before and after, added and removed keys, and explicit type changes (nil to String, Integer to Float, symbol keys vs string keys).ruby_to_json: Convert a Ruby hash or array literal (hashrockets, symbol keys, shorthand syntax, nesting, nil/true/false) to clean JSON with alphabetically sorted keys.
Related MCP server: agent-core-mcp
Why an agent would want this
When a Ruby test fails on two large nearly identical hashes, comparing them by reading is slow and error prone, for humans and for language models. A 40-key nested hash diff burns context and invites mistakes. This server does the comparison with a real recursive descent parser and hands back only the differences, deterministically.
Install
{
"mcpServers": {
"rubyhash": {
"command": "npx",
"args": ["-y", "rubyhash-mcp"]
}
}
}Or for Claude Code:
claude mcp add rubyhash -- npx -y rubyhash-mcpExample
Input (raw test output):
-{"uid"=>"u@example.test", "role"=>"admin", "seats"=>3}
+{"uid"=>"u@example.test", "role"=>"editor", "seats"=>3.0}Output:
{
"equal": false,
"summary": "2 changed, 0 added, 0 removed, 1 type change",
"changed": [
{ "path": "role", "before": "admin", "after": "editor", "typeChanged": false },
{ "path": "seats", "before": 3, "after": 3, "beforeType": "Integer", "afterType": "Float", "typeChanged": true }
]
}Also available as an HTTP API
If you cannot run a local MCP server, the same tools are exposed at the RubyHash Agent API, with an OpenAPI description and an x402 machine-payable catalog.
Development
npm install
npm test # 36 unit testsLicense
MIT for this package. The rubyhash.dev site and its browser tool are separate, private, and all rights reserved.
Available Tools
2 toolsruby_hash_diffDiff two Ruby hashesA
Compare two Ruby hash literals and return exactly what changed: changed values with before/after, added and removed keys, and explicit type changes (nil to String, Integer to Float, symbol vs string keys). Pass either expected and actual as Ruby hash strings, or pass raw failing Minitest/RSpec output in raw and the first two hash literals found will be compared. Much cheaper and more reliable than eyeballing large nested hashes in test output.
Inputs: raw, actual, expected.
ruby_to_jsonConvert a Ruby hash to JSONA
Parse a Ruby hash or array literal (hashrockets, symbol keys, shorthand syntax, nesting, nil/true/false) and return clean JSON with alphabetically sorted keys. Symbols are rendered as ":name" strings.
Inputs: hash (required), sort_keys.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 2 tools
The two tools have clearly distinct purposes: one compares two Ruby hashes and returns a diff, the other converts a Ruby hash/array literal to JSON. There is no overlap or ambiguity.
Both tool names follow a consistent verb_noun snake_case pattern: ruby_hash_diff and ruby_to_json. The prefix 'ruby_' is shared, and the second part describes the action ('hash_diff' vs 'to_json').
With only 2 tools, the server is minimal but still focused. It feels slightly thin for a general utility server, but for a niche Ruby hash utility it is acceptable and not excessive.
The tools cover diffing and conversion, which are useful but there are obvious gaps such as merging, validation, or formatting. The surface is not severely incomplete but lacks typical CRUD lifecycle coverage.
Maintenance
Related MCP Connectors
Compare two JSON files deeply, ignoring order, to surface every difference. Get a clear, structure…
Compare two JSON files deeply, regardless of order. Get a detailed difference report highlighting…
Developer utility for comparing two strict JSON documents.
Compare two JSON files deeply without worrying about key or array order. Detect missing, extra, an…
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables deep, order-independent comparison of JSON files to detect differences including missing keys, value mismatches, and type differences. Provides detailed reports with path tracking for precise identification of variations between JSON structures.MIT
- AlicenseAqualityCmaintenanceEnables AI agents to perform exact, reproducible mechanical computation — text diffing, hashing, JSON querying, calendar arithmetic, deadline-bounded regex extraction, CSV parsing, similarity scoring, unit and base conversion — instead of relying on probabilistic guessing. Runs dependency-free, read-only and offline over stdio, with schema validation and hard caps on every operation so no call can hang the client.1541 npmMIT
- AlicenseAqualityCmaintenanceEnables validating JSON/JSONC, getting/setting values with jq-like paths, pretty-printing or minifying, validating against Ajv JSON Schema, and diffing local files or inline strings without network calls.8MIT
- AlicenseAqualityBmaintenanceEnables MCP clients to run seven local text and data utilities, including JSON formatting, CSV inspection, text analysis and diffing, hashing, timestamp conversion, and URL component parsing. Everything runs offline in memory with no API keys, models, or outbound requests.71MIT