Skip to main content

MCP server for Razorpay i18n-code-builder — detect and fix i18n violations in Go/TypeScript using Claude

Project description

razorpay-i18n-mcp

An MCP (Model Context Protocol) server that gives Claude agents the ability to detect and fix internationalization (i18n) violations in Go and TypeScript/JavaScript codebases.

Built on Razorpay's i18n-code-builder skill — 14 reference documents covering detection rules, i18nify API signatures, anomaly catalog (JPY zero-decimal, DST gaps, org-vs-country logic, etc.), and language-specific patterns across Go/TypeScript/React/Python.


How it works

The MCP exposes two tools. When Claude calls them, it gets back the actual code files plus the relevant skill reference docs — so Claude reasons about violations and writes fixes using the full i18n knowledge as context, rather than rigid regex matching or hardcoded templates.

Claude calls i18n_detect(path)
  → MCP reads code files from disk
  → MCP loads detection-rules.md + language-patterns.md + anomalies.md
  → Returns both to Claude

Claude reasons about violations using the skill patterns as guidance

Claude calls i18n_fix(path, violation_types)
  → MCP reads the file
  → MCP loads targeted reference docs (i18nify-api.md, currency.md, etc.)
  → Returns both to Claude

Claude writes the correct fix informed by the reference docs

No internal LLM calls. No API key required. Just file reading and knowledge delivery.


Tools

Tool Description
i18n_detect Read code files + load detection guidance. Claude identifies violations using skill patterns as inspiration.
i18n_fix Read a file + load fix reference docs targeted to the violation types. Claude writes the correct fix.

Install

pip install razorpay-i18n-mcp

Developer Integration Guide

Option 1 — Claude Code CLI (recommended)

For individual developers using Claude Code in the terminal or IDE.

pip install razorpay-i18n-mcp
claude mcp add --scope user i18n-code-builder razorpay-i18n-mcp

The --scope user flag registers it globally — available in every project, not just the current one.

Verify:

claude mcp list
# i18n-code-builder: razorpay-i18n-mcp  - ✓ Connected

Restart Claude Code, then use the tools:

Use the i18n_detect tool to scan ./internal/payment
Use the i18n_fix tool to fix ./internal/payment/processor.go

Option 2 — Project-level .mcp.json (team sharing)

For teams — commit this file so every developer who clones the repo gets the MCP automatically.

Create .mcp.json at the repo root:

{
  "mcpServers": {
    "i18n-code-builder": {
      "command": "razorpay-i18n-mcp"
    }
  }
}

Each developer still needs to run pip install razorpay-i18n-mcp once, then Claude Code picks up the server automatically from .mcp.json when they open the project.


Option 3 — Claude Desktop

For developers using the Claude Desktop app (Mac/Windows).

Add to ~/Library/Application Support/Claude/claude_desktop_config.json (Mac) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

{
  "mcpServers": {
    "i18n-code-builder": {
      "command": "razorpay-i18n-mcp"
    }
  }
}

Restart Claude Desktop. The tools appear automatically in every conversation.


Option 4 — Claude Agent SDK (programmatic / CI)

For building automated agents or running i18n checks in CI pipelines.

import asyncio
from claude_agent_sdk import query

async def check_i18n(service_path: str):
    async for msg in query(
        prompt=f"Use the i18n_detect tool to scan {service_path}",
        options={
            "mcpServers": {
                "i18n-code-builder": {
                    "command": "razorpay-i18n-mcp"
                }
            }
        }
    ):
        if "result" in msg:
            print(msg["result"])

asyncio.run(check_i18n("./internal/payment"))

Install the Agent SDK: pip install claude-agent-sdk


Usage

Always name the tool explicitly (i18n_detect / i18n_fix) so Claude routes to the MCP.

Detect violations

Use the i18n_detect tool to scan ./internal/payment

Claude receives the file contents alongside the skill's detection rules and language patterns, then identifies violations such as:

  • Hardcoded currency codes — "INR", "MYR", "SGD"
  • Hardcoded timezones — "Asia/Kolkata", time.Local
  • Hardcoded dial codes — "+91", "+60"
  • Currency math — amount * 100 (breaks JPY/BHD)
  • Org-based country logic — OrgID == "curlec"
  • float64 for money amounts
  • Country conditionals — if country == "MY"
  • Switch on country — case "IN":

Fix violations

Use the i18n_fix tool to fix ./internal/payment/processor.go

Pass the violation types from the detect step to load the most targeted reference docs:

Use the i18n_fix tool on ./internal/payment/processor.go with violation_types ["currency", "timezone"]

Claude receives the file and the relevant i18nify API reference, fix patterns, and anomaly docs, then writes the corrected file using the exact import paths and function signatures from the skill.

Typical workflow

1. Use the i18n_detect tool to scan ./internal
2. Use the i18n_fix tool to fix ./internal/payment/processor.go
3. Use the i18n_detect tool to scan ./internal/payment/processor.go

What gets detected

Level Examples
BASIC "INR", "Asia/Kolkata", "+91", amount * 100, time.Local, OrgID == "curlec", float64 for money, hardcoded date format constants
LOW_LEVEL if country == "MY", switch country { case "IN": }
HIGH_LEVEL Architectural violations — entire service flow is country-specific, cross-team effort > 1 sprint

Requirements

  • Python ≥ 3.11
  • No API key — no LLM calls inside the MCP

PyPI

https://pypi.org/project/razorpay-i18n-mcp/

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

razorpay_i18n_mcp-1.0.1.tar.gz (76.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

razorpay_i18n_mcp-1.0.1-py3-none-any.whl (90.3 kB view details)

Uploaded Python 3

File details

Details for the file razorpay_i18n_mcp-1.0.1.tar.gz.

File metadata

  • Download URL: razorpay_i18n_mcp-1.0.1.tar.gz
  • Upload date:
  • Size: 76.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for razorpay_i18n_mcp-1.0.1.tar.gz
Algorithm Hash digest
SHA256 77cb4f16c6387e5586d6f476bf2bf00354ecba5d9366e1d4b0a1a154a1e15f87
MD5 61470af2dcc2bb1b63074a90d26d7c49
BLAKE2b-256 72dd934f0253ef3f6eb245ca1bfcff5f5887396fdb4a21e50a5980573abd4363

See more details on using hashes here.

File details

Details for the file razorpay_i18n_mcp-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for razorpay_i18n_mcp-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e05b2bb33f305da0b0c64f900e89a1693c40cc0b8bd8e4fa9f92fb27ff9f863e
MD5 867b513f874bf375d53255675f53f0ef
BLAKE2b-256 7273a5a12c17c6a6c57e68b905cd85a2d72c8d06c2bca3f3641460d0e61e1c73

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page