MCP Multi-Language Support for Indian Languages
Detect the user's language, translate at the edges of a tool call, and localize error messages for Hindi, Tamil, Telugu, and other Indian languages.
Quick Answer / TL;DR
Detect the caller's language, translate the query to English at the boundary of a tool call so business logic stays language-agnostic, run the tool, then translate the result back — and keep tool names themselves in English for consistency across clients.
Key Takeaways
- Translate at the edges of a tool call; keep the business logic itself language-agnostic.
- Keep tool names in English always; localize descriptions and error messages only.
- Normalize Unicode input to NFC form before processing to avoid subtle matching bugs.
Detect, translate at the edge, translate back
Detect the language of the incoming query, translate it to English before it reaches tool logic, run the tool as normal, then translate the result back to the caller's language. This keeps every tool implementation language-agnostic instead of branching internally per language.
server.setRequestHandler(CallToolRequestSchema, async (request) => {
const { query, language } = request.params.arguments as { query: string; language?: string };
const detected = language ?? detectLanguage(query);
const englishQuery = detected !== "english" ? await translateText(query, "en") : query;
const result = await executeTool({ ...request, query: englishQuery });
if (detected !== "english") {
return { content: [{ type: "text", text: await translateText(JSON.stringify(result), detected) }] };
}
return result;
});Localized error messages
Error messages are worth hand-translating rather than machine-translating on the fly, since they are a small, fixed set and users read them under frustration where clarity matters most.
const ERROR_MESSAGES: Record<string, Record<string, string>> = {
validation_error: {
english: "Invalid input provided",
hindi: "अमान्य इनपुट प्रदान किया गया",
tamil: "தவறான உள்ளீடு வழங்கப்பட்டது",
},
};MCP Multi-Language Support for Indian Languages FAQs
Direct answers for developers, operators, and Indian teams evaluating MCP.