Translations MCP Server

Translations MCP Server

Enables automatic discovery and fast searching of translation files in projects, supporting partial/exact key-value matching with file watching and multiple translation file formats.

Category
Visit Server

README

Translations MCP Server

A Model Context Protocol (MCP) server that automatically discovers and searches translation files in your projects.

Features

  • Configurable path: Specify exact translation file path via configuration (recommended)
  • Auto-discovery: Automatically finds translation files in en folders as fallback
  • Fast search: Indexed search through translation keys and values
  • Partial/exact matching: Support for both partial and exact match searches
  • File watching: Automatically reloads when translation files change
  • Multiple file formats: Supports common translation file names
  • TypeScript: Fully typed with proper interfaces and modular architecture

Quick Start

Method 1: Configured Path (Recommended)

Configure your MCP server to use a specific translation file:

{
  "mcpServers": {
    "translations-mcp": {
      "command": "translations-mcp",
      "args": ["path/to/your/translation.json"]
    }
  }
}

Method 2: Environment Variable

{
  "mcpServers": {
    "translations-mcp": {
      "command": "translations-mcp",
      "env": {
        "TRANSLATION_FILE_PATH": "src/assets/locales/en/translation.json"
      }
    }
  }
}

Method 3: Auto-Discovery (Fallback)

If no path is configured, the server will automatically search for translation files:

{
  "mcpServers": {
    "translations-mcp": {
      "command": "translations-mcp"
    }
  }
}

Architecture

The project is organized into focused modules for better maintainability:

src/
├── index.ts              # Main server entry point with MCP server setup
├── translation-discovery.ts # File discovery and search functionality
└── types.ts              # TypeScript interfaces and types

Module Descriptions

  • index.ts: Main MCP server setup, tool handlers, and entry point
  • translation-discovery.ts: Handles file discovery, indexing, and search functionality
  • types.ts: TypeScript interfaces for type safety across modules

Usage

The server provides two main tools:

1. find_translation

Search for translation keys and values:

{
  "name": "find_translation",
  "arguments": {
    "query": "search term",
    "exact": false
  }
}
  • query: String to search for in translation keys or values
  • exact: Boolean (optional) - whether to perform exact matching (default: false)

2. refresh_translations

Manually refresh the translation index (useful after file changes):

{
  "name": "refresh_translations",
  "arguments": {}
}

Returns the current number of indexed entries and refresh status.

Configuration Examples

For React/Next.js Projects

{
  "mcpServers": {
    "translations-mcp": {
      "command": "translations-mcp",
      "args": ["public/locales/en/translation.json"]
    }
  }
}

For ASP.NET Core + React Projects

{
  "mcpServers": {
    "translations-mcp": {
      "command": "translations-mcp",
      "args": ["ClientApp/public/locales/en/translation.json"]
    }
  }
}

Absolute Path

{
  "mcpServers": {
    "translations-mcp": {
      "command": "translations-mcp",
      "args": ["C:/projects/my-app/locales/en/translation.json"]
    }
  }
}

How It Works

  1. Discovery: On startup, recursively searches for translation files in folders named en
  2. Indexing: Builds an in-memory search index of all translation keys and values
  3. Search: Provides fast lookups with support for partial and exact matching

Supported Project Structures

The server can find translation files in various project structures:

  • ./en/translation.json (simple)
  • ./locales/en/translation.json (common)
  • ./src/assets/locales/en/translation.json (React/Angular)
  • ./ClientApp/public/locales/en/translation.json (ASP.NET Core with React)
  • ./Project.Name/ClientApp/public/locales/en/translation.json (deep .NET structures)

Installation

Install globally via npm:

npm install -g translations-mcp

Development

# Install dependencies
npm install

# Build
npm run build

# Run tests
npm run test

# Development mode
npm run dev

Testing

The project includes several test scripts:

  • npm run test:server - Test basic server functionality
  • npm run test:find - Test search functionality
  • npm run test:quick - Quick integration test
  • npm run test:all - Run all tests

Supported File Names

The server looks for these translation files in en folders:

  • translation.json
  • translations.json
  • common.json
  • messages.json

Adding to Claude Desktop

Recommended: Specify Your Translation File Path

{
  "mcpServers": {
    "translations": {
      "command": "translations-mcp",
      "args": ["path/to/your/translation.json"]
    }
  }
}

Alternative: Auto-Discovery

{
  "mcpServers": {
    "translations": {
      "command": "translations-mcp"
    }
  }
}

Benefits of Configured Path

Eliminates confusion - No more loading wrong translation files
Faster startup - No need to search directories
Predictable behavior - Always uses the exact file you specify
Works anywhere - Not limited to specific folder structures
Production ready - Points to your actual translation files, not test data

  • npm run clean - Remove compiled files
  • npm test - Run the main server functionality test
  • npm run test:server - Run comprehensive server tests with response parsing
  • npm run test:quick - Run quick global installation test
  • npm run test:all - Run all tests (server + quick)

Development Workflow

  1. Clone or download this package
  2. Run npm install to install dependencies
  3. Make your changes to files in the src/ directory
  4. Test with npm run dev for development or npm test to verify functionality
  5. Build for production with npm run build && npm start

License

MIT

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured