# Hreflang Generator MCP

> Hreflang Generator handles international SEO complexity by generating and validating required hreflang tags and XML sitemaps. This MCP ensures search engines correctly understand your site's regional structure, guaranteeing perfect indexing across multiple languages and regions. It automates the tedious process of auditing link reciprocity and setting x-default fallback URLs for massive multi-market websites.

## Overview
- **Category:** automation
- **Price:** Free
- **Tags:** hreflang, sitemap, seo-tools, internationalization, html-generation

## Description

Running a website in several countries or speaking different languages means you have to manage dozens of specific SEO rules just to keep Google happy. The Hreflang Generator handles this mess. It takes your list of regional URLs, determines the correct language codes, and builds all the necessary HTML tags and sitemap entries so search engines know exactly which version of your content belongs where. You won't have to manually check every link or worry about broken reciprocity anymore. By using this MCP through Vinkius, you get instant compliance checks on existing sites and perfect snippets for your upcoming XML maps. It’s the single place you need to validate and build out multi-regional SEO structures.

## Tools

### generate_html_tags
Generates HTML <link> tags for hreflang implementation

### generate_sitemap_entries
Generates XML snippet entries for an SEO sitemap

### validate_hreflang_integrity
Performs an audit of hreflang implementation

## Prompt Examples

**Prompt:** 
```
Generate HTML tags for these URLs: https://mysite.com/en, https://mysite.com/es, with https://mysite.com/en as x-default.
```

**Response:** 
```
<link rel="alternate" hreflang="en" href="https://mysite.com/en" />
<link rel="alternate" hreflang="es" href="https://mysite.com/es" />
<link rel="alternate" hreflang="x-default" href="https://mysite.com/en" />
```

**Prompt:** 
```
Check if this URL set is valid: [{targetUrl: 'https://site.com/us', languageCode: 'en', regionCode: 'US'}, {targetUrl: 'https://site.com/uk', languageCode: 'en', regionCode: 'GB'}], default: 'https://site.com/us'
```

**Response:** 
```
{"isCompliant": true, "missingXDefault": [], "brokenReciprocity": [], "languageGaps": []}
```

**Prompt:** 
```
Create sitemap entries for https://mysite.com/fr and https://mysite.com/en, using https://mysite.com/en as x-default.
```

**Response:** 
```
<url><loc>https://mysite.com/fr</loc><xhtml:link rel="alternate" hreflang="en" href="https://mysite.com/en"/><xhtml:link rel="alternate" hreflang="x-default" href="https://mysite.com/en"/></url>
<url><loc>https://mysite.com/en</loc><xhtml:link rel="alternate" hreflang="fr" href="https://mysite.com/fr"/><xhtml:link rel="alternate" hreflang="x-default" href="https://mysite.com/en"/></url>
```

## Capabilities

### Audit hreflang implementation
Check an entire set of URLs against best practices to find missing language pairings or broken link logic.

### Create HTML tags
Generate the specific `<link>` code required for every page, ensuring proper hreflang declarations are in place.

### Build XML sitemap entries
Produce structured XML snippets that include full alternate language links, perfect for submitting to search engine consoles.

## Use Cases

### The regional expansion launch
A marketing team needs to roll out a product site into Spain and Italy. Instead of having developers manually check every link on the Spanish version against the Italian version, they run the MCP's validation tool. It confirms that all necessary hreflang tags are present and that the 'x-default' fallback is correctly configured for both markets.

### The sitemap overhaul
A developer updates a major site structure, changing how their regional URLs map. They use the MCP to generate new XML entries for their sitemap. This ensures that when they submit the updated file, search engines get clean, accurate alternate language links immediately.

### The content migration cleanup
A company acquires a smaller competitor site and needs to merge its multilingual structure into their main platform. They use the MCP's validation tool to audit the existing pages against best practices, pinpointing every instance of broken language pairings before any live code deployment.

### The missing default page issue
A team notices that search engines aren't recognizing their main English site as the primary fallback. They use the MCP to generate the correct HTML tags, explicitly designating the desired URL as 'x-default', solving an otherwise invisible SEO gap.

## Benefits

- Eliminate manual link audits. Use `validate_hreflang_integrity` to check large URL sets quickly, finding broken reciprocity or missing default links that would otherwise cost you ranking authority.
- Save time on code generation. Instead of writing complex `<link>` tags by hand, the MCP generates all necessary HTML for hreflang implementation instantly using `generate_html_tags`.
- Keep sitemaps clean and compliant. Use `generate_sitemap_entries` to create perfectly structured XML snippets that search engines expect for international content mapping.
- Guarantee regional separation. This tool ensures that Google treats your German site as separate from your French site, preventing indexing confusion and distributing link equity correctly.
- Speed up global launches. Before rolling out a new market (e.g., Brazil), you can run the validation tools to confirm all SEO prerequisites are met in minutes.

## How It Works

The bottom line is that instead of guessing at complex SEO markup, you get validated, error-free code ready to paste directly into your web build.

1. You provide the MCP with a list of your regional URLs and define which version should be treated as the site's default.
2. The MCP runs an audit or generation process, analyzing your inputs to build perfect link structures and validate reciprocity across all provided links.
3. It gives you ready-to-copy code blocks, either full HTML tags for injection into pages or structured XML snippets for inclusion in your sitemap.

## Frequently Asked Questions

**How does Hreflang Generator help with XML sitemaps?**
It generates structured XML snippets for your sitemap, ensuring that every entry includes alternate language tags. This keeps search engines from treating regional versions as separate silos.

**Can I use the Hreflang Generator if my site only has two languages?**
Yes, it works for any number of languages. Just provide your primary URLs and language codes; the MCP handles the necessary link logic automatically.

**Is the validation tool reliable? Does Hreflang Generator guarantee compliance?**
The `validate_hreflang_integrity` tool checks against known SEO best practices for reciprocity and language gaps. While it doesn't replace human review, it automates 90% of the tedious checking process.

**What if I update my website structure? Do I need to use Hreflang Generator again?**
Absolutely. Any structural change, especially adding a new language or changing a URL path, requires re-running the generator tools to ensure your sitemaps and tags are current.

**Does Hreflang Generator only work for HTML tags?**
No. It provides both HTML tag generation using `generate_html_tags` and structured XML entries through `generate_sitemap_entries`.