rubyhash-mcp

rubyhash-mcp

Enables comparing Ruby hash literals and converting Ruby hashes to JSON with deterministic diff reports, running locally for privacy.

Category
Visit Server

README

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.

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-mcp

Example

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 tests

License

MIT for this package. The rubyhash.dev site and its browser tool are separate, private, and all rights reserved.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured