Lingo.dev MCP
Lingo.dev is an open-source, AI-powered i18n toolkit for instant localization with LLMs. It offers CLI, Compiler, CI/CD automation, and SDK for multilingual apps.
How to Install and Use Lingo.dev MCP
Lingo.dev MCP is an AI-powered tool for easy and instant localization of your apps using large language models (LLMs). Installing and using Lingo.dev MCP helps you translate your project efficiently. Below, you will find simple steps to get started with this tool, straight from its official documentation.
Step 1: Install Lingo.dev MCP
First, you need to add Lingo.dev MCP to your project. You can do this using npm, which is a tool that helps manage packages.
To install, open your terminal and run this command:
npm install lingo.dev
This will add the Lingo.dev MCP package to your project.
Step 2: Configure the Compiler
After installation, you will want to enable Lingo.dev in your build setup. This example shows how to set it up in a Next.js project. Think of this as telling your app to use Lingo.dev MCP for translations at build time.
Here is how you can do that:
import lingoCompiler from "lingo.dev/compiler";
const existingNextConfig = {};
export default lingoCompiler.next({
sourceLocale: "en",
targetLocales: ["es", "fr"],
})(existingNextConfig);
This code imports Lingo.dev’s compiler and specifies English as the source language and Spanish and French as the target languages.
Step 3: Run Your Build Command
With the compiler configured, the next step is to build your app. This runs the localization process and creates language-specific bundles.
Use the build command below depending on your setup, here is an example for Next.js:
next build
This command will generate language versions of your app, like Spanish and French, automatically.
Step 4: Use the CLI for Translation
Lingo.dev MCP also provides a command-line interface (CLI) for translating your content quickly. You can use this to run translations from your terminal.
To start the CLI, type:
npx lingo.dev@latest run
The CLI will detect changes in your text and only translate what's new or updated, saving time during development.
Step 5: Automatic Translation with CI/CD
For continuous integration, you can automate translations on every code push to your repository. Add a GitHub Action workflow like this:
# .github/workflows/i18n.yml
name: Lingo.dev i18n
on: [push]
jobs:
i18n:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: lingodotdev/lingo.dev@main
with:
api-key: ${{ secrets.LINGODOTDEV_API_KEY }}
This workflow runs Lingo.dev MCP automatically to keep translations fresh without manual work.
Step 6: Use Lingo.dev SDK for Real-time Translation
For apps with user-generated content, Lingo.dev SDK lets you translate on the fly. Here's how you can use it:
import { LingoDotDevEngine } from "lingo.dev/sdk";
const lingoDotDev = new LingoDotDevEngine({
apiKey: "your-api-key-here",
});
const content = {
greeting: "Hello",
farewell: "Goodbye",
message: "Welcome to our platform",
};
const translated = await lingoDotDev.localizeObject(content, {
sourceLocale: "en",
targetLocale: "es",
});
// This will return:
// { greeting: "Hola", farewell: "Adiós", message: "Bienvenido a nuestra plataforma" }
This example shows how to translate JSON objects instantly with your API key.
By following these simple steps, you can easily install and use Lingo.dev MCP for your project translations. Whether building, running commands, or automating with CI/CD, Lingo.dev MCP makes localization quick and practical.