# i18n Hardcoded String Detector MCP for AI Agents MCP

> i18n Hardcoded String Detector finds text in your source code that hasn't been translated yet. It scans JSX and HTML for hardcoded strings and compares them against your translation dictionary to catch missing keys or leftover English labels before they reach production.

## Overview
- **Category:** developer-tools
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_MnZ7GP6wyVNT1qGzNQAkSfdyJd8ZduAumjbqc3sn/mcp
- **Tags:** i18n, ast, audit, codebase, automation

## Description

The i18n Hardcoded String Detector finds user-facing text that hasn't been internationalized. You're pushing a new feature and realize half the UI is still in English even though you have a Spanish locale set up. It's a nightmare to manually hunt through every component for that one stray label or aria-label. This MCP automates that audit by looking deep into your files, finding any text that should be a key, and comparing it to what's actually in your translation dictionary. You can use it via the Vinkius catalog to catch these errors before they hit production. No more manual grep commands or guessing if you missed an attribute during a large refactor.

## Tools

### analyze_codebase
Scans your project directory to find every piece of user-facing text. It uses AST parsing to be precise about what is actually a UI string.

### audit_strings
Compares found strings against your translation dictionary. This identifies both hardcoded text and keys that are no longer needed.

### verify_dictionary_syntax
Checks your JSON or JS translation files for structural errors. It ensures your agent can actually read the dictionary without crashing.

## Prompt Examples

**Prompt:** 
```
Scan my React project for hardcoded strings.
```

**Response:** 
```
I've scanned the directory. Here are the un-translated strings I found:

| File | Line | Text Found |
| :--- | :--- | :--- |
| `Header.jsx` | 12 | "Welcome Back" |
| `Button.tsx` | 45 | "Submit Form" |
| `Footer.html` | 5 | "Copyright 2024" |
```

**Prompt:** 
```
Check if my en.json file is valid.
```

**Response:** 
```
The structure of your `en.json` looks good. I verified the syntax and there are no missing commas or broken braces.
```

**Prompt:** 
```
Compare these strings against my translation keys.
```

**Response:** 
```
I found several mismatches:

* **Hardcoded Text:** "Settings" (not in dictionary)
* **Orphaned Keys:** `nav.profile_link` exists in JSON but is not used in the code.
```

## Capabilities

### Find un-translated text
Scans your components for any user-facing strings that are missing translation keys.

### Validate translation files
Checks that your JSON or JS dictionary files are structurally sound and readable.

### Identify orphaned keys
Spots translation keys that exist in your files but aren't being used anywhere in the UI.

### Audit accessibility labels
Specifically looks at attributes like aria-labels to ensure accessibility text is also localized.

### Detect hardcoded HTML
Finds plain text nodes within your HTML or JSX that should be dynamic keys.

## Use Cases

### Finding missed strings in a React PR
A developer submits a large PR with new components, and the agent uses analyze_codebase to ensure no English text slipped through.

### Cleaning up old translation keys
After a major refactor, you use audit_strings to identify which keys in your JSON files are now orphans.

### Validating new localization files
You just added a new language and need to ensure the syntax is perfect before deployment.

## Benefits

- Stop shipping hardcoded English to global users by catching strings during development.
- Clean up translation files using audit_strings to find and remove unused keys.
- Prevent broken builds by running verify_dictionary_syntax on your JSON dictionaries.
- Automate the tedious task of searching through JSX for aria-labels and UI text.
- Ensure accessibility compliance by auditing all localized labels.

## How It Works

The bottom line is you stop shipping broken, single-language UIs.

1. Point the MCP to your source code directory.
2. The tool parses your files using AST to find all potential string candidates.
3. You get a clear report of which strings are hardcoded and which keys are missing from your dictionary.

## Frequently Asked Questions

**How can I find missing translations with i18n Hardcoded String Detector?**
You can run a scan on your codebase to identify any text that isn't linked to a translation key. This helps you catch English labels before they are deployed.

**Does i18n Hardcoded String Detector work with React and JSX?**
Yes, it specifically parses JSX and HTML nodes to find user-facing text. It is designed for modern frontend frameworks.

**undefined**
undefined

**Can I use i18n Hardcoded String Detector to clean up my JSON files?**
Absolutely. You can identify keys that are no longer used in your components so you can safely remove them from your translation dictionaries.

**Will i18n Hardcoded String Detector catch aria-labels?**
Yes, the tool scans attributes like aria-labels to ensure your accessibility text is also properly internationalized.

**Is it possible to verify my translation file syntax with this MCP?**
Yes, you can check your JSON or JS dictionary files for structural errors to prevent broken builds during deployment.

**How does the tool identify strings without using regex?**
The tool performs deterministic AST traversal to distinguish between actual UI text nodes and technical identifiers like CSS classes or console logs.

**Can I use `audit_strings` with any translation format?**
Yes, as long as you provide the extracted keys and values from your dictionary to the tool.

**What does a 'hardcoded' violation mean?**
A violation is flagged when a string literal found in your UI (via `analyze_codebase`) does not exist as a key or value in your translation dictionary.